diff options
author | Marius Bakke <marius@gnu.org> | 2021-05-22 22:46:43 +0200 |
---|---|---|
committer | Marius Bakke <marius@gnu.org> | 2021-06-13 01:00:47 +0200 |
commit | 557084a0c9f2e1b91f7e7da68d3f9540c044bffb (patch) | |
tree | f524ee55e1d836c354319e1df5ddfab0592911ac | |
parent | 425df5b081eed7d2a0eadf1bf968af201714b613 (diff) | |
download | guix-557084a0c9f2e1b91f7e7da68d3f9540c044bffb.tar.gz |
gnu: glib: Add "static" output.
* gnu/packages/glib.scm (glib)[outputs]: Add "static". [arguments]: Add "--default-library=both" to #:configure-flags. Add phase move-static-libraries. (glib-static): Remove variable. * gnu/packages/virtualization.scm (qemu)[native-inputs]: Change from GLIB-STATIC to GLIB:STATIC.
-rw-r--r-- | gnu/packages/glib.scm | 49 | ||||
-rw-r--r-- | gnu/packages/virtualization.scm | 2 |
2 files changed, 17 insertions, 34 deletions
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm index 94276ae0ef..f0be2ddaa4 100644 --- a/gnu/packages/glib.scm +++ b/gnu/packages/glib.scm @@ -11,7 +11,7 @@ ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com> ;;; Copyright © 2019, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; Copyright © 2019 Giacomo Leidi <goodoldpaul@autistici.org> -;;; Copyright © 2019, 2020 Marius Bakke <mbakke@fastmail.com> +;;; Copyright © 2019, 2020, 2021 Marius Bakke <marius@gnu.org> ;;; Copyright © 2020 Nicolò Balzarotti <nicolo@nixo.xyz> ;;; Copyright © 2020 Florian Pelz <pelzflorian@pelzflorian.de> ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> @@ -194,13 +194,14 @@ shared NFS home directories.") (substitute* "tests/spawn-test.c" (("/bin/sh") "sh")) #t)))) - ;; (properties '((hidden? . #t))) (build-system meson-build-system) - (outputs '("out" ; everything - "bin")) ; glib-mkenums, gtester, etc.; depends on Python + (outputs '("out" ;libraries, locales, etc + "static" ;static libraries + "bin")) ;executables; depends on Python (arguments `(#:disallowed-references (,tzdata-for-tests) - #:configure-flags '("-Dman=true" + #:configure-flags '("--default-library=both" + "-Dman=true" "-Dselinux=disabled") #:phases (modify-phases %standard-phases @@ -244,6 +245,16 @@ shared NFS home directories.") (setenv "HOME" (getcwd)) (setenv "XDG_CACHE_HOME" (getcwd)) #t)) + (add-after 'install 'move-static-libraries + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (static (assoc-ref outputs "static"))) + (mkdir-p (string-append static "/lib")) + (for-each (lambda (file) + (link file (string-append static "/lib/" + (basename file))) + (delete-file file)) + (find-files (string-append out "/lib") "\\.a$"))))) ;; Meson does not permit the bindir to be outside of prefix. (add-after 'install 'move-bin (lambda* (#:key outputs #:allow-other-keys) @@ -352,34 +363,6 @@ functions for strings and common data structures.") (string-append doc html)) #t))))))))) -;;; TODO: Merge into glib as a 'static' output on core-updates. -(define-public glib-static - (hidden-package - (package - (inherit glib) - (name "glib-static") - (outputs '("out")) - (arguments - (substitute-keyword-arguments (package-arguments glib) - ((#:configure-flags flags ''()) - `(cons* "--default-library=static" - "-Dselinux=disabled" - "-Dman=false" - "-Dgtk_doc=false" - "-Dinternal_pcre=false" - ,flags)) - ((#:phases phases) - `(modify-phases ,phases - (delete 'move-executables) - (replace 'install - ;; Only install the static libraries. - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (lib (string-append out "/lib"))) - (for-each (lambda (f) - (install-file f lib)) - (find-files "." "\\.a$")))))))))))) - (define gobject-introspection (package (name "gobject-introspection") diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm index 59b660de7c..34270ff8d3 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -366,7 +366,7 @@ exec smbd $@"))) ("texinfo" ,texinfo) ;; The following static libraries are required to build ;; the static output of QEMU. - ("glib-static" ,glib-static) + ("glib:static" ,glib "static") ("pcre:static" ,pcre "static") ("zlib:static" ,zlib "static"))) (home-page "https://www.qemu.org") |