nixpkgs/pkgs/by-name/gr/graphicsmagick/imagemagick-compat.nix
Anderson Torres 4535b714c6
graphicsmagick: 1.3.42 -> 1.3.43 (#298535)
* graphicsmagick: adopt and refactor

- finalAttrs design pattern
- split man output
- rename patches
- update link that explains the patch

* graphicsmagick-imagemagick-compat: rename filename

* graphicsmagick-imagemagick-compat: hide it inside graphicsmagick.passthru

* graphicsmagick-imagemagick-compat: refactor

- use stdenvNoCC (since no compiler is called)
- split man output
- do not expose attributes
- set `dontBuild = true` instead of using a fake `buildPhase`
- install the artifacts via an elegant but questionable, Lispy dark magic

* graphicsmagick: migrate to by-name

* graphicsmagick: 1.3.42 -> 1.3.43

Co-authored-by: R. Ryantm <ryantm-bot@ryantm.com>

* graphicsmagick: remove patch

Since the security breach was solved upstream.

---------

Co-authored-by: R. Ryantm <ryantm-bot@ryantm.com>
2024-03-25 21:30:44 +01: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 = "A repack of GraphicsMagick that provides compatibility with ImageMagick interfaces";
};
}