From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 4ADKLK7pQ2eFRwEAe85BDQ:P1 (envelope-from ) for ; Mon, 25 Nov 2024 03:06:22 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 4ADKLK7pQ2eFRwEAe85BDQ (envelope-from ) for ; Mon, 25 Nov 2024 04:06:22 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=H9tdiVMo; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=AXukCCT7; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1732503982; a=rsa-sha256; cv=none; b=GtNedPut3N4qSTmfQiVVLvMevMESLpcZqzVe+uHsBogVHvjCRAEZKfsdao6KN4qaL1oaTf RQE4mtvVj7+iHyhAmgakCloCpb9twfsLiSOhUYWNfA0Y7tkIqxehMcelC0HgqEm1+ECIDD CyrHLMzHRWEwIZbcf5lllREPC0EPQ5E13mBmK409urthCIBcaFblDZjz4J+BSFuEFTPVsw 2ydXfrDj0YKBUpKrfFH5Gb9KQFC0S0MhA6k/ZfCRFCCLygN++qonaVV+ChX3i9HlBhzkvB ASuAx+2S0aFx+DkUlC/xyHcabooliVOf4epiJCiB/sLH3nxt1vteiIXvNA9M0Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=H9tdiVMo; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=AXukCCT7; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1732503982; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=lCQkccYpVxUzY5s9jnF5w3qpzEI22q0bk0YO290RjtE=; b=bxnBm2zQULlWhGxL25H7AUAUIa16tYn4xeKrr98XwOu8lSTk6qkBqFfUo1qR5toA9szE7h zZMaGz4Imt0XCZFRyHtAWy2nE5euLkNzwldWSaVns1b4bga9/BIx0EY7cnugHWah/XiiPK qOpPiF/2hLoVCxjlfukXYBOVY8nGVsJpCsgSkamqttu/s3RJQ3TEfV7VNRgyneAJbkUIfm nXqZgkq1Yv0OXJedX61NVwFSbU4u68RpfPTx7i3H6t5+fSl5EjGMhiJ95iZGOKdslpYGfa V2GEiWMB60RjTD6I4M+dKIsiJpQfQzypu7s2YzrK2XDr7hhr+fifTr4SIcQaLA== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id AAD217889F for ; Mon, 25 Nov 2024 04:06:21 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFPQN-000557-1Y; Sun, 24 Nov 2024 22:06:07 -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 1tFPQK-00054k-0X for guix-patches@gnu.org; Sun, 24 Nov 2024 22:06:04 -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 1tFPQJ-0003pO-DO for guix-patches@gnu.org; Sun, 24 Nov 2024 22:06:03 -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:Date:References:In-Reply-To:From:To:Subject; bh=lCQkccYpVxUzY5s9jnF5w3qpzEI22q0bk0YO290RjtE=; b=H9tdiVMoA5TLRqK7IfNJDIKtb+UQm4vQWlOyLa9OYRGPiWT3Mi0+5O0YW5wTDnw67VZGwKcIsJsvhUiqn+8B30vdAg99GdmhaZZ2jRsU5dx4hXGiG1xdRx29gvdTjeaiy946KB/faM8lWpU/jfntRX4vlnLptDN5lIEdFZ2a/GVXSK2sLPGCfMElKhXs1VTXRrQ5tvZ52ZVov6bXq9fLYBK38ddKl4fUlt6WbTdSIwhzJjyAxH4pP+XMrRNzUdpPf3RtJkx/Z3XdHZKPoOfFFjyQt0UoO3FyGrFcOEBImlPSjTb4DzhNRYdeTTnCekI56PyAnQDPrOGtixH0Xh+oNQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tFPQI-0003Wm-7b for guix-patches@gnu.org; Sun, 24 Nov 2024 22:06:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74517] [PATCH 2/8] gnu: zbar: Split outputs. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 25 Nov 2024 03:06:02 +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: Nicolas Graves Cc: 74517@debbugs.gnu.org Received: via spool by 74517-submit@debbugs.gnu.org id=B74517.173250395613548 (code B ref 74517); Mon, 25 Nov 2024 03:06:02 +0000 Received: (at 74517) by debbugs.gnu.org; 25 Nov 2024 03:05:56 +0000 Received: from localhost ([127.0.0.1]:36915 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFPQB-0003WR-Ru for submit@debbugs.gnu.org; Sun, 24 Nov 2024 22:05:56 -0500 Received: from mail-pf1-f179.google.com ([209.85.210.179]:61458) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFPQA-0003WD-1F for 74517@debbugs.gnu.org; Sun, 24 Nov 2024 22:05:55 -0500 Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-724f41d550cso727275b3a.2 for <74517@debbugs.gnu.org>; Sun, 24 Nov 2024 19:05:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732503888; x=1733108688; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=lCQkccYpVxUzY5s9jnF5w3qpzEI22q0bk0YO290RjtE=; b=AXukCCT7BxR3zHtqr36UBcTWTY2dGLg6bc42KQP7w68WZrqX1X4gYj0g09y1U7GJ8j S9dAGyHFHTQ7SRdDrCXihgKT72dzP1cyo0d0jFbv4rt1ENf0dKBxfbOg1eSM2bTw7bIR MAWKdvbjUJBAmiFVh89wkQe3J+U7tElRU004UhgIHLvhKMtpVFR5NKAVvbVR2iQ+QG+g /TcGlBl11nO0ebo24aRAHzzam/YfK78sPwoVOtnkAzgHatm4VSagkyW9V13LyYL5AjZo uGGp0rAhoFD5VK7QL8VBV7czTFk3MMubuh2xrC3xmXphjOxNbmK7P3VsX9Hw97DpZOHh Bwww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732503888; x=1733108688; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=lCQkccYpVxUzY5s9jnF5w3qpzEI22q0bk0YO290RjtE=; b=f/kq9AKcIbOr3C3sJ0B9cTLWnPKy6CB2zl9itsdGnEKbM03BSeSWVeNYYOQjAQvemZ At9wAyalN+O3ipucWBdGAiDqqxLlEgVEFHxwH40kj0+dLheaxrUlz1i8FmWJ16tNFmlA nWjG7lTI8CfPzqUcTFlfIVlls6hB2l2H7YFYQbsTVseiGpbZCd1WcomtyNSDMDA0eDGk ZOckh6hE9HTp5g+XWMl61TYkgo5HDmv0/NK488EUNxIN08buXTVMmChMV7+82IcL240r wkQCucGbVWXjws1MbRQVbV9UuzZjgaygEpXZ2+piXHOdTuTxJf97/ps2JwDP7NgwC5It RVBQ== X-Gm-Message-State: AOJu0YxNnDYcr5btQOi1Mq7nj9BIh9YcHbivzxOyZ8dcD3g0jCuj4abp JHKouDDlwARyOZoMXxLuxNpPGMtOYypus9u0JT2vvIZDt9FiDSGJat7Q+L+D X-Gm-Gg: ASbGnctFkGpkz8Q0WVL0GNKKkw+Vj7yO3Y8VwY0st8YXsmqDUKEeTbdLhEgBGWc4MXD jSYOyMmf4EviJpvVfkwrkLUfNYyDF0hu1xzVDWoZR40jBNRkCkrjbQr9QLLLJpNciaKF4vnSaJQ hueoWXEtGE0Bc/uU+54WNp76UyXal37rwhntB+kQnsEUP7cAYpZaTE4w30Q5s55/HCIwRIJCifc Cf7Hk7syisC5BWmd49rK0RVoBo4dbI0y+S8cyBtiukX34s= X-Google-Smtp-Source: AGHT+IHVbTI1aP8a+U9N4vitL2mVRHvtPcPXWtc2tLTPTnQEnpGFkNijDF9tS/zYu1J1Aj9FpktYHg== X-Received: by 2002:a17:902:da8b:b0:20c:9e9b:9614 with SMTP id d9443c01a7336-2129f22b0e0mr179297505ad.15.1732503887505; Sun, 24 Nov 2024 19:04:47 -0800 (PST) Received: from terra ([2405:6586:be0:0:c8ff:1707:9b9:af89]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2129dc14e11sm52917025ad.206.2024.11.24.19.04.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Nov 2024 19:04:46 -0800 (PST) From: Maxim Cournoyer In-Reply-To: <20241124222934.524-2-ngraves@ngraves.fr> (Nicolas Graves's message of "Sun, 24 Nov 2024 23:29:09 +0100") References: <20241124222934.524-1-ngraves@ngraves.fr> <20241124222934.524-2-ngraves@ngraves.fr> Date: Mon, 25 Nov 2024 12:04:39 +0900 Message-ID: <87bjy4m2t4.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain 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: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: AAD217889F X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -8.49 X-Spam-Score: -8.49 X-TUID: 8dM5J4ezDrIr Hi, Nicolas Graves writes: > * 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(-) [...] > (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. As an alternative to packaging broken outputs, perhaps we could simply tell the build system to not build with Qt, or wholly remove it from the inputs? > + (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"))) This can be rewritten using the gexp variabls #$output and #$output: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")))))))) That is clever, perhaps too clever (in comparison to the simple brute force approach of using a distinct minimal package variant built without the extra inputs) :-). > (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)) Could be done in a separate commit; this entangles concern and makes it easier if in the future a revert needs to be made. -- Thanks, Maxim