From b9cbe08694ddd8248ac32ce60d5fc40d5c619a54 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sun, 13 Oct 2019 16:07:44 +0200 Subject: [PATCH] gnu: util-linux: Move libraries to separate output. Fixes . Reported by Diego Nicola Barbato . * gnu/packages/linux.scm (util-linux)[outputs]: Add "dev". [arguments]: Update #:configure-flags accordingly. Add phase "adjust-bindirs", and rename "move-static-libraries" to "move-libraries", while adding a substitution for the .pc files. * gnu/packages/fontutils.scm (fontconfig)[propagated-inputs]: Use the "dev" output of UTIL-LINUX. * gnu/packages/glib.scm (glib)[propagated-inputs]: Likewise. --- gnu/packages/fontutils.scm | 2 +- gnu/packages/glib.scm | 2 +- gnu/packages/linux.scm | 39 ++++++++++++++++++++++++++++++++------ 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/gnu/packages/fontutils.scm b/gnu/packages/fontutils.scm index e355f7bb89..e01ea615be 100644 --- a/gnu/packages/fontutils.scm +++ b/gnu/packages/fontutils.scm @@ -304,7 +304,7 @@ fonts to/from the WOFF2 format.") ;; In Requires or Requires.private of fontconfig.pc. (propagated-inputs `(("expat" ,expat) ("freetype" ,freetype) - ("libuuid" ,util-linux))) + ("libuuid" ,util-linux "dev"))) (inputs `(("gs-fonts" ,gs-fonts))) (native-inputs `(("gperf" ,gperf) diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm index c558d9fcb6..ce695843ef 100644 --- a/gnu/packages/glib.scm +++ b/gnu/packages/glib.scm @@ -185,7 +185,7 @@ shared NFS home directories.") `(("pcre" ,pcre) ; in the Requires.private field of glib-2.0.pc ("libffi" ,libffi) ; in the Requires.private field of gobject-2.0.pc ;; These are in the Requires.private field of gio-2.0.pc - ("util-linux" ,util-linux) ; for libmount + ("util-linux" ,util-linux "dev") ;for libmount ("libselinux" ,libselinux) ("zlib" ,zlib))) (inputs diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index bc39757da2..5a7351eaee 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -1089,19 +1089,40 @@ providing the system administrator with some help in common tasks.") (("build_kill=yes") "build_kill=no")) #t)))) (build-system gnu-build-system) - (outputs '("out" - "static")) ; >2 MiB of static .a libraries + (outputs '("out" ;6.4 MiB executables and documentation + "dev" ;8.8 MiB shared libraries, headers and locales + "static")) ;2.9 MiB static .a libraries (arguments `(#:configure-flags (list "--disable-use-tty-group" "--enable-fs-paths-default=/run/current-system/profile/sbin" ;; Don't try to chown root:root mount and umount "--disable-makeinstall-chown" + "--localstatedir=/var" + (string-append "--localedir=" + (assoc-ref %outputs "dev") + "/share/locale") + (string-append "--includedir=" + (assoc-ref %outputs "dev") "/include") + (string-append "--exec_prefix=" + (assoc-ref %outputs "dev")) + (string-append "--bindir=" + (assoc-ref %outputs "out") "/bin") + (string-append "--sbindir=" + (assoc-ref %outputs "out") "/sbin") ;; Install completions where our ;; bash-completion package expects them. (string-append "--with-bashcompletiondir=" (assoc-ref %outputs "out") "/etc/bash_completion.d")) #:phases (modify-phases %standard-phases + (add-before 'configure 'adjust-bindirs + (lambda _ + ;; Some binaries are "hard coded" to use $exec_prefix/{,s}bin + ;; instead of --bindir. Adjust those to use $prefix instead. + (substitute* "configure" + (("\\$\\{exec_prefix\\}/(s?bin)" _ bin) + (string-append "${prefix}/" bin))) + #t)) (add-before 'build 'set-umount-file-name (lambda* (#:key outputs #:allow-other-keys) @@ -1122,12 +1143,13 @@ providing the system administrator with some help in common tasks.") (string-append net "/etc/services"))) #t))) (add-after - 'install 'move-static-libraries + 'install 'split-outputs (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out")) + (let ((dev (assoc-ref outputs "dev")) (static (assoc-ref outputs "static"))) + (mkdir-p (string-append static "/lib")) - (with-directory-excursion out + (with-directory-excursion dev (for-each (lambda (file) (rename-file file (string-append static "/" @@ -1138,7 +1160,12 @@ providing the system administrator with some help in common tasks.") ;; files so that Libtool does the right thing when both ;; the shared and static library is available. (substitute* (find-files "lib" "\\.la$") - (("old_library=.*") "old_library=''\n"))) + (("old_library=.*") "old_library=''\n")) + + ;; Finally, drop the unused "prefix=" from the pkg-config + ;; files to avoid a cyclic reference on "out". + (substitute* (find-files "lib" "\\.pc$") + (("^prefix=.*") ""))) #t)))))) (inputs `(("zlib" ,zlib) -- 2.23.0