mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 23:43:30 +00:00
cups-googlecloudprint: init at 20160502
This commit is contained in:
parent
177ddb91be
commit
6fca3c5700
@ -250,7 +250,7 @@ in
|
||||
drivers = mkOption {
|
||||
type = types.listOf types.path;
|
||||
default = [];
|
||||
example = literalExample "[ pkgs.gutenprint pkgs.hplip pkgs.splix ]";
|
||||
example = literalExample "with pkgs; [ gutenprint hplip splix cups-googlecloudprint ]";
|
||||
description = ''
|
||||
CUPS drivers to use. Drivers provided by CUPS, cups-filters,
|
||||
Ghostscript and Samba are added unconditionally. If this list contains
|
||||
|
64
pkgs/misc/cups/drivers/googlecloudprint/default.nix
Normal file
64
pkgs/misc/cups/drivers/googlecloudprint/default.nix
Normal file
@ -0,0 +1,64 @@
|
||||
{ stdenv, lib, fetchFromGitHub, python2, python2Packages, file, makeWrapper, cups }:
|
||||
|
||||
# Setup instructions can be found at https://github.com/simoncadman/CUPS-Cloud-Print#configuration
|
||||
# So the nix version is something like:
|
||||
# nix run nixpkgs.cups-googlecloudprint -c sudo setupcloudprint
|
||||
# nix run nixpkgs.cups-googlecloudprint -c sudo listcloudprinters
|
||||
|
||||
let pythonEnv = python2.buildEnv.override {
|
||||
extraLibs = with python2Packages; [
|
||||
six
|
||||
httplib2
|
||||
pycups
|
||||
];
|
||||
};
|
||||
|
||||
in stdenv.mkDerivation rec {
|
||||
name = "cups-googlecloudprint-${version}";
|
||||
version = "20160502";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "simoncadman";
|
||||
repo = "CUPS-Cloud-Print";
|
||||
rev = version;
|
||||
sha256 = "0760i12w7jrhq7fsgyz3yqla5cvpjb45n6m2jz96wsy3p3xf6dzz";
|
||||
};
|
||||
|
||||
buildInputs = [ cups makeWrapper ];
|
||||
|
||||
cupsgroup = "nonexistantgroup";
|
||||
NOPERMS = 1;
|
||||
|
||||
postConfigure = ''
|
||||
substituteInPlace Makefile --replace "${cups}" "$out"
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
pushd "$out"
|
||||
for s in lib/cups/backend/gcp lib/cups/driver/cupscloudprint
|
||||
do
|
||||
echo "Wrapping $s..."
|
||||
wrapProgram "$out/$s" --set PATH "${lib.makeBinPath [pythonEnv file]}" --prefix PYTHONPATH : "$out/share/cloudprint-cups"
|
||||
done
|
||||
|
||||
mkdir bin
|
||||
|
||||
for s in share/cloudprint-cups/*.py
|
||||
do
|
||||
if [ -x "$s" ] # Only wrapping those Python scripts marked as executable
|
||||
then
|
||||
o="bin/$(echo $s | sed 's,share/cloudprint-cups/\(.*\).py,\1,')"
|
||||
echo "Wrapping $o -> $s..."
|
||||
makeWrapper "$out/$s" "$o" --set PATH "${lib.makeBinPath [pythonEnv file]}" --prefix PYTHONPATH : "$out/share/cloudprint-cups"
|
||||
fi
|
||||
done
|
||||
popd
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Google Cloud Print driver for CUPS, allows printing to printers hosted on Google Cloud Print";
|
||||
homepage = http://ccp.niftiestsoftware.com;
|
||||
platforms = platforms.linux;
|
||||
license = licenses.gpl3;
|
||||
};
|
||||
}
|
@ -21682,6 +21682,8 @@ with pkgs;
|
||||
|
||||
cups-brother-hl1110 = pkgsi686Linux.callPackage ../misc/cups/drivers/hl1110 { };
|
||||
|
||||
cups-googlecloudprint = callPackage ../misc/cups/drivers/googlecloudprint { };
|
||||
|
||||
# this driver ships with pre-compiled 32-bit binary libraries
|
||||
cnijfilter_2_80 = pkgsi686Linux.callPackage ../misc/cups/drivers/cnijfilter_2_80 { };
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user