From 2d4f7bb647e120cef5a9cf2855d00e6f92f3eb4f Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer <maxim.cournoyer@gmail.com> Date: Mon, 1 Aug 2022 23:59:49 -0400 Subject: [PATCH] Makefile: Fix Guix-generated debian bundles (deb-packs). * Makefile (SUPPORTED_GNU_ARCHS): Remove i686; qtbase 6 doesn't build for it. (output): Delete the store output after copying the archive, to avoid accumulating too much cruft under /gnu/store. * guix/guix-pack-manifest.scm: Adjust comment. Rename "libring" to "libjami". Delete libringclient related variables. Rename jami-qt to jami. (jami-with-certs): Express more concisely via G-Expressions and search-input-file or search-input-directory. Change-Id: I37f1482ed79599536fb42818ef32f4861a32c1da --- Makefile | 5 +-- guix/guix-pack-manifest.scm | 70 +++++++++++++------------------------ 2 files changed, 27 insertions(+), 48 deletions(-) diff --git a/Makefile b/Makefile index bdfdd2c9..b26e0a1c 100644 --- a/Makefile +++ b/Makefile @@ -234,7 +234,7 @@ $(foreach target,$(DISTRIBUTIONS),\ # # Guix-generated Debian packages (deb packs) targets. # -SUPPORTED_GNU_ARCHS = x86_64 i686 +SUPPORTED_GNU_ARCHS = x86_64 DEB_PACK_TARGETS = define guix-pack-command @@ -256,7 +256,8 @@ deb-pack-$(subst _,-,$(1)): $$(deb-file-name) $$(deb-file-name): has-guix-p $(RELEASE_TARBALL_FILENAME) output=$$$$($(guix-pack-command) --system=$(1)-linux $$(GUIX_PACK_ARGS)) && \ mkdir -p "$$$$(dirname "$$@")" && \ - cp --reflink=auto "$$$$output" "$$@" + cp --reflink=auto "$$$$output" "$$@" && \ + guix gc --delete "$$$$output" chmod +w "$$@" endef diff --git a/guix/guix-pack-manifest.scm b/guix/guix-pack-manifest.scm index ec3e6a23..c3278465 100644 --- a/guix/guix-pack-manifest.scm +++ b/guix/guix-pack-manifest.scm @@ -22,6 +22,7 @@ (gnu packages jami) (gnu packages python) (guix base32) + (guix gexp) (guix packages) (guix transformations) (guix store) @@ -30,9 +31,8 @@ ;;; XXX: Below is a rather strenuous way to specify something that ;;; would have been nicer if it could have been specified via: ;;; -;;; --with-source=libring=$(RELEASE_TARBALL_FILENAME) \ -;;; --with-source=libringclient=$(RELEASE_TARBALL_FILENAME) \ -;;; --with-source=jami-qt=$(RELEASE_TARBALL_FILENAME) in the Makefile. +;;; --with-source=libjami=$(RELEASE_TARBALL_FILENAME) \ +;;; --with-source=jami=$(RELEASE_TARBALL_FILENAME) in the Makefile. ;;; ;;; The above doesn't currently rewrite the dependency graph ;;; recursively, hence why it is not sufficient. @@ -68,53 +68,31 @@ `((with-source . ,(format #f "~a@~a=~a" name %release-version %release-file-name))))) -(define libring/latest ((with-latest-sources "libring") libring)) +(define libjami/latest ((with-latest-sources "libjami") libjami)) -(define with-libring/latest - (package-input-rewriting `((,libring . ,libring/latest)))) - -(define libringclient/latest ((with-latest-sources "libringclient") - (with-libring/latest libringclient))) - -(define libringclient/latest+libwrap - (package/inherit libringclient/latest - (arguments - (substitute-keyword-arguments (package-arguments libringclient/latest) - ((#:configure-flags flags ''()) - `(cons "-DENABLE_LIBWRAP=true" - (delete "-DENABLE_LIBWRAP=false" ,flags))))))) - -(define with-libringclient/latest+libwrap - (package-input-rewriting - `((,libringclient . ,libringclient/latest+libwrap)))) +(define with-libjami/latest + (package-input-rewriting `((,libjami . ,libjami/latest)))) ;;; Bundling the TLS certificates with Jami enables a fully ;;; functional, configuration-free experience, useful in the context ;;; of Guix packs. -(define jami-qt-with-certs - (package/inherit jami-qt - (inputs (cons `("nss-certs" ,nss-certs) - (package-inputs jami-qt))) - (native-inputs (cons `("python" ,python) - (package-native-inputs jami-qt))) +(define jami-with-certs + (package/inherit jami + (inputs (modify-inputs (package-inputs jami) + (append nss-certs))) (arguments - (substitute-keyword-arguments (package-arguments jami-qt) + (substitute-keyword-arguments (package-arguments jami) ((#:phases phases '%standard-phases) - `(modify-phases ,phases - (add-after 'qt-wrap 'wrap-ssl-cert-dir - (lambda* (#:key inputs outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (wrapper (string-append out "/bin/jami-qt")) - (nss-certs (assoc-ref inputs "nss-certs"))) - (substitute* wrapper - (("^exec.*" exec-line) - (string-append "export SSL_CERT_DIR=" - nss-certs - "/etc/ssl/certs\n" - exec-line)))))))))))) - -(define jami-qt-with-certs/latest - ((with-latest-sources "jami-qt") - (with-libringclient/latest+libwrap jami-qt-with-certs))) - -(packages->manifest (list jami-qt-with-certs/latest)) + #~(modify-phases #$phases + (add-after 'qt-wrap 'wrap-ssl-cert-dir + (lambda* (#:key inputs outputs #:allow-other-keys) + (substitute* (search-input-file outputs "bin/jami-qt") + (("^exec.*" exec-line) + (format #f "export SSL_CERT_DIR=~a~%" + (search-input-directory inputs "etc/ssl/certs") + exec-line))))))))))) + +(define jami-with-certs/latest + ((with-latest-sources "jami") jami-with-certs)) + +(packages->manifest (list jami-with-certs/latest)) -- GitLab