From 7a7d5f66412fb74eb94439f3a566230a30ea2f7d Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 15 Mar 2019 22:12:07 +0100 Subject: gnu: hplip: Remove pre-built executable from the source. * gnu/packages/cups.scm (hplip)[source](snippet): Remove all the files matching 'elf-file?', not just ".so" files. This includes the 'locatedriver' executable found in the upstream tarball. --- gnu/packages/cups.scm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'gnu/packages/cups.scm') diff --git a/gnu/packages/cups.scm b/gnu/packages/cups.scm index 9f23b8e9ae..fa6e3ae2b6 100644 --- a/gnu/packages/cups.scm +++ b/gnu/packages/cups.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 Ricardo Wurmus -;;; Copyright © 2015, 2016, 2017 Ludovic Courtès +;;; Copyright © 2015, 2016, 2017, 2019 Ludovic Courtès ;;; Copyright © 2015, 2016, 2017, 2018 Efraim Flashner ;;; Copyright © 2016 Danny Milosavljevic ;;; Copyright © 2017 Leo Famulari @@ -423,8 +423,12 @@ should only be used as part of the Guix cups-pk-helper service.") (patches (search-patches "hplip-remove-imageprocessor.patch")) (snippet '(begin - ;; Delete non-free blobs - (for-each delete-file (find-files "." "\\.so$")) + ;; Delete non-free blobs: .so files, pre-compiled + ;; 'locatedriver' executable, etc. + (for-each delete-file + (find-files "." + (lambda (file stat) + (elf-file? file)))) (delete-file "prnt/hpcups/ImageProcessor.h") ;; Fix type mismatch. (substitute* "prnt/hpcups/genPCLm.cpp" -- cgit v1.2.3 From ea843715b56c935cfb73c6fed23c31c32ec13712 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 15 Mar 2019 22:14:01 +0100 Subject: gnu: hplip: Do not keep reference to GCC. Previously the 'dat2drv' and 'locatedriver' programs would be installed to share/hplip, and thus they would not get stripped during the 'strip' phase. Consequently, they retained references to GCC. * gnu/packages/cups.scm (hplip)[source](snippet): Change "data2drvdir" and "locatedriverdir" in Makefile.in. --- gnu/packages/cups.scm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'gnu/packages/cups.scm') diff --git a/gnu/packages/cups.scm b/gnu/packages/cups.scm index fa6e3ae2b6..b943444a14 100644 --- a/gnu/packages/cups.scm +++ b/gnu/packages/cups.scm @@ -430,9 +430,19 @@ should only be used as part of the Guix cups-pk-helper service.") (lambda (file stat) (elf-file? file)))) (delete-file "prnt/hpcups/ImageProcessor.h") + ;; Fix type mismatch. (substitute* "prnt/hpcups/genPCLm.cpp" (("boolean") "bool")) + + ;; Install binaries under libexec/hplip instead of + ;; share/hplip; that'll at least ensure they get stripped. + ;; It's not even clear that they're of any use though... + (substitute* "Makefile.in" + (("^dat2drvdir =.*") + "dat2drvdir = $(pkglibexecdir)\n") + (("^locatedriverdir =.*") + "locatedriverdir = $(pkglibexecdir)\n")) #t)))) (build-system gnu-build-system) (home-page "https://developers.hp.com/hp-linux-imaging-and-printing") -- cgit v1.2.3 From c9b3a72b6792c8195b0cdd8e5d7809db29419c7d Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 15 Mar 2019 22:36:46 +0100 Subject: gnu: hplip-minimal: Remove dependency on Python & co. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reduces the closure from 432 MiB to 160 MiB. * gnu/packages/cups.scm (hplip-minimal)[arguments]: Pass "--enable-lite-build" and remove 'wrap-binaries' phase. [inputs]: Remove all things Python. --- gnu/packages/cups.scm | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'gnu/packages/cups.scm') diff --git a/gnu/packages/cups.scm b/gnu/packages/cups.scm index b943444a14..b77fb20781 100644 --- a/gnu/packages/cups.scm +++ b/gnu/packages/cups.scm @@ -51,7 +51,8 @@ #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix utils) - #:use-module (srfi srfi-1)) + #:use-module (srfi srfi-1) + #:use-module (ice-9 match)) (define-public cups-filters (package @@ -564,10 +565,19 @@ should only be used as part of the Guix cups-pk-helper service.") (arguments (substitute-keyword-arguments (package-arguments hplip) ((#:configure-flags cf) - `(delete "--enable-qt5" ,cf)))) - (inputs - (fold alist-delete (package-inputs hplip) - '("python-pygobject" "python-pyqt"))) + ;; Produce a "light build", meaning that only the printer (CUPS) and + ;; scanner (SANE) support gets built, without all the 'hp-*' + ;; command-line tools. + `(cons "--enable-lite-build" + (delete "--enable-qt5" ,cf))) + ((#:phases phases) + ;; The 'wrap-binaries' is not needed here since the 'hp-*' programs + ;; are not installed. + `(alist-delete 'wrap-binaries ,phases)))) + (inputs (remove (match-lambda + ((label . _) + (string-prefix? "python" label))) + (package-inputs hplip))) (synopsis "GUI-less version of hplip"))) (define-public foomatic-filters -- cgit v1.2.3