diff options
author | Jonas Heinrich | 2024-08-24 15:57:52 +0200 |
---|---|---|
committer | GitHub | 2024-08-24 15:57:52 +0200 |
commit | 8763c0896fa3fdda4fe7ba0119dab7b681490101 (patch) | |
tree | 20ec2b8689c07a42ce9df5a91bc89d269efaf5fa /pkgs/by-name/de | |
parent | e980094f363c9bfa5c402a08296f1d74e2476259 (diff) | |
parent | 080dbd66d4037f381b050973f6a72f21ec656614 (diff) |
Merge pull request #336711 from onny/densify
densify: init at 0.3.2
Diffstat (limited to 'pkgs/by-name/de')
-rwxr-xr-x | pkgs/by-name/de/densify/package.nix | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/pkgs/by-name/de/densify/package.nix b/pkgs/by-name/de/densify/package.nix new file mode 100755 index 000000000000..0b2e1c314371 --- /dev/null +++ b/pkgs/by-name/de/densify/package.nix @@ -0,0 +1,78 @@ +{ + fetchFromGitHub, + lib, + python3Packages, + python3, + gtk3, + gobject-introspection, + wrapGAppsHook3, + xorg, + gnugrep, + ghostscript, +}: + +python3Packages.buildPythonApplication rec { + pname = "densify"; + version = "0.3.2"; + format = "other"; + + src = fetchFromGitHub { + owner = "hkdb"; + repo = "Densify"; + rev = "refs/tags/v${version}"; + hash = "sha256-giFFy8HiSmnOqFKLyrPD1kTry8hMQxotEgD/u2FEMRY="; + }; + + postPatch = '' + # Fix fail loading program icon from runtime path + substituteInPlace densify \ + --replace-fail "/icon.png" "/../share/densify/icon.png" + ''; + + dependencies = with python3Packages; [ pygobject3 ]; + + nativeBuildInputs = [ + gobject-introspection + wrapGAppsHook3 + ]; + + buildInputs = [ gtk3 ]; + + preFixup = '' + gappsWrapperArgs+=( + --prefix PATH : "${ + lib.makeBinPath [ + ghostscript + gnugrep + xorg.xrandr + ] + }" + ) + ''; + + installPhase = '' + runHook preInstall + + install -Dm755 -t $out/bin densify + install -Dm644 -t $out/share/applications densify.desktop + install -Dm644 -t $out/share/densify desktop-icon.png icon.png + + runHook postInstall + ''; + + postFixup = '' + substituteInPlace $out/share/applications/densify.desktop \ + --replace-fail "/opt/Densify/densify" "densify" \ + --replace-fail "Path=/opt/Densify/" "Path=$out/bin/" \ + --replace-fail "/opt/Densify/desktop-icon.png" "$out/share/densify/desktop-icon.png" + ''; + + meta = { + description = "Compress PDF files with Ghostscript"; + homepage = "https://github.com/hkdb/Densify"; + changelog = "https://github.com/hkdb/Densify/blob/${src.rev}/README.md"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ onny ]; + platforms = lib.platforms.all; + }; +} |