me
/
guix
Archived
1
0
Fork 0

gnu: glib: Use gexps.

* gnu/packages/glib.scm (glib)[arguments]: Use a plain list.
[disallowed-references]: Adjust accordingly.
[configure-flags]: Likewise.
[phases]: Use gexps.
(glib-with-documentation)[phases]: Use gexps.
master
Maxim Cournoyer 2022-08-22 12:44:41 -04:00
parent 0eab5926dd
commit c6e4a14458
No known key found for this signature in database
GPG Key ID: 1260E46482E63562
1 changed files with 129 additions and 134 deletions

View File

@ -235,22 +235,23 @@ information, refer to the @samp{dbus-daemon(1)} man page.")))
"bin" ;executables; depends on Python
"debug"))
(arguments
`(#:disallowed-references
(,tzdata-for-tests
(list
#:disallowed-references
(cons tzdata-for-tests
;; Verify glib-mkenums, gtester, ... use the cross-compiled
;; python.
,@(if (%current-target-system)
(if (%current-target-system)
(map (cut gexp-input <> #:native? #t)
`(,(this-package-native-input "python")
,(this-package-native-input "python-wrapper")))
'()))
#:configure-flags ,#~(list "--default-library=both"
#:configure-flags #~(list "--default-library=both"
"-Dman=false"
"-Dselinux=disabled"
(string-append "--bindir="
#$output:bin "/bin"))
#:phases
(modify-phases %standard-phases
#~(modify-phases %standard-phases
;; Needed to pass the test phase on slower ARM and i686 machines.
(add-after 'unpack 'increase-test-timeout
(lambda _
@ -270,7 +271,7 @@ information, refer to the @samp{dbus-daemon(1)} man page.")))
"gdbus-peer.c" "appinfo.c" "desktop-app-info.c")
(("[ \t]*g_test_add_func.*;") "")))
,@(if (target-x86-32?)
#$@(if (target-x86-32?)
;; Comment out parts of timer.c that fail on i686 due to
;; excess precision when building with GCC 10:
;; <https://gitlab.gnome.org/GNOME/glib/-/issues/820>.
@ -297,7 +298,7 @@ information, refer to the @samp{dbus-daemon(1)} man page.")))
(search-input-file (or native-inputs inputs)
(string-append
"/bin/python"
,(version-major+minor
#$(version-major+minor
(package-version python))))))))
(add-before 'check 'pre-check
(lambda* (#:key native-inputs inputs outputs #:allow-other-keys)
@ -309,38 +310,34 @@ information, refer to the @samp{dbus-daemon(1)} man page.")))
(setenv "HOME" (getcwd))
(setenv "XDG_CACHE_HOME" (getcwd))))
(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"))
(lambda _
(mkdir-p (string-append #$output:static "/lib"))
(for-each (lambda (a)
(rename-file a (string-append static "/lib/"
(rename-file a (string-append #$output:static "/lib/"
(basename a))))
(find-files out "\\.a$")))))
(find-files #$output "\\.a$"))))
(add-after 'install 'patch-pkg-config-files
(lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
;; Do not refer to "bindir", which points to "${prefix}/bin".
;; We don't patch "bindir" to point to "$bin/bin", because that
;; would create a reference cycle between the "out" and "bin"
;; outputs.
(substitute*
(list
(string-append out "/lib/pkgconfig/gio-2.0.pc")
(string-append out "/lib/pkgconfig/glib-2.0.pc"))
(list (search-input-file outputs "lib/pkgconfig/gio-2.0.pc")
(search-input-file outputs "lib/pkgconfig/glib-2.0.pc"))
(("^bindir=.*")
"")
(("=\\$\\{bindir\\}/")
"="))))))))
"=")))))))
(native-inputs
`(("dbus" ,dbus)
("gettext" ,gettext-minimal)
("m4" ,m4) ; for installing m4 macros
("perl" ,perl) ; needed by GIO tests
("pkg-config" ,pkg-config)
("python" ,python) ; For 'patch-python-references
("python-wrapper" ,python-wrapper)
("tzdata" ,tzdata-for-tests))) ; for tests/gdatetime.c
(list dbus
gettext-minimal
m4 ;for installing m4 macros
perl ;needed by GIO tests
pkg-config
python ;for 'patch-python-references
python-wrapper
tzdata-for-tests)) ;for tests/gdatetime.c
(inputs
(list ;; "python", "python-wrapper" and "bash-minimal"
;; are for the 'patch-shebangs' phase, to make
@ -350,10 +347,10 @@ information, refer to the @samp{dbus-daemon(1)} man page.")))
python
python-wrapper))
(propagated-inputs
(list libffi ; in the Requires.private field of gobject-2.0.pc
pcre ; in the Requires.private field of glib-2.0.pc
(list libffi ;in the Requires.private field of gobject-2.0.pc
pcre ;in the Requires.private field of glib-2.0.pc
`(,util-linux "lib") ;for libmount
zlib)) ; in the Requires.private field of glib-2.0.pc
zlib)) ;in the Requires.private field of glib-2.0.pc
(native-search-paths
;; This variable is not really "owned" by GLib, but several related
;; packages refer to it: gobject-introspection's tools use it as a search
@ -397,7 +394,7 @@ functions for strings and common data structures.")
#~(cons "-Dgtk_doc=true"
(delete "-Dman=false" #$flags)))
((#:phases phases)
`(modify-phases ,phases
#~(modify-phases #$phases
(add-after 'unpack 'patch-docbook-xml
(lambda* (#:key inputs #:allow-other-keys)
(with-directory-excursion "docs"
@ -409,14 +406,12 @@ functions for strings and common data structures.")
(string-append (assoc-ref inputs "docbook-xml-4.2")
"/xml/dtd/docbook/"))))))
(add-after 'install 'move-doc
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(doc (assoc-ref outputs "doc"))
(html (string-append "/share/gtk-doc")))
(mkdir-p (string-append doc "/share"))
(lambda _
(let ((html "/share/gtk-doc"))
(mkdir-p (string-append #$output:doc "/share"))
(rename-file
(string-append out html)
(string-append doc html)))))))))))
(string-append #$output html)
(string-append #$output:doc html)))))))))))
(define (python-extension-suffix python triplet)
"Determine the suffix for C extensions for PYTHON when compiled