diff --git a/pkgs/tools/system/uefitool/bundle-destination.patch b/pkgs/tools/system/uefitool/bundle-destination.patch new file mode 100644 index 0000000000000..1087d497ba701 --- /dev/null +++ b/pkgs/tools/system/uefitool/bundle-destination.patch @@ -0,0 +1,17 @@ +--- + UEFITool/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/UEFITool/CMakeLists.txt b/UEFITool/CMakeLists.txt +index aef60d0..98723ac 100644 +--- a/UEFITool/CMakeLists.txt ++++ b/UEFITool/CMakeLists.txt +@@ -143,4 +143,4 @@ IF(UNIX AND (NOT APPLE) AND (NOT CYGWIN)) + INSTALL(FILES uefitool.desktop DESTINATION share/applications) + ENDIF() + +-INSTALL(TARGETS UEFITool BUNDLE DESTINATION "/Applications" ) ++INSTALL(TARGETS UEFITool BUNDLE DESTINATION "Applications" ) +-- +2.40.1 + diff --git a/pkgs/tools/system/uefitool/new-engine.nix b/pkgs/tools/system/uefitool/new-engine.nix new file mode 100644 index 0000000000000..a7d908493728a --- /dev/null +++ b/pkgs/tools/system/uefitool/new-engine.nix @@ -0,0 +1,38 @@ +{ + lib, + stdenv, + fetchFromGitHub, + qtbase, + cmake, + wrapQtAppsHook, + zip, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "uefitool"; + version = "A71"; + + src = fetchFromGitHub { + hash = "sha256-NRlrKm5+eED6oyvFRSEhn0EUbMsPJtuFAyv3vgY/IUI="; + owner = "LongSoft"; + repo = "uefitool"; + tag = finalAttrs.version; + }; + + buildInputs = [ qtbase ]; + nativeBuildInputs = [ + cmake + zip + wrapQtAppsHook + ]; + patches = lib.optionals stdenv.isDarwin [ ./bundle-destination.patch ]; + + meta = { + description = "UEFI firmware image viewer and editor"; + homepage = "https://github.com/LongSoft/uefitool"; + license = lib.licenses.bsd2; + maintainers = with lib.maintainers; [ athre0z ]; + platforms = lib.platforms.unix; + mainProgram = "uefitool"; + }; +}) diff --git a/pkgs/tools/system/uefitool/common.nix b/pkgs/tools/system/uefitool/old-engine.nix similarity index 62% rename from pkgs/tools/system/uefitool/common.nix rename to pkgs/tools/system/uefitool/old-engine.nix index fa8da1a9ac8ad..ba22a2348cc18 100644 --- a/pkgs/tools/system/uefitool/common.nix +++ b/pkgs/tools/system/uefitool/old-engine.nix @@ -1,8 +1,3 @@ -{ - version, - sha256, - installFiles, -}: { lib, mkDerivation, @@ -14,19 +9,14 @@ }: mkDerivation rec { - passthru = { - inherit version; - inherit sha256; - inherit installFiles; - }; pname = "uefitool"; - inherit version; + version = "0.28.0"; src = fetchFromGitHub { - inherit sha256; + hash = "sha256-StqrOMsKst2X2yQQ/Xl7iLAuA4QXEOyj2KtE7ZtoUNg="; owner = "LongSoft"; - repo = pname; - rev = version; + repo = "uefitool"; + tag = version; }; buildInputs = [ qtbase ]; @@ -43,15 +33,16 @@ mkDerivation rec { installPhase = '' mkdir -p "$out"/bin - cp ${lib.concatStringsSep " " installFiles} "$out"/bin + cp UEFITool UEFIReplace/UEFIReplace UEFIPatch/UEFIPatch "$out"/bin ''; - meta = with lib; { + meta = { description = "UEFI firmware image viewer and editor"; homepage = "https://github.com/LongSoft/uefitool"; - license = licenses.bsd2; - maintainers = [ ]; + license = lib.licenses.bsd2; + maintainers = with lib.maintainers; [ athre0z ]; # uefitool supposedly works on other platforms, but their build script only works on linux in nixpkgs - platforms = platforms.linux; + platforms = lib.platforms.linux; + mainProgram = "UEFITool"; }; } diff --git a/pkgs/tools/system/uefitool/variants.nix b/pkgs/tools/system/uefitool/variants.nix index 851338497472c..173113e1ca668 100644 --- a/pkgs/tools/system/uefitool/variants.nix +++ b/pkgs/tools/system/uefitool/variants.nix @@ -1,24 +1,5 @@ -{ libsForQt5 }: -let - common = opts: libsForQt5.callPackage (import ./common.nix opts) { }; -in -rec { - new-engine = common { - version = "A62"; - sha256 = "sha256-U89j0BV57luv1c9hoYJtisKLxFezuaGFokZ29/NJ0xg="; - installFiles = [ - "build/UEFITool/UEFITool" - "build/UEFIFind/UEFIFind" - "build/UEFIExtract/UEFIExtract" - ]; - }; - old-engine = common rec { - version = "0.28.0"; - sha256 = "1n2hd2dysi5bv2iyq40phh1jxc48gdwzs414vfbxvcharcwapnja"; - installFiles = [ - "UEFITool" - "UEFIReplace/UEFIReplace" - "UEFIPatch/UEFIPatch" - ]; - }; +{ libsForQt5, qt6Packages }: +{ + new-engine = qt6Packages.callPackage ./new-engine.nix { }; + old-engine = libsForQt5.callPackage ./old-engine.nix { }; }