From 410e9f1dbddf65194dd936288e581ceeeb840fe9 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Thu, 19 Aug 2021 10:59:24 +0200 Subject: gnu: glib: Update to 2.68.3. * gnu/packages/glib.scm (glib): Update to 2.68.3 and remove a left over comment. --- gnu/packages/glib.scm | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'gnu/packages/glib.scm') diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm index ae88dbe9e7..a9c7f4a81c 100644 --- a/gnu/packages/glib.scm +++ b/gnu/packages/glib.scm @@ -178,7 +178,7 @@ shared NFS home directories.") (define glib (package (name "glib") - (version "2.68.0") + (version "2.68.3") (source (origin (method url-fetch) @@ -187,7 +187,7 @@ shared NFS home directories.") name "/" (string-take version 4) "/" name "-" version ".tar.xz")) (sha256 - (base32 "1sh3h6b734cxhdd1qlzvhxq6rc7k73dsisap5y3s419s9xc4ywv7")) + (base32 "0f1iprj7v0b5wn9njj39dkl25g6filfs7i4ybk20jq821k1a7qg7")) (patches (search-patches "glib-appinfo-watch.patch" "glib-skip-failing-test.patch")) @@ -291,10 +291,6 @@ shared NFS home directories.") (("bindir=\\$\\{prefix\\}/bin") "") (("=\\$\\{bindir\\}/") "=")) #t)))))) - ;; TODO: see above for explanation. - ;; #:configure-flags (list (string-append "--bindir=" - ;; (assoc-ref %outputs "bin") - ;; "/bin")) (native-inputs `(("docbook-xsl" ,docbook-xsl) ("gettext" ,gettext-minimal) -- cgit v1.2.3 From a24631a6dfc765c1e4e3f56cca51bd12672e8726 Mon Sep 17 00:00:00 2001 From: Maxime Devos Date: Fri, 20 Aug 2021 15:55:26 +0200 Subject: gnu: appstream-glib: Fix failing tests. * gnu/packages/glib.scm (appstream-glib)[arguments]<#:phases>{set-home}: Add a new phase 'set-home' for tests that want to write to $HOME. Signed-off-by: Leo Famulari --- gnu/packages/glib.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gnu/packages/glib.scm') diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm index a9c7f4a81c..f0328498e4 100644 --- a/gnu/packages/glib.scm +++ b/gnu/packages/glib.scm @@ -1097,7 +1097,11 @@ Some codes examples can be find at: (lambda _ (substitute* "libappstream-glib/as-self-test.c" (("g_test_add_func.*as_test_store_local_appdata_func);") "")) - #t))))) + #t)) + (add-before 'check 'set-home + (lambda _ + ;; Some tests want write access there. + (setenv "HOME" "/tmp")))))) (home-page "https://github.com/hughsie/appstream-glib") (synopsis "Library for reading and writing AppStream metadata") (description "This library provides objects and helper methods to help -- cgit v1.2.3 From 3fced772e34cb332f6299411cd6501eadef760cb Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sun, 29 Aug 2021 13:54:33 +0300 Subject: gnu: python-pygobject: Extend test timeout. * gnu/packages/glib.scm (python-pygobject)[arguments]: Replace check phase and extend the test timeout. --- gnu/packages/glib.scm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gnu/packages/glib.scm') diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm index f0328498e4..d1d0f5b273 100644 --- a/gnu/packages/glib.scm +++ b/gnu/packages/glib.scm @@ -801,6 +801,14 @@ useful for C++.") '("test_atoms.py" "test_overrides_gtk.py")) #t))))) (build-system meson-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + ;; The default 90 seconds can be too low on slower machines. + (invoke "meson" "test" "--timeout-multiplier" "5"))))))) (native-inputs `(("glib-bin" ,glib "bin") ("pkg-config" ,pkg-config) -- cgit v1.2.3 From 35848d2c2ed9263a4c15f5358fcb4ec26db8d18a Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 15 Sep 2021 22:10:06 +0200 Subject: gnu: glib: Avoid timer.c test failure on i686-linux. * gnu/packages/glib.scm (glib)[arguments]: In 'disable-failing-tests' phase, modify "glib/tests/timer.c" on i[56]86 to address test failure. --- gnu/packages/glib.scm | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'gnu/packages/glib.scm') diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm index d1d0f5b273..c05a57dcbf 100644 --- a/gnu/packages/glib.scm +++ b/gnu/packages/glib.scm @@ -231,6 +231,18 @@ shared NFS home directories.") (substitute* '("contenttype.c" "gdbus-address-get-session.c" "gdbus-peer.c" "appinfo.c" "desktop-app-info.c") (("[ \t]*g_test_add_func.*;") ""))) + + ,@(if (let ((system (or (%current-target-system) + (%current-system)))) + (or (string-prefix? "i686-" system) + (string-prefix? "i586-" system))) + ;; Add the 'volatile' qualifier for doubles to avoid excess + ;; precision, which leads to test failures: + ;; . + '((substitute* "glib/tests/timer.c" + (("gdouble elapsed") + "volatile gdouble elapsed"))) + '()) #t)) ;; Python references are not being patched in patch-phase of build, ;; despite using python-wrapper as input. So we patch them manually. -- cgit v1.2.3 From 967f8af877b5e428d839190744b765b0d10a96b8 Mon Sep 17 00:00:00 2001 From: Maxime Devos Date: Tue, 24 Aug 2021 09:21:09 +0200 Subject: gnu: dbus-glib: Support cross-compilation. This allows cross-compilation to succeed when not using QEMU's transparent emulation, and the cross-compilation is not a pointless cross-compilation like x86_64 -> i686. * gnu/packages/glib.scm (dbus-glib)[arguments]: Set --with-dbus-binding-tool to a native version of "dbus-binding-tool" when cross-compiling. --- gnu/packages/glib.scm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'gnu/packages/glib.scm') diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm index c05a57dcbf..cf54b3187a 100644 --- a/gnu/packages/glib.scm +++ b/gnu/packages/glib.scm @@ -562,6 +562,16 @@ translated.") (base32 "09g8swvc95bk1z6j8sw463p2v0dqmgm2zjfndf7i8sbcyq67dr3w")))) (build-system gnu-build-system) + (arguments + (if (%current-target-system) + `(#:configure-flags + ;; Run a native 'dbus-binding-tool' instead of a cross-compiled + ;; 'dbus-binding-tool' when cross-compiling. + ,#~(list + (string-append + "--with-dbus-binding-tool=" + #+(file-append this-package "/bin/dbus-binding-tool")))) + '())) (propagated-inputs ; according to dbus-glib-1.pc `(("dbus" ,dbus) ("glib" ,glib))) -- cgit v1.2.3 From c185e5ad6720aa5196fec849e1145cc492f0ed27 Mon Sep 17 00:00:00 2001 From: Maxime Devos Date: Tue, 24 Aug 2021 12:26:36 +0200 Subject: gnu: gobject-introspection: Don't build introspection data when cross-compiling. * gnu/packages/glib.scm (gobject-introspection)[arguments]<#:configure-flags>: Set gi_cross_use_prebuilt_gi to 'true'. (gobject-introspection)[arguments]<#:phases>{set-typelibs}: New phase, avoid undefined variable in "meson.build". --- gnu/packages/glib.scm | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'gnu/packages/glib.scm') diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm index cf54b3187a..829ef32221 100644 --- a/gnu/packages/glib.scm +++ b/gnu/packages/glib.scm @@ -410,8 +410,26 @@ functions for strings and common data structures.") "gobject-introspection-absolute-shlib-path.patch")))) (build-system meson-build-system) (arguments - `(#:phases + `(,@(if (%current-target-system) + `(#:configure-flags + '("-Dgi_cross_use_prebuilt_gi=true" + ;; Building introspection data requires running binaries + ;; for ‘host’ on ‘build’, so don't do that. + ;; + ;; TODO: it would be nice to have introspection data anyways + ;; as discussed here: https://issues.guix.gnu.org/50201#60. + "-Dbuild_introspection_data=false")) + '()) + #:phases (modify-phases %standard-phases + ,@(if (%current-target-system) + ;; 'typelibs' is undefined. + `((add-after 'unpack 'set-typelibs + (lambda _ + (substitute* "meson.build" + (("\\bsources: typelibs\\b") + "sources: []"))))) + '()) (add-after 'unpack 'do-not-use-/usr/bin/env (lambda _ (substitute* "tools/g-ir-tool-template.in" -- cgit v1.2.3 From 4ab2c0d600851d3db6572f735ff7048ff3011a6b Mon Sep 17 00:00:00 2001 From: Maxime Devos Date: Tue, 24 Aug 2021 12:30:42 +0200 Subject: gobject-introspection: Fix inputs when cross-compiling. * gnu/packages/glib.scm (gobject-introspection)[native-inputs]: Add 'bison' and 'flex' when cross-compiling. (gobject-introspection)[inputs]: Use 'python' instead of 'python-wrapper' when cross-compiling. Remove 'bison', 'flex' when cross-compiling. --- gnu/packages/glib.scm | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'gnu/packages/glib.scm') diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm index 829ef32221..f2606a70af 100644 --- a/gnu/packages/glib.scm +++ b/gnu/packages/glib.scm @@ -438,11 +438,19 @@ functions for strings and common data structures.") #t))))) (native-inputs `(("glib" ,glib "bin") - ("pkg-config" ,pkg-config))) + ("pkg-config" ,pkg-config) + ;; TODO(core-updates): Unconditionally place "flex" and "bison" + ;; in 'native-inputs'. + ,@(if (%current-target-system) + `(("bison" ,bison) + ("flex" ,flex)) + '()))) (inputs - `(("bison" ,bison) - ("flex" ,flex) - ("python" ,python-wrapper) + `(,@(if (%current-target-system) + `(("python" ,python)) + `(("bison" ,bison) + ("flex" ,flex) + ("python" ,python-wrapper))) ("zlib" ,zlib))) (propagated-inputs `(("glib" ,glib) -- cgit v1.2.3 From 838dcb7c2b162532df71d1fec1dacb73042ce131 Mon Sep 17 00:00:00 2001 From: Maxime Devos Date: Tue, 24 Aug 2021 13:10:21 +0200 Subject: gobject-introspection: Correct library name when cross-compiling. * gnu/packages/glib.scm (python-extension-suffix, correct-library-name-phase): New procedures. (gobject-introspection)[arguments]<#:phases>{rename-library}: New phase, correct the name of the python extension when cross-compiling. --- gnu/packages/glib.scm | 65 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 56 insertions(+), 9 deletions(-) (limited to 'gnu/packages/glib.scm') diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm index f2606a70af..fd57041768 100644 --- a/gnu/packages/glib.scm +++ b/gnu/packages/glib.scm @@ -393,6 +393,42 @@ functions for strings and common data structures.") (string-append doc html)) #t))))))))) +(define (python-extension-suffix python triplet) + "Determine the suffix for C extensions for PYTHON when compiled +for TRIPLET." + ;; python uses strings like 'x86_64-linux-gnu' instead of + ;; 'x86_64-unknown-linux-gnu'. + (define normalised-system + (string-replace-substring triplet "-unknown-" "-")) + (define major.minor (version-major+minor (package-version python))) + (define majorminor (string-delete #\. major.minor)) + (string-append + ;; If guix' python package used "--with-pydebug", a #\d would + ;; need to be added, likewise "--with-pymalloc" and "--with-wide-unicode" + ;; would require a #\m and #\u, see cpython's configure.ac. + ".cpython-" majorminor "-" normalised-system + (if (target-mingw? triplet) + ".dll" + ".so"))) + +(define (correct-library-name-phase python name) + "Return a G-exp evaluating to a phase renaming the python extension NAME +from what Meson thinks its name should be to what python expects its name +to be. NAME must not include the platform-specific suffix. This can only +be used when cross-compiling." + #~(lambda _ + (define name #$name) + (define native-suffix + #$(python-extension-suffix python + (nix-system->gnu-triplet (%current-system)))) + (define target-suffix + #$(python-extension-suffix python (%current-target-system))) + (define native-name + (string-append name native-suffix)) + (define target-name + (string-append name target-suffix)) + (rename-file native-name target-name))) + (define gobject-introspection (package (name "gobject-introspection") @@ -421,21 +457,32 @@ functions for strings and common data structures.") "-Dbuild_introspection_data=false")) '()) #:phases + ,#~ (modify-phases %standard-phases - ,@(if (%current-target-system) - ;; 'typelibs' is undefined. - `((add-after 'unpack 'set-typelibs - (lambda _ - (substitute* "meson.build" - (("\\bsources: typelibs\\b") - "sources: []"))))) - '()) + #$@(if (%current-target-system) + ;; 'typelibs' is undefined. + `((add-after 'unpack 'set-typelibs + (lambda _ + (substitute* "meson.build" + (("\\bsources: typelibs\\b") + "sources: []"))))) + '()) (add-after 'unpack 'do-not-use-/usr/bin/env (lambda _ (substitute* "tools/g-ir-tool-template.in" (("#!@PYTHON_CMD@") (string-append "#!" (which "python3")))) - #t))))) + #t)) + #$@(if (%current-target-system) + ;; Meson gives python extensions an incorrect name, see + ;; . + #~((add-after 'install 'rename-library + #$(correct-library-name-phase + (this-package-input "python") + #~(string-append #$output + "/lib/gobject-introspection/giscanner" + "/_giscanner")))) + #~())))) (native-inputs `(("glib" ,glib "bin") ("pkg-config" ,pkg-config) -- cgit v1.2.3