From mboxrd@z Thu Jan 1 00:00:00 1970 From: Efraim Flashner Subject: Re: [PATCH v6] Add hplip Date: Wed, 23 Mar 2016 22:46:59 +0200 Message-ID: <20160323204659.GB21191@debian-netbook> References: <87mvpyyfon.fsf@igalia.com> <20160320011904.50131806@scratchpost.org> <20160321230700.452ca6c1@scratchpost.org> <87r3f2ud9x.fsf@igalia.com> <20160322113001.52af072b@scratchpost.org> <87egb2u6gd.fsf@igalia.com> <20160322201207.790bd384@scratchpost.org> <874mbxshv2.fsf@igalia.com> <20160323103936.1edb6d18@scratchpost.org> <20160323123630.1b962166@scratchpost.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="4SFOXa2GPu3tIq4H" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aipgJ-00048X-JH for guix-devel@gnu.org; Wed, 23 Mar 2016 16:47:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aipgF-00018l-Go for guix-devel@gnu.org; Wed, 23 Mar 2016 16:47:07 -0400 Received: from flashner.co.il ([178.62.234.194]:57532) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aipgF-00018d-4P for guix-devel@gnu.org; Wed, 23 Mar 2016 16:47:03 -0400 Content-Disposition: inline In-Reply-To: <20160323123630.1b962166@scratchpost.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Danny Milosavljevic Cc: guix-devel@gnu.org --4SFOXa2GPu3tIq4H Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 23, 2016 at 12:36:30PM +0100, Danny Milosavljevic wrote: > Fiddle with some of the comments: >=20 > diff --git a/gnu/packages/cups.scm b/gnu/packages/cups.scm > index ff3d152..ce90a28 100644 > --- a/gnu/packages/cups.scm > +++ b/gnu/packages/cups.scm > @@ -26,6 +26,10 @@ > #:use-module (gnu packages) > #:use-module (gnu packages avahi) > #:use-module (gnu packages compression) > + #:use-module (gnu packages libusb) > + #:use-module (gnu packages autotools) > + #:use-module (gnu packages python) > + #:use-module (gnu packages scanner) > #:use-module (gnu packages image) > #:use-module (gnu packages fonts) ;font-dejavu > #:use-module (gnu packages fontutils) > @@ -297,3 +301,107 @@ device-specific programs to convert and print many = types of files.") > ("gnutls" ,gnutls) > ("cups-filters" ,cups-filters) > ("zlib" ,zlib))))) > + > +(define-public hplip > + (package > + (name "hplip") > + (version "3.16.2") > + (source (origin > + (method url-fetch) > + (uri (string-append "mirror://sourceforge/hplip/" > + "/hplip-" version ".tar.gz")) > + (sha256 > + (base32 > + "1nflgrbyl0fz35djnkn7qsfr5g4sh8lixqna9jvs52wasjllbj7j"))= )) > + (build-system gnu-build-system) > + (home-page "http://hplipopensource.com/") > + (synopsis "HP Printer Drivers") > + (description "Hewlett-Packard Printer Drivers and PPDs.") > + ;; Note: X11 license is only used in install-sh. > + (license (list license:gpl2 license:bsd-3 license:expat license:x11)) > + ;; TODO install apparmor profile files eventually. > + (arguments > + `(#:configure-flags > + `("--disable-network-build" > + ,(string-append "--prefix=3D" (assoc-ref %outputs "out")) > + ,(string-append "--sysconfdir=3D" (assoc-ref %outputs "out") "/= etc") > + ;; Disable until mime.types merging works (FIXME). > + "--disable-fax-build" > + "--enable-hpcups-install" > + "--enable-new-hpcups" > + "--enable-cups_ppd_install" > + "--enable-cups_drv_install" > + ;; TODO add foomatic drv install eventually. > + ;; TODO --enable-policykit eventually. > + ,(string-append "--with-cupsfilterdir=3D" > + (assoc-ref %outputs "out") > + "/lib/cups/filter") > + ,(string-append "--with-cupsbackenddir=3D" > + (assoc-ref %outputs "out") > + "/lib/cups/backend") > + ,(string-append "--with-icondir=3D" > + (assoc-ref %outputs "out") > + "/share/applications") > + ,(string-append "--with-systraydir=3D" > + (assoc-ref %outputs "out") > + "/etc/xdg")) > + #:phases (modify-phases %standard-phases > + (add-after 'unpack 'fix-libusb > + (lambda* (#:key inputs outputs #:allow-other-keys) > + (let ((out (assoc-ref outputs "out")) > + ;; FIXME use merged ppds (I think actually on= ly drvs need to be merged). > + (cupsdir (assoc-ref inputs "cups-minimal"))) > + (substitute* "base/g.py" pull the other parts of substitute* back so that they're under the 'u' in substitute > + (("'/usr/share;[^']*'") > + (string-append "'" cupsdir "/share'= ")) > + (("'/etc/hp/hplip.conf'") > + (string-append "'" out > + "/etc/hp/hplip.conf" = "'"))) > + (substitute* "Makefile.am" > + (("[[:blank:]]check-plugin\\.py[[:bl= ank:]]") " ") > + ;; FIXME Use beginning-of-word in re= gexp. > + (("[[:blank:]]plugin\\.py[[:blank:]]= ") " ") > + (("/usr/include/libusb-1.0") > + (string-append (assoc-ref inputs "l= ibusb") > + "/include/libusb-1.0= ")) > + (("hplip_statedir[ ]*=3D[ ]*/var/lib= /hp") > + ;; This is only user in the install= er. > + (string-append "hplip_statedir =3D = " out > + "/var/lib/hp")) > + (("hplip_confdir[ ]*=3D[ ]*/etc/hp") > + ;; This is only used for installing= the default config. > + (string-append "hplip_confdir =3D "= out > + "/etc/hp")) > + (("halpredir[ ]*=3D[ ]*/usr/share/ha= l/fdi/preprobe/10osvendor") > + ;; Note: We don't use hal. > + (string-append "halpredir =3D " out > + "/share/hal/fdi/prep= robe/10osvendor")) > + (("rulesdir[ ]*=3D[ ]*/etc/udev/rule= s.d") > + ;; udev rules will be merged by bas= e service. > + (string-append "rulesdir =3D " out > + "/lib/udev/rules.d")) > + (("rulessystemdir=3D/usr/lib/systemd= /system") > + ;; We don't use systemd. > + (string-append "rulessystemdir =3D = " out > + "/lib/systemd/system= ")) > + (("/etc/sane.d") > + (string-append out > + "/etc/sane.d")))))) > + (add-after 'fix-libusb 'autoreconf > + (lambda _ > + (setenv "AUTOMAKE" "automake --foreign") > + (zero? (system* "autoreconf" "-fi"))))))) > + ;; Python3 support is available starting from HPLIP-3.15.2 . > + (inputs `(("libjpeg" ,libjpeg) > + ("cups-minimal" ,cups-minimal) > + ("libusb" ,libusb) > + ("sane-backends" ,sane-backends) > + ("dbus" ,dbus) > + ("python-wrapper" ,python-wrapper) > + ("python" ,python) python-wrapper wraps python, so that python3 is presented to the system as python and as python3. Does the package really need both? > + ;; TODO: Make hp-setup find python-dbus. > + ("python-dbus" ,python-dbus))) > + (native-inputs `(("pkg-config" ,pkg-config) > + ("automake" ,automake) > + ("autoconf" ,autoconf) > + ("libtool" ,libtool))))) >=20 This was one of the packages that I was looking at packaging and it looks a lot more complicated than I would've thought. Great work so far on the package! --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --4SFOXa2GPu3tIq4H Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJW8wDAAAoJEPTB05F+rO6TwFgP/2cdxnRv4U6syWPY/mINUbk/ JJlzw6vvrOLiXgEbX1maFvfNqXvxxo6riEhO5X5kSmwj3yw29LKZAGfLfU0FO+lV 2vPl+mEu0WCPtU7YVi05TA/I3DUcekd0cOxrFkZ5m3iwaDBLkgiFukwCNQZFPVCU qLneVyaWrvzLvvJc3dvRbGSPZZwHLBxPnoYQ+Y7hcNsz4l3rlq4aXtdXQwPwGn15 66K32+nyGbUvYwbXpw8jYtsaK/wOf1+d1xoob3n3ZnJ9PMh0KW7ZlEpuYwwtUeji S3WiJBac8sSC6Teg12p3FxhVZE6fBadrYWcneaMVafydUzgQDyB9XLKYr4CIOjuD FoVgviukABTMHyEuQ20liJIGJIsEOYST1naIq9KajQ50do98gVSDqFcSFavrjVGZ dhEpNQrCPrs0d5OOursjRpntyZXJdSwG7UzJ00rVCI27rfXhk2u4cTRiP2t437hn eI5zdbH52IhqkjO/AKg8D99E/uI0HIR1osTzAFapQbEWn5lh9no8L6OxCBt0ck4X U7V6adj27865jjwp6QTsASC39D2bpC35ZERjHVzeQJvP5JBGgOuX0m1dTzBv0THM bdnD3VV2mKurS+2Pj1HVngk+Qpmy2L/0fiuOJJXJmDoZ4oH3+TVrTdLjQxDt2iQj lsOWQU7QDIeTrM2lbugG =u4Xv -----END PGP SIGNATURE----- --4SFOXa2GPu3tIq4H--