Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

cups-googlecloudprint: init at 20160502

authored by

obadz and committed by
obadz
6fca3c57 177ddb91

+67 -1
+1 -1
nixos/modules/services/printing/cupsd.nix
··· 250 250 drivers = mkOption { 251 251 type = types.listOf types.path; 252 252 default = []; 253 - example = literalExample "[ pkgs.gutenprint pkgs.hplip pkgs.splix ]"; 253 + example = literalExample "with pkgs; [ gutenprint hplip splix cups-googlecloudprint ]"; 254 254 description = '' 255 255 CUPS drivers to use. Drivers provided by CUPS, cups-filters, 256 256 Ghostscript and Samba are added unconditionally. If this list contains
+64
pkgs/misc/cups/drivers/googlecloudprint/default.nix
··· 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 + }
+2
pkgs/top-level/all-packages.nix
··· 21682 21682 21683 21683 cups-brother-hl1110 = pkgsi686Linux.callPackage ../misc/cups/drivers/hl1110 { }; 21684 21684 21685 + cups-googlecloudprint = callPackage ../misc/cups/drivers/googlecloudprint { }; 21686 + 21685 21687 # this driver ships with pre-compiled 32-bit binary libraries 21686 21688 cnijfilter_2_80 = pkgsi686Linux.callPackage ../misc/cups/drivers/cnijfilter_2_80 { }; 21687 21689