From patchwork Thu Feb 13 02:55:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "pelzflorian (Florian Pelz)" X-Patchwork-Id: 38527 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 E729027BBEA; Thu, 13 Feb 2025 02:57:15 +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=-8.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 510F127BBE2 for ; Thu, 13 Feb 2025 02:57:15 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tiPPW-00034c-EE; Wed, 12 Feb 2025 21:57:06 -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 1tiPPU-000348-63 for guix-patches@gnu.org; Wed, 12 Feb 2025 21:57: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 1tiPPS-00025s-L7 for guix-patches@gnu.org; Wed, 12 Feb 2025 21:57: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:References:In-Reply-To:Date:From:To:Subject; bh=Fbq1SFlqn1haCKJBAcpG3vggxHRLZIkxIS3Izcve1lU=; b=LcAVTXZr55tBkIOzuGjxd2R7iIsTUJTKtjhUToeJUO/Jp9KhYrGFCrUg87dRh1xG0lLpyxLU3Ml4ef7pMJ7durc5dCiUdG0DVbXXn15F8nmho7rECZvt0DzcvEdr3V2jia5RW0JuV9fu1G6Vq+7e/zVdbnRLbJkvOVqpRimN02+Fmt1ZefDhj2C9E1qo/9iBU5VoyFIk0BYXLx/oxPUw0ULv/cKEugtWEYo/VG39j44flUP2nyZ8Ioi2tv5Eh34r1U7L1/qYGhFfi1zMpDkejzPPh+gwmXtpDl0owM8mh+Yert898d8H5qnvFTcAMp/ihNo+pNPStwAhbh/2F/H80A==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tiPPS-0007Vq-F3 for guix-patches@gnu.org; Wed, 12 Feb 2025 21:57:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#76246] [PATCH 2/2] UNFINISHED gnu: Add G-Golf's GTK-4 examples. Resent-From: Florian Pelz Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 13 Feb 2025 02:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 76246 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 76246@debbugs.gnu.org Cc: "pelzflorian \(Florian Pelz\)" Received: via spool by 76246-submit@debbugs.gnu.org id=B76246.173941536928786 (code B ref 76246); Thu, 13 Feb 2025 02:57:02 +0000 Received: (at 76246) by debbugs.gnu.org; 13 Feb 2025 02:56:09 +0000 Received: from localhost ([127.0.0.1]:39236 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tiPOb-0007UB-7t for submit@debbugs.gnu.org; Wed, 12 Feb 2025 21:56:09 -0500 Received: from relay.yourmailgateway.de ([188.68.63.162]:48231) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tiPOY-0007To-H2 for 76246@debbugs.gnu.org; Wed, 12 Feb 2025 21:56:07 -0500 Received: from mors-relay-8201.netcup.net (localhost [127.0.0.1]) by mors-relay-8201.netcup.net (Postfix) with ESMTPS id 4YtfvR4CDrz41FZ for <76246@debbugs.gnu.org>; Thu, 13 Feb 2025 03:56:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=pelzflorian.de; s=key2; t=1739415363; bh=f/sPQRP1Yy60d1wKkmth7nwYAI8cGewBpbUMOQYousk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZkelmBPBnt96ct4WMVdEanXoiLsybVhueZyrico6oD/iwI3RnKIa1IaPqk/Ua65Hn 3m5AFhlR78+kZ/PaMgRz9EC1kWW8ZKZpSEdU+CZb2fgkFVVa7jWV4zwEpY/6XiIPxt VmfeNLQg0Gozghpe3Nt1tCoCdC/qyu55KB0rJRioQ8ZSOyzRWVSXGTu0kf+NkS3IEu xg/TDCw3YYXzTnKmYuGlj0hIFdV6KzoGFkdxYkUagTvDnjOeUzTlNum/qf4zXIHe/r VyFEncy6IZrervU99jEdLuoYtslSS57sSJznkv+PDMc+uhz/gES+Uv8Gc4C0KpHDtg LRpiZLrU317SA== Received: from policy01-mors.netcup.net (unknown [46.38.225.35]) by mors-relay-8201.netcup.net (Postfix) with ESMTPS id 4YtfvR3VfMz41FN for <76246@debbugs.gnu.org>; Thu, 13 Feb 2025 03:56:03 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at policy01-mors.netcup.net Received: from mxe217.netcup.net (unknown [10.243.12.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by policy01-mors.netcup.net (Postfix) with ESMTPS id 4YtfvQ6ljnz8tX7 for <76246@debbugs.gnu.org>; Thu, 13 Feb 2025 03:56:02 +0100 (CET) Received: from florianhp.fritz.box (ipb21a5dbf.dynamic.kabel-deutschland.de [178.26.93.191]) by mxe217.netcup.net (Postfix) with ESMTPSA id BC4E384497; Thu, 13 Feb 2025 03:55:56 +0100 (CET) From: Florian Pelz Date: Thu, 13 Feb 2025 03:55:13 +0100 Message-ID: <3e44e34b7a32f6c1adad22ab36c303e93226f320.1739413638.git.pelzflorian@pelzflorian.de> X-Mailer: git-send-email 2.48.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: BC4E384497 X-Rspamd-Server: rspamd-worker-8404 X-NC-CID: IM7YA0ygdgAB2QGxdtQdpubiI+z2/zOO2IoXt026ulzJdOjjHNNzACbq 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: "pelzflorian (Florian Pelz)" * gnu/packages/guile-xyz.scm (g-golf-gtk-4-examples): New variable. Change-Id: I19b182eb71095ca2deacdb4011c8f50dfcfc8476 --- gnu/packages/guile-xyz.scm | 73 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm index 92d5d90194..520d1b9f87 100644 --- a/gnu/packages/guile-xyz.scm +++ b/gnu/packages/guile-xyz.scm @@ -53,6 +53,7 @@ ;;; Copyright © 2024 Alec Barreto ;;; Copyright © 2024 Josep Bigorra ;;; Copyright © 2024 Ashish SHUKLA +;;; Copyright © 2025 Florian Pelz ;;; ;;; This file is part of GNU Guix. ;;; @@ -2618,6 +2619,78 @@ (define-public guile2.2-g-golf (replace "guile" guile-2.2) (replace "guile-lib" guile2.2-lib))))) +(define-public g-golf-gtk-4-examples + (package + (inherit guile-g-golf) + (name "g-golf-gtk-4-examples") + (arguments + (list + #:modules `(((guix build guile-build-system) + #:select + (target-guile-effective-version)) + ,@%default-gnu-modules) + #:tests? #f ;there are no tests for examples + ;; XXX: Maybe Guix should ship a reftest on its own? + #:phases + (with-imported-modules `((guix build guile-build-system) + ,@%default-gnu-imported-modules) + #~(modify-phases %standard-phases + (add-after 'unpack 'prepare-examples + (lambda _ + (chdir "examples/gtk-4") + ;; Re-use the existing Makefile for its wildcard syntax. + (rename-file "Makefile.am" "Makefile") + ;; Add a rule to install the examples. This also + ;; installs UI, CSS and Scheme files to /bin, but + ;; better keep how G-Golf packages them. + (let ((port (open-file "Makefile" "al"))) + (format port " +prefix = ~a +bindir = $(prefix)/bin +.PHONY: install +install: + mkdir -p $(bindir) + for f in $(EXTRA_DIST); do \\ + install $$f $(bindir); \\ + done +" #$output) + (close-port port)))) + (delete 'configure) + (add-after 'install 'wrap-binaries + (lambda* (#:key inputs #:allow-other-keys) + (let* ((version (target-guile-effective-version)) + (g-golf (assoc-ref inputs "guile-g-golf")) + (scm (string-append "/share/guile/site/" version)) + (go (string-append "/lib/guile/" + version "/site-ccache")) + (binaries + (find-files "." (lambda (file stat) ;only executables + (= (stat:perms stat) #o755))))) + (map (lambda (binary) + ;; The `current-filename' calls in examples are broken. + (system* "sed" "-i" "s/(add-to-load-path.*//g" binary) + ;;TODO DOES NOT WORK (substitute* binary + ;; (("add-to-load-path.*") + ;; "")) DOES NOT WORK NEITHER + (wrap-program (string-append #$output "/bin/" binary) + `("GUILE_LOAD_PATH" prefix + (,(string-append g-golf scm) + ));,(string-append #$output "/bin"))) ;not nice, + ; ;but better than `add-to-load-path' + `("GUILE_LOAD_COMPILED_PATH" prefix + (,(string-append g-golf go))) + `("GI_TYPELIB_PATH" prefix + (,(getenv "GI_TYPELIB_PATH"))))) + binaries)))))))) + (inputs + (list bash-minimal gtk guile-3.0 guile-cairo-next guile-g-golf)) + (native-inputs (list)) + (propagated-inputs (list)) + (synopsis "Example GTK apps written in Guile with G-Golf") + (description + "Example applications to show what can be done in G-Golf and how to wrap +the applications in a Guix package."))) + (define-public g-wrap (package (name "g-wrap")