git.iko.soy/typeable/nixpkgs
on master help sign in
cups-googlecloudprint: init at 20160502
commit6fca3c5700a80d791c07214c8376db2f65d4d331 authorobadz <obadz-git@obadz.com> dateSat 6 Oct 2018, 21:21 (8 years ago) parent177ddb9
3 files changed+67−1
nixos/modules/services/printing/cupsd.nix+1−1 pkgs/misc/cups/drivers/googlecloudprint/default.nix+64 pkgs/top-level/all-packages.nix+2
nixos/modules/services/printing/cupsd.nix+1−1
@@ -250,7 +250,7 @@ in
250250 drivers = mkOption {
251251 type = types.listOf types.path;
252252 default = [];
253− example = literalExample "[ pkgs.gutenprint pkgs.hplip pkgs.splix ]";
253+ example = literalExample "with pkgs; [ gutenprint hplip splix cups-googlecloudprint ]";
254254 description = ''
255255 CUPS drivers to use. Drivers provided by CUPS, cups-filters,
256256 Ghostscript and Samba are added unconditionally. If this list contains
pkgs/misc/cups/drivers/googlecloudprint/default.nixnew file+64
@@ -0,0 +1,64 @@
1+{ stdenv, lib, fetchFromGitHub, python2, python2Packages, file, makeWrapper, cups }:
2+
3+# Setup instructions can be found at https://github.com/simoncadman/CUPS-Cloud-Print#configuration
4+# So the nix version is something like:
5+# nix run nixpkgs.cups-googlecloudprint -c sudo setupcloudprint
6+# nix run nixpkgs.cups-googlecloudprint -c sudo listcloudprinters
7+
8+let pythonEnv = python2.buildEnv.override {
9+ extraLibs = with python2Packages; [
10+ six
11+ httplib2
12+ pycups
13+ ];
14+};
15+
16+in stdenv.mkDerivation rec {
17+ name = "cups-googlecloudprint-${version}";
18+ version = "20160502";
19+
20+ src = fetchFromGitHub {
21+ owner = "simoncadman";
22+ repo = "CUPS-Cloud-Print";
23+ rev = version;
24+ sha256 = "0760i12w7jrhq7fsgyz3yqla5cvpjb45n6m2jz96wsy3p3xf6dzz";
25+ };
26+
27+ buildInputs = [ cups makeWrapper ];
28+
29+ cupsgroup = "nonexistantgroup";
30+ NOPERMS = 1;
31+
32+ postConfigure = ''
33+ substituteInPlace Makefile --replace "${cups}" "$out"
34+ '';
35+
36+ postInstall = ''
37+ pushd "$out"
38+ for s in lib/cups/backend/gcp lib/cups/driver/cupscloudprint
39+ do
40+ echo "Wrapping $s..."
41+ wrapProgram "$out/$s" --set PATH "${lib.makeBinPath [pythonEnv file]}" --prefix PYTHONPATH : "$out/share/cloudprint-cups"
42+ done
43+
44+ mkdir bin
45+
46+ for s in share/cloudprint-cups/*.py
47+ do
48+ if [ -x "$s" ] # Only wrapping those Python scripts marked as executable
49+ then
50+ o="bin/$(echo $s | sed 's,share/cloudprint-cups/\(.*\).py,\1,')"
51+ echo "Wrapping $o -> $s..."
52+ makeWrapper "$out/$s" "$o" --set PATH "${lib.makeBinPath [pythonEnv file]}" --prefix PYTHONPATH : "$out/share/cloudprint-cups"
53+ fi
54+ done
55+ popd
56+ '';
57+
58+ meta = with stdenv.lib; {
59+ description = "Google Cloud Print driver for CUPS, allows printing to printers hosted on Google Cloud Print";
60+ homepage = http://ccp.niftiestsoftware.com;
61+ platforms = platforms.linux;
62+ license = licenses.gpl3;
63+ };
64+}
pkgs/top-level/all-packages.nix+2
@@ -21682,6 +21682,8 @@ with pkgs;
2168221682
2168321683 cups-brother-hl1110 = pkgsi686Linux.callPackage ../misc/cups/drivers/hl1110 { };
2168421684
21685+ cups-googlecloudprint = callPackage ../misc/cups/drivers/googlecloudprint { };
21686+
2168521687 # this driver ships with pre-compiled 32-bit binary libraries
2168621688 cnijfilter_2_80 = pkgsi686Linux.callPackage ../misc/cups/drivers/cnijfilter_2_80 { };
2168721689