From 10bfa40677d2e3b23b7b71b6c64b965d537bbb6b Mon Sep 17 00:00:00 2001 From: Dima Date: Sat, 21 Sep 2019 16:54:35 +0200 Subject: [PATCH 1/3] testdisk: deduplicating testdisk/photorec Testdisk/Photorec has been packaged twice. This deduplicates the packages by consolidating the packages into one and throwing an error upon use of the outdated package. this also adds qphotorec, which was previously not built and ensures it's wrapped correctly. Please note that I took the liberty to merge the maintainers lists. --- pkgs/tools/misc/testdisk/default.nix | 27 ---------- .../default.nix | 49 +++++++++++++------ pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 9 ++-- 4 files changed, 40 insertions(+), 46 deletions(-) delete mode 100644 pkgs/tools/misc/testdisk/default.nix rename pkgs/tools/system/{testdisk-photorec => testdisk}/default.nix (53%) diff --git a/pkgs/tools/misc/testdisk/default.nix b/pkgs/tools/misc/testdisk/default.nix deleted file mode 100644 index 14c152236d6b..000000000000 --- a/pkgs/tools/misc/testdisk/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ stdenv, fetchurl, ncurses, libjpeg, e2fsprogs, zlib, openssl, libuuid, ntfs3g }: - -stdenv.mkDerivation { - name = "testdisk-7.1"; - - src = fetchurl { - url = https://www.cgsecurity.org/testdisk-7.0.tar.bz2; - sha256 = "0ba4wfz2qrf60vwvb1qsq9l6j0pgg81qgf7fh22siaz649mkpfq0"; - }; - - buildInputs = [ ncurses libjpeg zlib openssl libuuid ] - ++ stdenv.lib.optionals (!stdenv.isDarwin) [ e2fsprogs ntfs3g ]; - - enableParallelBuilding = true; - - meta = { - homepage = https://www.cgsecurity.org/wiki/TestDisk; - license = stdenv.lib.licenses.gpl2Plus; - platforms = stdenv.lib.platforms.all; - maintainers = [ stdenv.lib.maintainers.eelco ]; - longDescription = '' - TestDisk is a program for data recovery, primarily designed to - help recover lost partitions and/or make non-booting disks - bootable again. - ''; - }; -} diff --git a/pkgs/tools/system/testdisk-photorec/default.nix b/pkgs/tools/system/testdisk/default.nix similarity index 53% rename from pkgs/tools/system/testdisk-photorec/default.nix rename to pkgs/tools/system/testdisk/default.nix index 06f6751213b2..52cb3c4cee14 100644 --- a/pkgs/tools/system/testdisk-photorec/default.nix +++ b/pkgs/tools/system/testdisk/default.nix @@ -1,35 +1,51 @@ -{ stdenv +{ mkDerivation +, stdenv , fetchurl , ncurses , libuuid +, pkgconfig , libjpeg , zlib -, ntfs3g -, e2fsprogs +, libewf +, enableNtfs ? false, ntfs3g ? null +, enableExtFs ? false, e2fsprogs ? null +, enableQt ? false, qtbase ? null, qttools ? null, qwt ? null }: -stdenv.mkDerivation rec { - pname = "testdisk-photorec"; - version = "7.0"; +assert enableNtfs -> ntfs3g != null; +assert enableExtFs -> e2fsprogs != null; +assert enableQt -> qtbase != null; +assert enableQt -> qttools != null; +assert enableQt -> qwt != null; + +(if enableQt then mkDerivation else stdenv.mkDerivation) rec { + pname = "testdisk"; + version = "7.1"; src = fetchurl { url = "https://www.cgsecurity.org/testdisk-${version}.tar.bz2"; - sha256 = "0ba4wfz2qrf60vwvb1qsq9l6j0pgg81qgf7fh22siaz649mkpfq0"; + sha256 = "1zlh44w67py416hkvw6nrfmjickc2d43v51vcli5p374d5sw84ql"; }; + + enableParallelBuilding = true; + buildInputs = [ ncurses libuuid - # optional: + pkgconfig libjpeg zlib - ntfs3g - e2fsprogs - #libewf # makes it fail to build - #qt4 # for qphotorec, which does not build in 7.0 - ]; + libewf + ] + ++ stdenv.lib.optional enableNtfs ntfs3g + ++ stdenv.lib.optional enableExtFs e2fsprogs + ++ stdenv.lib.optional enableQt [ qtbase qttools qwt ]; + + NIX_CFLAGS_COMPILE="-Wno-unused"; + meta = with stdenv.lib; { homepage = https://www.cgsecurity.org/wiki/Main_Page; downloadPage = https://www.cgsecurity.org/wiki/TestDisk_Download; - description = "Data recovery utilities"; + description = "Testdisk / Photorec - Data recovery utilities"; longDescription = '' TestDisk is a powerful free data recovery software. It was primarily designed to help recover lost partitions and/or make non-booting disks @@ -44,8 +60,9 @@ stdenv.mkDerivation rec { it will still work even if your media's file system has been severely damaged or reformatted. ''; - license = licenses.gpl2; - maintainers = with maintainers; [ fgaz ]; + license = stdenv.lib.licenses.gpl2Plus; + platforms = stdenv.lib.platforms.all; + maintainers = with maintainers; [ fgaz eelco ]; }; } diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index d2d438cf099c..97d15e82f2a3 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -364,6 +364,7 @@ mapAliases ({ terraform-provider-libvirt = terraform-providers.libvirt; # added 2018-09-28 terraform-provider-nixos = terraform-providers.nixos; # added 2018-09-28 tesseract_4 = tesseract4; # added 2018-12-19 + testdisk-photorec = throw "This package was a duplicate, please use testdisk or testdisk-qt instead"; # added 2019-10-13 tex-gyre-bonum-math = tex-gyre-math.bonum; # added 2018-04-03 tex-gyre-pagella-math = tex-gyre-math.pagella; # added 2018-04-03 tex-gyre-schola-math = tex-gyre-math.schola; # added 2018-04-03 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3ba6e479366f..c65bbc032046 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6409,8 +6409,6 @@ in termplay = callPackage ../tools/misc/termplay { }; - testdisk-photorec = callPackage ../tools/system/testdisk-photorec { }; - tewisay = callPackage ../tools/misc/tewisay { }; texmacs = if stdenv.isDarwin @@ -6836,7 +6834,12 @@ in xe = callPackage ../tools/system/xe { }; - testdisk = callPackage ../tools/misc/testdisk { }; + testdisk = libsForQt5.callPackage ../tools/system/testdisk { + enableExtFs = !stdenv.isDarwin; + enableNtfs = !stdenv.isDarwin; + }; + + testdisk-qt = testdisk.override { enableQt = true; }; textql = callPackage ../development/tools/textql { }; From b2b29d4398fd048b25ca206d5e45272e871c7ebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 14 Oct 2019 10:48:51 +0100 Subject: [PATCH 2/3] testdisk: inline platform specific option defaults Makes it easier to read since one does not need to be aware of overrides in all-packages.nix. --- pkgs/tools/system/testdisk/default.nix | 5 ++--- pkgs/top-level/all-packages.nix | 5 +---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/pkgs/tools/system/testdisk/default.nix b/pkgs/tools/system/testdisk/default.nix index 52cb3c4cee14..c157c4a355fd 100644 --- a/pkgs/tools/system/testdisk/default.nix +++ b/pkgs/tools/system/testdisk/default.nix @@ -7,8 +7,8 @@ , libjpeg , zlib , libewf -, enableNtfs ? false, ntfs3g ? null -, enableExtFs ? false, e2fsprogs ? null +, enableNtfs ? stdenv.isDarwin, ntfs3g ? null +, enableExtFs ? stdenv.isDarwin, e2fsprogs ? null , enableQt ? false, qtbase ? null, qttools ? null, qwt ? null }: @@ -65,4 +65,3 @@ assert enableQt -> qwt != null; maintainers = with maintainers; [ fgaz eelco ]; }; } - diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c65bbc032046..5c6fae4ed5a8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6834,10 +6834,7 @@ in xe = callPackage ../tools/system/xe { }; - testdisk = libsForQt5.callPackage ../tools/system/testdisk { - enableExtFs = !stdenv.isDarwin; - enableNtfs = !stdenv.isDarwin; - }; + testdisk = libsForQt5.callPackage ../tools/system/testdisk { }; testdisk-qt = testdisk.override { enableQt = true; }; From bda58c465d570001635a98821ddece32b956ccaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 14 Oct 2019 10:51:57 +0100 Subject: [PATCH 3/3] testdisk: pkgconfig belongs to nativeBuildInputs --- pkgs/tools/system/testdisk/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/system/testdisk/default.nix b/pkgs/tools/system/testdisk/default.nix index c157c4a355fd..0e499e1fd7c2 100644 --- a/pkgs/tools/system/testdisk/default.nix +++ b/pkgs/tools/system/testdisk/default.nix @@ -31,7 +31,6 @@ assert enableQt -> qwt != null; buildInputs = [ ncurses libuuid - pkgconfig libjpeg zlib libewf @@ -40,6 +39,8 @@ assert enableQt -> qwt != null; ++ stdenv.lib.optional enableExtFs e2fsprogs ++ stdenv.lib.optional enableQt [ qtbase qttools qwt ]; + nativeBuildInputs = [ pkgconfig ]; + NIX_CFLAGS_COMPILE="-Wno-unused"; meta = with stdenv.lib; {