nixpkgs/pkgs/by-name/gr/graphicsmagick/imagemagick-compat.nix
Alexis Hildebrandt 755b915a15 treewide: Remove indefinite article from meta.description
nix run nixpkgs#silver-searcher -- -G '\.nix$' -0l 'description.*"[Aa]n?' pkgs \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee 's/(description.*")[Aa]n? (.)/\1\U\2/'
2024-06-09 23:07:45 +02:00

49 lines
1.1 KiB
Nix

{ lib
, graphicsmagick
, stdenvNoCC
}:
stdenvNoCC.mkDerivation {
pname = "graphicsmagick-imagemagick-compat";
inherit (graphicsmagick) version;
outputs = [ "out" "man" ];
dontUnpack = true;
dontBuild = true;
# TODO: symlink libraries?
installPhase = let
utilities = [
"animate"
"composite"
"conjure"
"convert"
"display"
"identify"
"import"
"mogrify"
"montage"
];
linkUtilityBin = utility: ''
ln -s ${lib.getExe graphicsmagick} "$out/bin/${utility}"
'';
linkUtilityMan = utility: ''
ln -s ${lib.getMan graphicsmagick}/share/man/man1/gm.1.gz "$man/share/man/man1/${utility}.1.gz"
'';
in ''
runHook preInstall
mkdir -p "$out"/bin
${lib.concatStringsSep "\n" (map linkUtilityBin utilities)}
mkdir -p "$man"/share/man/man1
${lib.concatStringsSep "\n" (map linkUtilityMan utilities)}
runHook postInstall
'';
meta = graphicsmagick.meta // {
description = "Repack of GraphicsMagick that provides compatibility with ImageMagick interfaces";
};
}