peazip: refactored to use finalAttrs syntax

This commit is contained in:
Anna Aurora 2025-08-07 14:03:03 +02:00
parent b5413d1707
commit 5d86a99031
No known key found for this signature in database

View File

@ -15,17 +15,24 @@
writableTmpDirAsHomeHook, writableTmpDirAsHomeHook,
}: }:
stdenv.mkDerivation rec { let
# peazip looks for the "7z", not "7zz"
_7z = runCommand "7z" { } ''
mkdir -p $out/bin
ln -s ${_7zz}/bin/7zz $out/bin/7z
'';
in
stdenv.mkDerivation (finalAttrs: {
pname = "peazip"; pname = "peazip";
version = "10.6.0"; version = "10.6.0";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "peazip"; owner = "peazip";
repo = "peazip"; repo = "peazip";
rev = version; rev = finalAttrs.version;
hash = "sha256-oRgsT2j5P6jbaBAgLMGArJ+pCVSgC/CJcHM45mRw6Bs="; hash = "sha256-oRgsT2j5P6jbaBAgLMGArJ+pCVSgC/CJcHM45mRw6Bs=";
}; };
sourceRoot = "${src.name}/peazip-sources"; sourceRoot = "${finalAttrs.src.name}/peazip-sources";
postPatch = '' postPatch = ''
# set it to use compression programs from $PATH # set it to use compression programs from $PATH
@ -48,7 +55,7 @@ stdenv.mkDerivation rec {
libqtpas libqtpas
]); ]);
NIX_LDFLAGS = "--as-needed -rpath ${lib.makeLibraryPath buildInputs}"; env.NIX_LDFLAGS = "--as-needed -rpath ${lib.makeLibraryPath finalAttrs.buildInputs}";
buildPhase = '' buildPhase = ''
pushd dev pushd dev
@ -58,12 +65,6 @@ stdenv.mkDerivation rec {
popd popd
''; '';
# peazip looks for the "7z", not "7zz"
_7z = runCommand "7z" { } ''
mkdir -p $out/bin
ln -s ${_7zz}/bin/7zz $out/bin/7z
'';
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall
@ -122,4 +123,4 @@ stdenv.mkDerivation rec {
maintainers = with lib.maintainers; [ annaaurora ]; maintainers = with lib.maintainers; [ annaaurora ];
mainProgram = "peazip"; mainProgram = "peazip";
}; };
} })