From 80dd267525b5a59828548d933574018c2adcce71 Mon Sep 17 00:00:00 2001 From: Artturin Date: Wed, 13 Oct 2021 17:03:31 +0300 Subject: [PATCH 1/2] ncompress: modernize build and switch to a github source install only core tools move uncompress to uncompress-ncompress --- pkgs/tools/compression/ncompress/builder.sh | 15 ------------ pkgs/tools/compression/ncompress/default.nix | 25 +++++++++++++------- 2 files changed, 16 insertions(+), 24 deletions(-) delete mode 100644 pkgs/tools/compression/ncompress/builder.sh diff --git a/pkgs/tools/compression/ncompress/builder.sh b/pkgs/tools/compression/ncompress/builder.sh deleted file mode 100644 index 7a3f34aae469..000000000000 --- a/pkgs/tools/compression/ncompress/builder.sh +++ /dev/null @@ -1,15 +0,0 @@ -source $stdenv/setup -installFlags="PREFIX=$out" - -preBuild() { - cp Makefile.def Makefile - sed -i GNUmakefile -e 's/compress %/%/g' -} - -postInstall() { - rm $out/bin/uncompress* $out/bin/zcat* - ln -s compress $out/bin/uncompress - ln -s compress $out/bin/zcat -} - -genericBuild diff --git a/pkgs/tools/compression/ncompress/default.nix b/pkgs/tools/compression/ncompress/default.nix index f580709495ed..c4678cd96021 100644 --- a/pkgs/tools/compression/ncompress/default.nix +++ b/pkgs/tools/compression/ncompress/default.nix @@ -1,20 +1,27 @@ -{lib, stdenv, fetchurl}: +{ lib, stdenv, fetchFromGitHub }: stdenv.mkDerivation rec { pname = "ncompress"; version = "5.0"; - builder = ./builder.sh; - - src = fetchurl { - url = "mirror://sourceforge/project/ncompress/${pname}-${version}.tar.gz"; - sha256 = "004r086c11sw9vg2j3srgxpz98w8pycjl33bk3pgqnd0s92igrn4"; + src = fetchFromGitHub { + owner = "vapier"; + repo = "ncompress"; + rev = "v${version}"; + sha256 = "sha256-Yhs3C5/kR7Ve56E84usYJprxIMAIwXVahLi1N9TIfj0="; }; - meta = { + makeFlags = [ "PREFIX=$(out)" ]; + installTargets = "install_core"; + + postInstall = '' + mv $out/bin/uncompress $out/bin/uncompress-ncompress + ''; + + meta = with lib; { homepage = "http://ncompress.sourceforge.net/"; - license = lib.licenses.publicDomain; + license = licenses.publicDomain; description = "A fast, simple LZW file compressor"; - platforms = lib.platforms.unix; + platforms = platforms.unix; }; } From 510de41d3ec691f050f3d991f9fd0ccd26cc209e Mon Sep 17 00:00:00 2001 From: Artturin Date: Wed, 13 Oct 2021 17:13:46 +0300 Subject: [PATCH 2/2] python3Packages.binwalk: remove unneeded dependency ncompress its not listed here https://src.fedoraproject.org/rpms/binwalk/blob/rawhide/f/binwalk.spec or here https://github.com/ReFirmLabs/binwalk/blob/master/deps.sh --- pkgs/development/python-modules/binwalk/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/binwalk/default.nix b/pkgs/development/python-modules/binwalk/default.nix index 9f4966ffe897..f7e6e86a0a16 100644 --- a/pkgs/development/python-modules/binwalk/default.nix +++ b/pkgs/development/python-modules/binwalk/default.nix @@ -4,7 +4,6 @@ , stdenv , zlib , xz -, ncompress , gzip , bzip2 , gnutar @@ -31,7 +30,7 @@ buildPythonPackage rec { sha256 = "sha256-lfHXutAp06Xr/TSBpDwBUBC/mWI9XuyImoKwA3inqgU="; }; - propagatedBuildInputs = [ zlib xz ncompress gzip bzip2 gnutar p7zip cabextract squashfsTools xz pycrypto ] + propagatedBuildInputs = [ zlib xz gzip bzip2 gnutar p7zip cabextract squashfsTools xz pycrypto ] ++ lib.optionals visualizationSupport [ matplotlib pyqtgraph ] ++ lib.optionals (!stdenv.isDarwin) [ cramfsprogs cramfsswap sasquatch ];