From patchwork Sun Nov 24 22:29:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nicolas Graves X-Patchwork-Id: 33892 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 0E69827BBE2; Sun, 24 Nov 2024 22:31:00 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 9292427BBE2 for ; Sun, 24 Nov 2024 22:30:58 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFL7I-0004MN-CW; Sun, 24 Nov 2024 17:30:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tFL7E-0004J1-Vk for guix-patches@gnu.org; Sun, 24 Nov 2024 17:30:05 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tFL7E-000752-M7 for guix-patches@gnu.org; Sun, 24 Nov 2024 17:30:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=Qd47XtGuviVWXqdicPrvADkg8DAr1zY9/whVoDm9vJw=; b=CNsvWYp5mqIUcIA9e/MIdn7e9pMdgC0Pv9vljqgru0Gf6rtNKxIJv+Q9zzuWspNEtDUSpMMpZocD9gi8gjP5knNYNCuKI7deFOl88Gy9B+3Dj0drxe1mPz4EBRZ6/wm2woYv6Lw0w0oSb44MbEgaW3pS9Zus/BYfQhCRREwt9wSeNCUlZyo3rZa8Ii3cCIbaJGRl9UbeYJs9PAGrlJHH0ZdzDMJzLW1KFk8fS6nfJWDxck9hn05mwpeFhYtOuSMm8lKOoOJ3nwEqn91Vikw2UIJnfkKLpqSvOlLVqGoFaxUttm+59mgAWmf7D4UqCKbuF9g/H1+4KbzgCXLMHplXuw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tFL7D-0007LQ-NQ for guix-patches@gnu.org; Sun, 24 Nov 2024 17:30:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74517] [PATCH 2/8] gnu: zbar: Split outputs. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 24 Nov 2024 22:30:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74517 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74517@debbugs.gnu.org Cc: Nicolas Graves Received: via spool by 74517-submit@debbugs.gnu.org id=B74517.173248739128117 (code B ref 74517); Sun, 24 Nov 2024 22:30:03 +0000 Received: (at 74517) by debbugs.gnu.org; 24 Nov 2024 22:29:51 +0000 Received: from localhost ([127.0.0.1]:36399 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFL70-0007JE-2r for submit@debbugs.gnu.org; Sun, 24 Nov 2024 17:29:51 -0500 Received: from 14.mo561.mail-out.ovh.net ([188.165.43.98]:35245) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFL6w-0007Il-GH for 74517@debbugs.gnu.org; Sun, 24 Nov 2024 17:29:48 -0500 Received: from director4.ghost.mail-out.ovh.net (unknown [10.108.9.73]) by mo561.mail-out.ovh.net (Postfix) with ESMTP id 4XxNn51zc5z1Lsw for <74517@debbugs.gnu.org>; Sun, 24 Nov 2024 22:29:45 +0000 (UTC) Received: from ghost-submission-5b5ff79f4f-sxfwn (unknown [10.110.101.166]) by director4.ghost.mail-out.ovh.net (Postfix) with ESMTPS id A5E801FD48; Sun, 24 Nov 2024 22:29:44 +0000 (UTC) Received: from ngraves.fr ([37.59.142.96]) by ghost-submission-5b5ff79f4f-sxfwn with ESMTPSA id gBWQDdioQ2cmbAIA5xp7tw (envelope-from ); Sun, 24 Nov 2024 22:29:44 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-96R0018b2fd109-ec26-4cc2-ad6a-484d9893ffce, B09C0D21553FA0D58279ECB09C04077B41FE1A05) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 90.92.117.144 Date: Sun, 24 Nov 2024 23:29:09 +0100 Message-ID: <20241124222934.524-2-ngraves@ngraves.fr> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241124222934.524-1-ngraves@ngraves.fr> References: <20241124222934.524-1-ngraves@ngraves.fr> MIME-Version: 1.0 X-Ovh-Tracer-Id: 12166474397004128994 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeefuddrgeefgdduiedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfgggtgfesthekredtredtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpedvleelgeeffeetleekueegvdfhtedvueffiefhkedtleejkeduveelgfdufeduleenucfkphepuddvjedrtddrtddruddpledtrdelvddruddujedrudeggedpfeejrdehledrudegvddrleeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepuddprhgtphhtthhopeejgeehudejseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehiedumgdpmhhouggvpehsmhhtphhouhht DKIM-Signature: a=rsa-sha256; bh=Qd47XtGuviVWXqdicPrvADkg8DAr1zY9/whVoDm9vJw=; c=relaxed/relaxed; d=ngraves.fr; h=From; s=ovhmo4487190-selector1; t=1732487385; v=1; b=Ql9FZm3e1rH/ALSDiByS/kRmDr7P9DcuRtyuxtYev9oAXcIxnYd8beivhjTs4+BhMJykvk/6 oYFcmsd26w1u4clj8PYmvqUw8NaiKMHlLWCwhcsnLa0OGrl9gre7QA92mn2tXxHo766sxvcJdBj JJ/0RV5/85Dk7vEglhnmkffSQtV4Mq2IyUFSRN+Ef0PWIk/TGDYVdPTBcB1AZqLmCSZyLEcxScu t+Gddx8GuFU4hLtb8bi3PlynXaKwVNSUpdBAWYRafQgPbLjT6Pwq/nrG4k+PwmHY4nQMLfIwS+z kcRjNIX/jYH1IrRaw5d3h20z99ayVxNunVICQtlcN8OEg== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches X-Patchwork-Original-From: Nicolas Graves via Guix-patches via From: Nicolas Graves Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/aidc.scm (zbar): Split outputs. [build-system]: Switch to glib-or-gtk-build-system. [arguments]<#:configure-flags>: Add --disable-static. <#:modules>: Use srfi-26 and gremlin's file-runpath. <#:phases>: Add phase 'split-outputs. [native-inputs]: Improve style. [inputs]: Improve style. Replace v4l-utils by v4l-utils-minimal. --- gnu/packages/aidc.scm | 94 +++++++++++++++++++++++++++++++++---------- 1 file changed, 73 insertions(+), 21 deletions(-) diff --git a/gnu/packages/aidc.scm b/gnu/packages/aidc.scm index bc9c47a480..281f87dc78 100644 --- a/gnu/packages/aidc.scm +++ b/gnu/packages/aidc.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2018, 2019, 2022 Tobias Geerinckx-Rice ;;; Copyright © 2019 Guillaume Le Vaillant ;;; Copyright © 2020 Leo Famulari +;;; Copyright © 2024 Nicolas Graves ;;; ;;; This file is part of GNU Guix. ;;; @@ -30,6 +31,7 @@ (define-module (gnu packages aidc) #:use-module (guix git-download) #:use-module (gnu packages autotools) #:use-module (gnu packages check) + #:use-module (gnu packages elf) #:use-module (gnu packages imagemagick) #:use-module (gnu packages gettext) #:use-module (gnu packages glib) @@ -43,7 +45,8 @@ (define-module (gnu packages aidc) #:use-module (gnu packages qt) #:use-module (gnu packages video) #:use-module (guix build-system cmake) - #:use-module (guix build-system gnu)) + #:use-module (guix build-system gnu) + #:use-module (guix build-system glib-or-gtk)) (define-public zxing-cpp ;; Use the master branch as it includes unreleased build system improvements @@ -184,32 +187,81 @@ (define-public zbar (commit version))) (file-name (git-file-name name version)) (sha256 - (base32 - "0rf3i7lx0fqzxsngird6l4d4dnl612nr32rm8sib699qqx67px8n")))) - (build-system gnu-build-system) + (base32 "0rf3i7lx0fqzxsngird6l4d4dnl612nr32rm8sib699qqx67px8n")))) + (build-system glib-or-gtk-build-system) + ;; XXX: qt output is broken: zbarcam-qt fails with segmentation fault, but + ;; this error happened before the output split. + (outputs '("out" "gtk" "qt")) (arguments - '(#:configure-flags (list "--with-gtk=auto" + (list + #:configure-flags '(list "--disable-static" + "--with-gtk=auto" "--with-python=auto" (string-append "--with-dbusconfdir=" (assoc-ref %outputs "out") - "/etc")))) + "/etc")) + #:modules `(((guix build gremlin) #:select (file-runpath)) + (srfi srfi-26) + ,@%glib-or-gtk-build-system-modules) + #:phases + #~(modify-phases %standard-phases + (add-after 'install 'split-outputs + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (gtk (assoc-ref outputs "gtk"))) + + ;; XXX: Using set-file-runpath leads to runpath-too-long-error + (define (prepend-to-runpath path file) + (invoke "patchelf" "--set-rpath" + (string-join (cons* path (file-runpath file)) ":") + file)) + + (define (move-output-file target file) + (let* ((source (string-append out file)) + (destination (string-append target file))) + (mkdir-p (dirname destination)) + (rename-file source destination) + (when (and (eq? (stat:type (lstat destination)) 'regular) + (elf-file? destination)) + (prepend-to-runpath + (string-append out "/lib:" target "/lib") + destination)))) + + (for-each + (lambda (kind) + (for-each + (cut move-output-file (assoc-ref outputs kind) <>) + (cons* + (string-append "/lib/pkgconfig/zbar-" kind ".pc") + (string-append "/bin/zbarcam-" kind) + (map (cut string-drop <> 1) + (with-directory-excursion out + (find-files + "./lib" + (string-append "lib.*" kind "\\.so.*"))))))) + '("gtk" "qt")) + + (for-each + (cut move-output-file gtk <>) + '("/share/gir-1.0" "/lib/girepository-1.0")))))))) (native-inputs - `(("autoconf" ,autoconf) - ("automake" ,automake) - ("gettext" ,gettext-minimal) - ("glib" ,glib "bin") - ("gobject-introspection" ,gobject-introspection) - ("libtool" ,libtool) - ("pkg-config" ,pkg-config) - ("python-wrapper" ,python-wrapper))) + (list autoconf + automake + gettext-minimal + `(,glib "bin") + gobject-introspection + libtool + patchelf + pkg-config + python-wrapper)) (inputs - `(("dbus" ,dbus) - ("imagemagick" ,imagemagick) - ("libjpeg" ,libjpeg-turbo) - ("perl" ,perl) - ("python" ,python) - ("qtx11extras" ,qtx11extras) - ("v4l-utils" ,v4l-utils))) + (list dbus + imagemagick + libjpeg-turbo + perl + python + qtx11extras + v4l-utils-minimal)) (propagated-inputs ;; These are in 'requires' field of .pc files. (list glib gtk+ qtbase-5))