ieda: init at 0-unstable-2024-10-11 (#338769)
[NixPkgs.git] / pkgs / by-name / gu / guymager / package.nix
blob27700c07f4867068d8d69770600dd53da3688d56
2   lib,
3   stdenv,
4   fetchurl,
5   libsForQt5,
6   dpkg,
7   parted,
8   udev,
9   libewf-legacy,
10   libbfio,
11   libguytools,
14 stdenv.mkDerivation (finalAttrs: {
15   pname = "guymager";
16   version = "0.8.13";
18   src = fetchurl {
19     url = "mirror://sourceforge/project/guymager/guymager/LatestSource/guymager-${finalAttrs.version}.tar.gz";
20     hash = "sha256-xDsQ/d6fyfLOr4uXpdoqMljfFrVgQTUu0t2e5opcaRg=";
21   };
23   enableParallelBuilding = true;
25   nativeBuildInputs = [
26     dpkg
27     libsForQt5.qmake
28     libsForQt5.qttools
29     libsForQt5.wrapQtAppsHook
30   ];
31   buildInputs = [
32     libsForQt5.qtbase
33     libewf-legacy
34     libbfio
35     libguytools
36     parted
37     udev
38   ];
40   postPatch = ''
41     patchShebangs compileinfo.sh
42     substituteInPlace manuals/guymager_body.1 config.cpp \
43       --replace-fail "/etc/guymager/guymager.cfg" "$out/share/guymager/guymager.cfg"
44     substituteInPlace compileinfo.sh \
45       --replace-fail " debian/changelog" "" \
46       --replace-fail "dpkg-parsechangelog" "dpkg-parsechangelog -l changelog"
47     substituteInPlace threadscan.cpp \
48     --replace-fail '/lib,/usr/lib,/usr/lib64,/usr/local/lib' '${
49       builtins.replaceStrings [ ":" ] [ "," ] (
50         lib.makeLibraryPath [
51           udev
52           parted
53         ]
54       )
55     }'
56     substituteInPlace org.freedesktop.guymager.policy guymager.pro main.cpp guymager.cfg \
57       --replace-fail /usr $out
58   '';
60   installPhase = ''
61     runHook preInstall
62     mkdir -p $out/{bin,share}
63     make clean
64     rm -rf *.cpp *.h *.pro
65     cp -aR . "$out/share/guymager/"
66     makeWrapper $out/share/guymager/guymager $out/bin/guymager
67     runHook postInstall
68   '';
70   meta = {
71     description = "Forensic imager for media acquisition";
72     mainProgram = "guymager";
73     homepage = "https://guymager.sourceforge.io";
74     maintainers = with lib.maintainers; [ d3vil0p3r ];
75     platforms = lib.platforms.linux;
76     sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
77     license = lib.licenses.gpl2Only;
78   };