nixpkgs/pkgs/applications/office/pdfmm/default.nix
Travis A. Everett f318c22bbe pdfmm: fix build on (at least) macOS
The package isn't marked linux-only, but pulling locale from
glibc effectively limited it to linux. Using the generalized
locale attr gets it building on macOS.

Also:
- While looking into this, I noticed that the script only
  uses xmessage if zenity isn't present, so I think we can
  drop that dependency.
- Not super familiar with what the package should run on,
  but I went ahead and set the platform meta based on what
  I've personally verified.
2024-04-07 15:14:37 -05:00

59 lines
1.2 KiB
Nix

{ bash
, coreutils
, fetchFromGitHub
, ghostscript
, locale
, gnome
, gnused
, lib
, resholve
}:
resholve.mkDerivation rec {
pname = "pdfmm";
version = "unstable-2019-01-24";
src = fetchFromGitHub {
owner = "jpfleury";
repo = pname;
rev = "45ee7796659d23bb030bf06647f1af85e1d2b52d";
hash = "sha256-TOISD/2g7MwnLrtpMnfr2Ln0IiwlJVNavWl4eh/uwN0=";
};
dontBuild = true;
installPhase = ''
install -Dm 0755 pdfmm $out/bin/pdfmm
'';
solutions.default = {
scripts = [
"bin/pdfmm"
];
interpreter = "${bash}/bin/bash";
inputs = [
coreutils
ghostscript
locale
gnome.zenity
gnused
];
fake = {
# only need xmessage if zenity is unavailable
external = [ "xmessage" ];
};
execer = [
"cannot:${gnome.zenity}/bin/zenity"
];
keep."$toutLu" = true;
};
meta = with lib; {
description = "Graphical assistant to reduce the size of a PDF file";
homepage = "https://github.com/jpfleury/pdfmm";
license = licenses.gpl3Only;
maintainers = with maintainers; [ urandom ];
mainProgram = "pdfmm";
platforms = platforms.linux ++ platforms.darwin;
};
}