about summary refs log tree commit diff
path: root/pkgs/misc
diff options
context:
space:
mode:
authorRobin Gloster <mail@glob.in>2016-07-21 00:56:43 +0000
committerRobin Gloster <mail@glob.in>2016-07-21 00:56:43 +0000
commit1f04b4a566d3c8f8de5354ed09dee46557c4abe3 (patch)
treeb8239cfc8cced160642aa698e18048844164ccc6 /pkgs/misc
parentcc540843fe88a5e490e07e861f8dbb8f4714ece7 (diff)
parentdb7b4fb073d25832ecc4e216d410ad2dde153c43 (diff)
downloadnixlib-1f04b4a566d3c8f8de5354ed09dee46557c4abe3.tar
nixlib-1f04b4a566d3c8f8de5354ed09dee46557c4abe3.tar.gz
nixlib-1f04b4a566d3c8f8de5354ed09dee46557c4abe3.tar.bz2
nixlib-1f04b4a566d3c8f8de5354ed09dee46557c4abe3.tar.lz
nixlib-1f04b4a566d3c8f8de5354ed09dee46557c4abe3.tar.xz
nixlib-1f04b4a566d3c8f8de5354ed09dee46557c4abe3.tar.zst
nixlib-1f04b4a566d3c8f8de5354ed09dee46557c4abe3.zip
Merge remote-tracking branch 'upstream/master' into hardened-stdenv
Diffstat (limited to 'pkgs/misc')
-rw-r--r--pkgs/misc/cups/drivers/cnijfilter2/default.nix122
1 files changed, 122 insertions, 0 deletions
diff --git a/pkgs/misc/cups/drivers/cnijfilter2/default.nix b/pkgs/misc/cups/drivers/cnijfilter2/default.nix
new file mode 100644
index 000000000000..1e95d63e5172
--- /dev/null
+++ b/pkgs/misc/cups/drivers/cnijfilter2/default.nix
@@ -0,0 +1,122 @@
+{ stdenv, lib, fetchzip, autoconf, automake, cups, glib, libxml2, libusb
+, withDebug ? false }:
+
+stdenv.mkDerivation rec {
+  name = "cnijfilter2-${version}";
+
+  version = "5.30";
+
+  src = fetchzip {
+    url = "http://gdlp01.c-wss.com/gds/9/0100007129/01/cnijfilter2-source-5.30-1.tar.gz";
+    sha256 = "0gnl9arwmkblljsczspcgggx85a19vcmhmbjfyv1bq236yqixv5c";
+  };
+
+  buildInputs = [
+    cups automake autoconf glib libxml2 libusb
+  ];
+
+  # lgmon3's --enable-libdir flag is used soley for specifying in which
+  # directory the cnnnet.ini cache file should reside.
+  # NixOS uses /var/cache/cups, and given the name, it seems like a reasonable
+  # place to put the cnnet.ini file, and thus we do so.
+  #
+  # Note that the drivers attempt to dlopen
+  # $out/lib/cups/filter/libcnbpcnclapicom2.so
+  buildPhase = ''
+    mkdir -p $out/lib
+    cp com/libs_bin64/* $out/lib
+    mkdir -p $out/lib/cups/filter
+    ln -s $out/lib/libcnbpcnclapicom2.so $out/lib/cups/filter
+
+    export NIX_LDFLAGS="$NIX_LDFLAGS -L$out/lib"
+  '' + lib.optionalString withDebug ''
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -D__DEBUG__ -DDEBUG_LOG"
+  '' + ''
+
+    (
+      cd lgmon3
+      substituteInPlace src/Makefile.am \
+        --replace /usr/include/libusb-1.0 \
+                  ${libusb.dev}/include/libusb-1.0
+      ./autogen.sh --prefix=$out --enable-progpath=$out/bin \
+                   --enable-libdir=/var/cache/cups
+      make
+    )
+
+    (
+      cd cmdtocanonij2
+      ./autogen.sh --prefix=$out
+      make
+    )
+
+    (
+      cd cnijbe2
+      substituteInPlace src/Makefile.am \
+        --replace "/usr/lib/cups/backend" \
+                  "$out/lib/cups/backend"
+      ./autogen.sh --prefix=$out --enable-progpath=$out/bin
+      make
+    )
+
+    (
+      cd rastertocanonij
+      ./autogen.sh --prefix=$out --enable-progpath=$out/bin
+      make
+    )
+
+    (
+      cd tocanonij
+      ./autogen.sh --prefix=$out --enable-progpath=$out/bin
+      make
+    )
+
+    (
+      cd tocnpwg
+      ./autogen.sh --prefix=$out --enable-progpath=$out/bin
+      make
+    )
+  '';
+
+  installPhase = ''
+    (
+      cd lgmon3
+      make install
+    )
+
+    (
+      cd cmdtocanonij2
+      make install
+    )
+
+    (
+      cd cnijbe2
+      make install
+    )
+
+    (
+      cd rastertocanonij
+      make install
+    )
+
+    (
+      cd tocanonij
+      make install
+    )
+
+    (
+      cd tocnpwg
+      make install
+    )
+
+    mkdir -p $out/share/cups/model
+    cp ppd/*.ppd $out/share/cups/model
+  '';
+
+  meta = with lib; {
+    description = "Canon InkJet printer drivers for the MG7500, MG6700, MG6600, MG5600, MG2900, MB2000, MB2300, iB4000, MB5000, MB5300, iP110, E450, MX490, E480, MG7700, MG6900, MG6800, MG5700, MG3600, and G3000 series.";
+    homepage = "http://support-th.canon-asia.com/contents/TH/EN/0100712901.html";
+    license = licenses.unfree;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ cstrahan ];
+  };
+}