Unverified Commit f5ea5067 authored by kirillrdy's avatar kirillrdy Committed by GitHub
Browse files

guymager: init at 0.8.13 (#278529)

parents 19c8a9d0 bceebe87
Loading
Loading
Loading
Loading
+79 −0
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchurl,
  libsForQt5,
  dpkg,
  parted,
  udev,
  libewf-legacy,
  libbfio,
  libguytools,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "guymager";
  version = "0.8.13";

  src = fetchurl {
    url = "mirror://sourceforge/project/guymager/guymager/LatestSource/guymager-${finalAttrs.version}.tar.gz";
    hash = "sha256-xDsQ/d6fyfLOr4uXpdoqMljfFrVgQTUu0t2e5opcaRg=";
  };

  enableParallelBuilding = true;

  nativeBuildInputs = [
    dpkg
    libsForQt5.qmake
    libsForQt5.qttools
    libsForQt5.wrapQtAppsHook
  ];
  buildInputs = [
    libsForQt5.qtbase
    libewf-legacy
    libbfio
    libguytools
    parted
    udev
  ];

  postPatch = ''
    patchShebangs compileinfo.sh
    substituteInPlace manuals/guymager_body.1 config.cpp \
      --replace-fail "/etc/guymager/guymager.cfg" "$out/share/guymager/guymager.cfg"
    substituteInPlace compileinfo.sh \
      --replace-fail " debian/changelog" "" \
      --replace-fail "dpkg-parsechangelog" "dpkg-parsechangelog -l changelog"
    substituteInPlace threadscan.cpp \
    --replace-fail '/lib,/usr/lib,/usr/lib64,/usr/local/lib' '${
      builtins.replaceStrings [ ":" ] [ "," ] (
        lib.makeLibraryPath [
          udev
          parted
        ]
      )
    }'
    substituteInPlace org.freedesktop.guymager.policy guymager.pro main.cpp guymager.cfg \
      --replace-fail /usr $out
  '';

  installPhase = ''
    runHook preInstall
    mkdir -p $out/{bin,share}
    make clean
    rm -rf *.cpp *.h *.pro
    cp -aR . "$out/share/guymager/"
    makeWrapper $out/share/guymager/guymager $out/bin/guymager
    runHook postInstall
  '';

  meta = {
    description = "Forensic imager for media acquisition";
    mainProgram = "guymager";
    homepage = "https://guymager.sourceforge.io";
    maintainers = with lib.maintainers; [ d3vil0p3r ];
    platforms = lib.platforms.linux;
    sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
    license = lib.licenses.gpl2Only;
  };
})
+56 −0
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchurl,
  libsForQt5,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "libguytools";
  version = "2.1.0";

  src = fetchurl {
    url = "mirror://sourceforge/project/libguytools/libguytools/LatestSource/tools-${finalAttrs.version}.tar.gz";
    hash = "sha256-eVYvjo2wKW2g9/9hL9nbQa1FRWDMMqMHok0V/adPHVY=";
  };

  qmakeFlags = [
    "trunk.pro"
    "toolsstatic.pro"
  ];

  enableParallelBuilding = true;

  nativeBuildInputs = [
    libsForQt5.qmake
    libsForQt5.wrapQtAppsHook
  ];
  dontWrapQtApps = true;
  buildInputs = [ libsForQt5.qtbase ];

  postPatch = ''
    sed -i "/dpkg-buildflags/d" tools.pro
    patchShebangs create_version_file.sh
  '';

  preConfigure = ''
    ./create_version_file.sh
  '';

  installPhase = ''
    runHook preInstall
    mkdir -p $out
    cp -r lib $out/
    cp -r include $out/
    runHook postInstall
  '';

  meta = {
    description = "Small programming toolbox";
    mainProgram = "libguytools";
    homepage = "https://libguytools.sourceforge.io";
    maintainers = with lib.maintainers; [ d3vil0p3r ];
    platforms = lib.platforms.linux;
    license = lib.licenses.gpl2Plus;
  };
})