about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/graphics/graphicsmagick/compat.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/graphics/graphicsmagick/compat.nix')
-rw-r--r--nixpkgs/pkgs/applications/graphics/graphicsmagick/compat.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/graphics/graphicsmagick/compat.nix b/nixpkgs/pkgs/applications/graphics/graphicsmagick/compat.nix
new file mode 100644
index 000000000000..9517aa78ee46
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/graphicsmagick/compat.nix
@@ -0,0 +1,37 @@
+{ stdenv, graphicsmagick }:
+
+stdenv.mkDerivation {
+  pname = "graphicsmagick-imagemagick-compat";
+  inherit (graphicsmagick) version;
+
+  dontUnpack = true;
+  buildPhase = "true";
+
+  utils = [
+    "composite"
+    "conjure"
+    "convert"
+    "identify"
+    "mogrify"
+    "montage"
+    "animate"
+    "display"
+    "import"
+  ];
+
+  # TODO: symlink libraries?
+  installPhase = ''
+    mkdir -p "$out"/bin
+    mkdir -p "$out"/share/man/man1
+    for util in ''${utils[@]}; do
+      ln -s ${graphicsmagick}/bin/gm "$out/bin/$util"
+      ln -s ${graphicsmagick}/share/man/man1/gm.1.gz "$out/share/man/man1/$util.1.gz"
+    done
+  '';
+
+  meta = {
+    description = "ImageMagick interface for GraphicsMagick";
+    license = stdenv.lib.licenses.free;
+    platforms = stdenv.lib.platforms.all;
+  };
+}