testdisk: deduplicating testdisk/photorec (#69945)

testdisk: deduplicating testdisk/photorec
This commit is contained in:
Jörg Thalheim
2019-10-14 10:53:09 +01:00
committed by GitHub
4 changed files with 38 additions and 47 deletions
@@ -1,35 +1,52 @@
{ stdenv
{ mkDerivation
, stdenv
, fetchurl
, ncurses
, libuuid
, pkgconfig
, libjpeg
, zlib
, ntfs3g
, e2fsprogs
, libewf
, enableNtfs ? stdenv.isDarwin, ntfs3g ? null
, enableExtFs ? stdenv.isDarwin, 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:
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 ];
nativeBuildInputs = [ pkgconfig ];
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 +61,8 @@ 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 ];
};
}