GNU bug report logs - #73754
[PATCH games-team 0/5] Unbundle SameBoy from jg-bsnes.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Maxim Cournoyer <maxim.cournoyer@HIDDEN>; Keywords: patch; dated Fri, 11 Oct 2024 22:08:02 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 73754 <at> debbugs.gnu.org:


Received: (at 73754) by debbugs.gnu.org; 19 Oct 2024 14:04:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 19 10:04:29 2024
Received: from localhost ([127.0.0.1]:44199 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1t2A4C-00022o-Ib
	for submit <at> debbugs.gnu.org; Sat, 19 Oct 2024 10:04:28 -0400
Received: from mail-pl1-f174.google.com ([209.85.214.174]:59888)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maxim.cournoyer@HIDDEN>) id 1t2A48-00022b-1y
 for 73754 <at> debbugs.gnu.org; Sat, 19 Oct 2024 10:04:26 -0400
Received: by mail-pl1-f174.google.com with SMTP id
 d9443c01a7336-208cf673b8dso30735705ad.3
 for <73754 <at> debbugs.gnu.org>; Sat, 19 Oct 2024 07:04:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1729346579; x=1729951379; 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=L2LuA66VWOA9FtrJP93wpE48sv7ydsAARpwTQzZrT4Y=;
 b=V9/nt+TsutPpuCPL73Dullh6U4T4miah8UQTyC8BG5yS11UVWvArxDpeIZrCtG7Z+a
 2ZFvMca9DtbZghUw5wxHZ5hjUDskLV7rBAWkCYFZT8GigOKW0yjMqvkcPrOkNsBmfgTz
 LdYM99yj3yXDz9DSyVaxzMeqASaUxMyT4vBDYaXAua1GfApmIJxp9y8sRTQf5gKFvo6o
 sqSBSUyam7+c8QCAS0Aoqfkx7AJP29tDFodyhgnYfk+sFpxnp2Hzu9AL9AhGtiuCiqcC
 CZa1r+YUzux+8PywHWrK6/jnp3HnJ8D0PMQJA0mze8gUj9P/XJ0Pg+chBCzK+tVnIM8O
 qA8Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1729346579; x=1729951379;
 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=L2LuA66VWOA9FtrJP93wpE48sv7ydsAARpwTQzZrT4Y=;
 b=a9IN8TMU90tyX8E2jCyCMKWoCjXpHmTbp3lm0TBW33Gmg5+itdB4NjbQgdjQ7N5tjr
 YReObGHnnsgfapWn1l/yBXKzmdAI8ck6VDNeqI1J5fekhMDsxUYfXsEfdX6MFPvw81AC
 ErB+LjhOCpi2fGn+qtRj+TLo1hzLBBVQ4IpVCzfLhTSNEzrlYlgXjFwTDuo0jRKVucAx
 fKx73wFER6UyV2ATQDEj9x5uk4CcK3Z3T6cmez8wZPMlA1r5ckLXerTiQpGvE9TOk5qO
 piRDDl/PU7rZOyyZ+N8dOL5EJyJoQ/amZgJsYboVlwV279BkmSLm7rmZ22HGytU2C99X
 puLw==
X-Gm-Message-State: AOJu0YzSNiIFwMV940uFXSKmszkSAo2xgUB5dDHJv1DP3VL58x5Khs2k
 HsifikpcA3Gc/ul4wOeFuHExpi4ffzwIklDOp6w+wHpCXO69Z+/R
X-Google-Smtp-Source: AGHT+IHB0ePJOCBbreGSy3foF47lQIvcNAZRUX7DJ/Y8VnVlKVKbhRVoJUxeD4+zYa9DGO1xgTn9Pg==
X-Received: by 2002:a17:90a:17ef:b0:2e1:89aa:65b7 with SMTP id
 98e67ed59e1d1-2e56171dbc8mr6691972a91.9.1729346579361; 
 Sat, 19 Oct 2024 07:02:59 -0700 (PDT)
Received: from terra ([2405:6586:be0:0:c8ff:1707:9b9:af89])
 by smtp.gmail.com with ESMTPSA id
 98e67ed59e1d1-2e55da3d512sm4286445a91.41.2024.10.19.07.02.57
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 19 Oct 2024 07:02:58 -0700 (PDT)
From: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
To: 73754 <at> debbugs.gnu.org
Subject: Re: [bug#73754] [PATCH 4/5] gnu: sameboy: Install shared library.
In-Reply-To: <25b9dd5fed046089943709a16ba7aae93b7fd911.1728684335.git.maxim.cournoyer@HIDDEN>
 (Maxim Cournoyer's message of "Sat, 12 Oct 2024 13:28:13 +0900")
References: <cover.1728684335.git.maxim.cournoyer@HIDDEN>
 <25b9dd5fed046089943709a16ba7aae93b7fd911.1728684335.git.maxim.cournoyer@HIDDEN>
Date: Sat, 19 Oct 2024 23:02:55 +0900
Message-ID: <871q0cchrk.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 73754
Cc: =?utf-8?B?5a6L5paH5q2m?= <iyzsong@HIDDEN>,
 Liliana Marie Prikler <liliana.prikler@HIDDEN>,
 Adam Faiz <adam.faiz@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hey,

Maxim Cournoyer <maxim.cournoyer@HIDDEN> writes:

> * gnu/packages/patches/sameboy-shared-lib.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Register it.
> * gnu/packages/emulators.scm (sameboy) [source]: Apply it.
> [arguments] <make-flags>: Replace DATA_DIR with PREFIX.  Add LIBRARY=shared
> and FREEDESKTOP=1.
> <phases>: Delete install phase override.
> [native-inputs]: Add cppp and libtool.

This revision uses libtool directly in the makefile rules to generate
shared library.  While it works, it's been pointed to me there are
issues doing that, namely that libtool bakes its CC internally and thus
CC can't be changed later, and cross-compilation is probably broken as
well.

The usual solution to this is to use Autotools, but I'll see if the
libtool problems can't be fixed at its level first.  It's going to need
some time, so consider this series on hold from that effort.

-- 
Thanks,
Maxim




Information forwarded to guix-patches@HIDDEN:
bug#73754; Package guix-patches. Full text available.

Message received at 73754 <at> debbugs.gnu.org:


Received: (at 73754) by debbugs.gnu.org; 12 Oct 2024 04:30:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 12 00:30:09 2024
Received: from localhost ([127.0.0.1]:36008 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1szTlY-0000wu-A9
	for submit <at> debbugs.gnu.org; Sat, 12 Oct 2024 00:30:09 -0400
Received: from mail-pl1-f176.google.com ([209.85.214.176]:58861)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maxim.cournoyer@HIDDEN>) id 1szTlR-0000v4-Lw
 for 73754 <at> debbugs.gnu.org; Sat, 12 Oct 2024 00:30:03 -0400
Received: by mail-pl1-f176.google.com with SMTP id
 d9443c01a7336-20c9978a221so20776045ad.1
 for <73754 <at> debbugs.gnu.org>; Fri, 11 Oct 2024 21:29:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1728707322; x=1729312122; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=2mdPEIv9OLwUs+raaHAIvTPq0lvI6pxf/0BDy6H8Roc=;
 b=AO3LEOA51dwitLvU//PtujenJar0h5xVSoZLHHiqsojeqyKYXwqTmk3vI86MtTlim7
 Blw0teUuYHeYap9IZCuAqmWu8L9te+XkBmKFR95HemhCzQ8GkRpHxYtK4KgNT0fH4z/Q
 GcPxJF88fDtumLgNpfPzqDez0tWK1PE1CxZ9X1eh/k7OsZ5SI7+mBJckK69xPhEO5r4B
 3of6xJdUOPiPqgS0MSFC7RmIc5DvikzunRrpQtJFLK9KjQGbO1V159UOEZpGU39J5Opb
 9IR+tr3eK5T3DC/DcRhYEtzvz2hLOkcSejmc4m9rxvpk1IOaiLnZ6lO0WzUl4767xBa0
 tyrg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1728707322; x=1729312122;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=2mdPEIv9OLwUs+raaHAIvTPq0lvI6pxf/0BDy6H8Roc=;
 b=Fsqe3NGIEAE9Da6LNFUMQe0EIJz7fCwsvGM5gCmz1fzx7djTJ706fHm2n+cJzeQdyZ
 xIvUkG3u7Q0r6JJxNhURYuk9+EnQddlJbxjR6l07OmKaFrEtgIzk8z29BTpLVuLBGEVu
 Cfp+AgGDioIBQJo0R4Q3HGXqx4/v74ZOk6kEx54jUXwFfBp8DvT8jfIZl8BUvu1qNxm6
 lWB2SRP5DZgdzP1MCcFaZDsYzMa7qKLalceRJ0IgJ5sMYeO0IdI7yKcItoQ9GVyw+TLS
 mINMuO2lwy+0zXU7EFTALdABw6+drpS/XfvHxcBIcUbvEkikmkv938p2NQGaCAvi/sL4
 GxQA==
X-Gm-Message-State: AOJu0YzJK9SUVtzJCYyxswm/4A86or2jMK3/Mn1Vj0iKzwWqu/Izdd1G
 f40PBBnDYNC5PQcSWgA4PTqOmJGNs8ym4V8u9nQgAiCULFqXW5QwO0x/Bg==
X-Google-Smtp-Source: AGHT+IGoa91CeVADc1HokQPM0yK++JPi3uigPgV6jDOwBIXr7LNtmKwPgTf5YcmIdMlXvzJVUyWIHA==
X-Received: by 2002:a17:903:8cc:b0:20b:b0ab:4fc3 with SMTP id
 d9443c01a7336-20ca16e9a11mr81832185ad.49.1728707321843; 
 Fri, 11 Oct 2024 21:28:41 -0700 (PDT)
Received: from localhost.localdomain ([2405:6586:be0:0:c8ff:1707:9b9:af89])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-20c8c36e814sm30913145ad.307.2024.10.11.21.28.40
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 11 Oct 2024 21:28:41 -0700 (PDT)
From: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
To: 73754 <at> debbugs.gnu.org
Subject: [PATCH 5/5] gnu: jg-bsnes: Unbundle SameBoy.
Date: Sat, 12 Oct 2024 13:28:14 +0900
Message-ID: <cb93e8ce73ea21c6764d15e85744b0732bc11d87.1728684335.git.maxim.cournoyer@HIDDEN>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <cover.1728684335.git.maxim.cournoyer@HIDDEN>
References: <cover.1728684335.git.maxim.cournoyer@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Maxim Cournoyer <maxim.cournoyer@HIDDEN>, Adam Faiz <adam.faiz@HIDDEN>, Liliana Marie Prikler <liliana.prikler@HIDDEN>, 宋文武 <iyzsong@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 73754
Cc: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* gnu/packages/emulators.scm (jg-bsnes) [source]: Delete deps/gb in snippet.
<patches>: Apply unbundling patch.
[make-flags]: Add USE_VENDORED_SAMEBOY=0 flag.
[inputs]: Add sameboy.
* gnu/packages/patches/jg-bsnes-unbundle-sameboy.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.

Change-Id: I0ce850b366663d88d66becb9121b13c48d4091a3
---
 gnu/local.mk                                  |   1 +
 gnu/packages/emulators.scm                    |   9 +-
 .../patches/jg-bsnes-unbundle-sameboy.patch   | 101 ++++++++++++++++++
 3 files changed, 108 insertions(+), 3 deletions(-)
 create mode 100644 gnu/packages/patches/jg-bsnes-unbundle-sameboy.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 544cf36f04..1eb3c66f85 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1592,6 +1592,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/jfsutils-add-sysmacros.patch		\
   %D%/packages/patches/jfsutils-gcc-compat.patch		\
   %D%/packages/patches/jfsutils-include-systypes.patch		\
+  %D%/packages/patches/jg-bsnes-unbundle-sameboy.patch		\
   %D%/packages/patches/john-the-ripper-jumbo-with-gcc-11.patch	\
   %D%/packages/patches/json-c-0.13-CVE-2020-12762.patch		\
   %D%/packages/patches/json-c-0.12-CVE-2020-12762.patch		\
diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index 3df1b94506..3d4b833c11 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -3291,10 +3291,12 @@ (define-public jg-bsnes
               ;; - snes_spc (also modified by this project)
               (snippet '(begin
                           (use-modules (guix build utils))
+                          (delete-file-recursively "deps/gb")
                           (delete-file-recursively "deps/libsamplerate")))
               (sha256
                (base32
-                "0z1ka4si8vcb0j6ih087cni18vpgfd3qnaw24awycxz23xc0jkdv"))))
+                "0z1ka4si8vcb0j6ih087cni18vpgfd3qnaw24awycxz23xc0jkdv"))
+              (patches (search-patches "jg-bsnes-unbundle-sameboy.patch"))))
     (build-system gnu-build-system)
     (arguments
      (list #:tests? #f                  ;no test suite
@@ -3302,11 +3304,12 @@ (define-public jg-bsnes
            #~(list (string-append "AR=" #$(ar-for-target))
                    (string-append "CC=" #$(cc-for-target))
                    (string-append "CXX=" #$(cxx-for-target))
-                   (string-append "PREFIX=" #$output))
+                   (string-append "PREFIX=" #$output)
+                   (string-append "USE_EXTERNAL_SAMEBOY=1"))
            #:phases #~(modify-phases %standard-phases
                         (delete 'configure)))) ;no configure script
     (native-inputs (list jg-api pkg-config))
-    (inputs (list libsamplerate))
+    (inputs (list libsamplerate sameboy))
     (home-page "https://gitlab.com/jgemu/bsnes")
     (synopsis "Jolly Good Fork of bsnes")
     (description "@code{bsnes-jg} is a cycle accurate emulator for the Super
diff --git a/gnu/packages/patches/jg-bsnes-unbundle-sameboy.patch b/gnu/packages/patches/jg-bsnes-unbundle-sameboy.patch
new file mode 100644
index 0000000000..1047dd4819
--- /dev/null
+++ b/gnu/packages/patches/jg-bsnes-unbundle-sameboy.patch
@@ -0,0 +1,101 @@
+Upstream-status: https://gitlab.com/jgemu/bsnes/-/merge_requests/429
+
+diff --git a/Makefile b/Makefile
+index 7371ff4..a4a8457 100644
+--- a/Makefile
++++ b/Makefile
+@@ -37,6 +37,9 @@ MKDIRS := deps/byuuML \
+ 	src/expansion \
+ 	src/processor
+ 
++# Set to 1 to use a system-provided SameBoy shared library.
++USE_EXTERNAL_SAMEBOY := 0
++
+ # Global symbols
+ # TODO: Darwin export files expect mangled symbols for C++
+ SYMBOLS :=
+@@ -61,6 +64,9 @@ CPPFLAGS_GB := -DGB_INTERNAL -DGB_DISABLE_CHEATS -DGB_DISABLE_DEBUGGER \
+ 	-D_GNU_SOURCE -DGB_VERSION=\"0.16.6\"
+ 
+ INCLUDES += $(CFLAGS_SAMPLERATE) -I$(DEPDIR)
++ifeq ($(USE_EXTERNAL_SAMEBOY), 0)
++INCLUDES += -I$(DEPDIR)/gb
++endif
+ LIBS += $(LIBS_SAMPLERATE)
+ 
+ EXT := cpp
+@@ -81,7 +87,13 @@ WARNINGS_CO := $(WARNINGS_MIN) -Wmissing-prototypes
+ WARNINGS_ICD := $(WARNINGS_CXX)
+ WARNINGS_GB := -Wall -Wno-missing-braces -Wno-multichar -Wno-unused-result
+ 
+-CSRCS := deps/gb/apu.c \
++CSRCS := \
++	deps/libco/libco.c \
++	deps/snes_spc/spc_dsp.c
++
++ifeq ($(USE_EXTERNAL_SAMEBOY), 0)
++CSRCS += \
++	deps/gb/apu.c \
+ 	deps/gb/camera.c \
+ 	deps/gb/display.c \
+ 	deps/gb/gb.c \
+@@ -96,9 +108,16 @@ CSRCS := deps/gb/apu.c \
+ 	deps/gb/sgb.c \
+ 	deps/gb/sm83_cpu.c \
+ 	deps/gb/timing.c \
+-	deps/gb/workboy.c \
+-	deps/libco/libco.c \
+-	deps/snes_spc/spc_dsp.c
++	deps/gb/workboy.c
++else
++CFLAGS_SAMEBOY = $(shell $(PKG_CONFIG) --cflags sameboy || echo fail)
++LIBS_SAMEBOY = $(shell $(PKG_CONFIG) --libs sameboy || echo fail)
++ifeq ($(CFLAGS_SAMEBOY)$(LIBS_SAMEBOY),failfail)
++$(error "pkg-config failure; CFLAGS_SAMEBOY and LIBS_SAMEBOY missing")
++endif
++INCLUDES += $(CFLAGS_SAMEBOY)
++LIBS += $(LIBS_SAMEBOY)
++endif
+ 
+ CXXSRCS := deps/byuuML/byuuML.cpp \
+ 	src/audio.cpp \
+@@ -243,8 +262,11 @@ install-data: all
+ 
+ install-docs::
+ 	cp $(DEPDIR)/byuuML/LICENSE $(DESTDIR)$(DOCDIR)/LICENSE-byuuML
+-	cp $(DEPDIR)/gb/LICENSE $(DESTDIR)$(DOCDIR)/LICENSE-gb
+ 	cp $(DEPDIR)/libco/LICENSE $(DESTDIR)$(DOCDIR)/LICENSE-libco
+ 	cp $(DEPDIR)/snes_spc/LICENSE $(DESTDIR)$(DOCDIR)/LICENSE-spc
++ifeq ($(USE_EXTERNAL_SAMEBOY), 0)
++install-docs::
++	cp $(DEPDIR)/gb/LICENSE $(DESTDIR)$(DOCDIR)/LICENSE-gb
++endif
+ 
+ include $(SOURCEDIR)/mk/rules.mk
+diff --git a/README b/README
+index 3db6823..910c8d5 100644
+--- a/README
++++ b/README
+@@ -30,7 +30,8 @@ Options:
+   ENABLE_HTML - Set to a non-zero value to generate the html documentation.
+   ENABLE_STATIC - Set to a non-zero value to build a static archive.
+   ENABLE_STATIC_JG - Set to a non-zero value to build a static JG archive.
+-  USE_VENDORED_SAMPLERATE - Set non-zero to use vendored libsamplerate
++  USE_VENDORED_SAMPLERATE - Set non-zero to use vendored libsamplerate.
++  USE_EXTERNAL_SAMEBOY - Set non-zero to use system-provided sameboy.
+ 
+ Linux:
+   make
+diff --git a/src/coprocessor/icd.cpp b/src/coprocessor/icd.cpp
+index 2b0fb96..066b63e 100644
+--- a/src/coprocessor/icd.cpp
++++ b/src/coprocessor/icd.cpp
+@@ -28,7 +28,7 @@
+ #include "icd.hpp"
+ 
+ extern "C" {
+-  #include <gb/gb.h>
++  #include <gb.h>
+ }
+ 
+ //warning: the size of this object will be too large due to C++ size rules differing from C rules.
-- 
2.46.0





Information forwarded to maxim.cournoyer@HIDDEN, adam.faiz@HIDDEN, liliana.prikler@HIDDEN, iyzsong@HIDDEN, guix-patches@HIDDEN:
bug#73754; Package guix-patches. Full text available.

Message received at 73754 <at> debbugs.gnu.org:


Received: (at 73754) by debbugs.gnu.org; 12 Oct 2024 04:30:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 12 00:30:06 2024
Received: from localhost ([127.0.0.1]:35996 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1szTlS-0000vy-UN
	for submit <at> debbugs.gnu.org; Sat, 12 Oct 2024 00:30:06 -0400
Received: from mail-pl1-f172.google.com ([209.85.214.172]:59805)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maxim.cournoyer@HIDDEN>) id 1szTlP-0000uu-Hv
 for 73754 <at> debbugs.gnu.org; Sat, 12 Oct 2024 00:30:01 -0400
Received: by mail-pl1-f172.google.com with SMTP id
 d9443c01a7336-208cf673b8dso28897535ad.3
 for <73754 <at> debbugs.gnu.org>; Fri, 11 Oct 2024 21:29:45 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1728707319; x=1729312119; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=/9pypzNzbpwb3GNr2L8R0KDQFHN074U3IRr+vxSMyzo=;
 b=dPejxGo7m5FwCTDHxB+X5gyVvHJFKCRkDpFFH7Js37IOEVDQKyoUv9xA9ALEgf18ru
 MVh61TnU2JS91nvPNOziiOaLbX+HPh+X6J/pNc8lIAlhETC/Gfb/okl1nkeeIIkHTeYe
 Pu//qAD9ntAzw4tcz1JTnunE7dqZc94rLWt2s1HLXphvY9cCHzlML2RolEq3GP0zmxZI
 p5Ued/jcu37OTTAqU+cAin6rsJ+aMaNuj85enXSYrQz6akb/rpinbeKyl0NsQkH0RT1m
 U38m1lu2+593wY8ie4X45ktC1H3AuZ2365l7SMA5RkW8UlNgHckVLmS1aJhAHZfGg2vb
 1NoQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1728707319; x=1729312119;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=/9pypzNzbpwb3GNr2L8R0KDQFHN074U3IRr+vxSMyzo=;
 b=gbyBcqEatpdLzjLMrMatpw12ggqLqIiXbq1RiEwEqEPmGjqkSvafEUERCB+pXk+mg1
 vJRIeX8jW/qTS5c9W4PvP/44KyTIe8SxGez9LBaaWaYG1bsRAOdZx0/h0GD+uH7hZ3qx
 rDY74s0rJXC5kFf7CIJsYd513fihWn4KqHYGZnZdoLNGQeIalMdpRxHgSJRT+QCRnzXt
 Dm5Fk5w/by1wc6g/Bpxftf1wzIztHfn2Ily1ZhNw+6W/aZ0bRMDVBEpP6JpfTnR23Xo9
 bkqeOJakxJdOi5NBssCzJH6e+oenNz62EyKZRvpHJf3tY48s9qT4uOVcQ0T3h6HGqv9r
 dXHA==
X-Gm-Message-State: AOJu0YxIp4aYRg4B96XiZRzUG7TfNf5Q5gFWYyo63WJ8Pe9asGK/ahN6
 5m3pWCuxZtTLyqHMzc+nCHrnzcH5+Yd7eXyRLLaCcGqgJltNmUa7hCpQcQ==
X-Google-Smtp-Source: AGHT+IGRY7kUYE0FovoDX4XDoFaEB4Nnb/Ty44wwl7A8HPoujLMARigcsMb1J+bUhQvpjJWIcHcUTQ==
X-Received: by 2002:a17:902:f542:b0:20b:8bd0:7395 with SMTP id
 d9443c01a7336-20ca16c8c08mr57691335ad.46.1728707319045; 
 Fri, 11 Oct 2024 21:28:39 -0700 (PDT)
Received: from localhost.localdomain ([2405:6586:be0:0:c8ff:1707:9b9:af89])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-20c8c36e814sm30913145ad.307.2024.10.11.21.28.37
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 11 Oct 2024 21:28:38 -0700 (PDT)
From: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
To: 73754 <at> debbugs.gnu.org
Subject: [PATCH 4/5] gnu: sameboy: Install shared library.
Date: Sat, 12 Oct 2024 13:28:13 +0900
Message-ID: <25b9dd5fed046089943709a16ba7aae93b7fd911.1728684335.git.maxim.cournoyer@HIDDEN>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <cover.1728684335.git.maxim.cournoyer@HIDDEN>
References: <cover.1728684335.git.maxim.cournoyer@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Maxim Cournoyer <maxim.cournoyer@HIDDEN>, Adam Faiz <adam.faiz@HIDDEN>, Liliana Marie Prikler <liliana.prikler@HIDDEN>, 宋文武 <iyzsong@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 73754
Cc: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* gnu/packages/patches/sameboy-shared-lib.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/emulators.scm (sameboy) [source]: Apply it.
[arguments] <make-flags>: Replace DATA_DIR with PREFIX.  Add LIBRARY=shared
and FREEDESKTOP=1.
<phases>: Delete install phase override.
[native-inputs]: Add cppp and libtool.

Change-Id: Ieef8434ada5a4e7ba3d726efc9710a9c2c973040
---
 gnu/local.mk                                  |   1 +
 gnu/packages/emulators.scm                    |  23 +-
 gnu/packages/patches/sameboy-shared-lib.patch | 317 ++++++++++++++++++
 3 files changed, 328 insertions(+), 13 deletions(-)
 create mode 100644 gnu/packages/patches/sameboy-shared-lib.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index e08ecc744c..544cf36f04 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2130,6 +2130,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/s7-flint-3.patch                      	\
   %D%/packages/patches/sajson-for-gemmi-numbers-as-strings.patch	\
   %D%/packages/patches/sajson-build-with-gcc10.patch		\
+  %D%/packages/patches/sameboy-shared-lib.patch			\
   %D%/packages/patches/sbc-fix-build-non-x86.patch		\
   %D%/packages/patches/sbcl-aserve-add-HTML-5-elements.patch	\
   %D%/packages/patches/sbcl-aserve-fix-rfe12668.patch	\
diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index b7dff958b7..3df1b94506 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -60,6 +60,7 @@ (define-module (gnu packages emulators)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages boost)
+  #:use-module (gnu packages c)
   #:use-module (gnu packages cdrom)
   #:use-module (gnu packages check)
   #:use-module (gnu packages cmake)
@@ -811,27 +812,23 @@ (define-public sameboy
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "1lab1x156ghfcjcy31rv731wi2b5h56z35n02h4i5pj8wjcf2jr9"))))
+        (base32 "1lab1x156ghfcjcy31rv731wi2b5h56z35n02h4i5pj8wjcf2jr9"))
+       (patches (search-patches "sameboy-shared-lib.patch"))))
     (build-system gnu-build-system)
     (arguments
      (list
       #:tests? #f                       ; There are no tests
       #:make-flags #~(list #$(string-append "CC=" (cc-for-target))
-                           "NATIVE_CC=gcc" "CONF=release"
-                           (string-append "DATA_DIR=" #$output
-                                          "/share/sameboy/"))
+                           "FREEDESKTOP=1" ;for install target
+                           "LIBRARY=shared"
+                           "NATIVE_CC=gcc"
+                           "CONF=release"
+                           (string-append "PREFIX=" #$output))
       #:phases
       #~(modify-phases %standard-phases
-          (delete 'configure)
-          (replace 'install
-            (lambda _
-              (with-directory-excursion "build/bin/SDL"
-                (install-file "sameboy" (string-append #$output "/bin"))
-                (delete-file "sameboy")
-                (copy-recursively
-                 "." (string-append #$output "/share/sameboy/"))))))))
+          (delete 'configure))))
+    (native-inputs (list cppp libtool pkg-config rgbds))
     (inputs (list sdl2))
-    (native-inputs (list rgbds pkg-config))
     (home-page "https://sameboy.github.io/")
     (synopsis "Accurate Game Boy, Game Boy Color and Super Game Boy emulator")
     (description "SameBoy is a user friendly Game Boy, Game Boy Color
diff --git a/gnu/packages/patches/sameboy-shared-lib.patch b/gnu/packages/patches/sameboy-shared-lib.patch
new file mode 100644
index 0000000000..a18d4dec76
--- /dev/null
+++ b/gnu/packages/patches/sameboy-shared-lib.patch
@@ -0,0 +1,317 @@
+Upstream-status: https://github.com/LIJI32/SameBoy/pull/662
+
+diff --git a/Makefile b/Makefile
+index a1bce3e..cea556e 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,6 +1,14 @@
+ # Make hacks
+ .INTERMEDIATE:
+ 
++# Library versioning, following libtool's 'version-info' scheme (see:
++# info '(libtool) Libtool versioning' or
++# https://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html).
++LT_CURRENT := 0
++LT_REVISION := 0
++LT_AGE := 0
++LT_VERSION_INFO := $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
++
+ # Set target, configuration, version and destination folders
+ 
+ PLATFORM := $(shell uname -s)
+@@ -33,11 +41,47 @@ else
+ DEFAULT := sdl
+ endif
+ 
++ifneq ($(LIBRARY),)
++DEFAULT += lib
++endif
++
++# Select whether libtool should build/link for static vs shared
++# libraries, or both.
++ifneq ($(LIBRARY),)
++ifeq ($(LIBRARY), shared)
++LT_MODE_ARG := -shared
++else ifeq ($(LIBRARY), static)
++LT_MODE_ARG := -static
++else
++# Build both static and shared libraries.
++LT_MODE_ARG :=
++endif
++endif
++
+ NULL := /dev/null
+ ifeq ($(PLATFORM),windows32)
+ NULL := NUL
+ endif
+ 
++# Strip a given prefix from a string.
++# arg1: The prefix to strip.
++# arg2: The text containing the prefix.
++# Return $text with $prefix stripped, else nothing.
++define strip_prefix =
++$(let stripped,$(subst $(1),,$(2)),$\
++  $(shell test "$(1)$(stripped)" = "$(2)" && echo $(stripped)))
++endef
++
++# Simplify a path for use with pkg-config, by replacing $prefix with '${prefix}'
++# arg1: prefix, e.g. an installation prefix, such as /usr/local.
++# arg2: pkgdir, e.g. a path such as $datadir, $bindir, etc.
++# arg3: pkg-config variable name, e.g. 'prefix' or 'exec_prefix'.
++#       Defaults to 'prefix'.
++define simplify_pkgconf_dir =
++$(let stripped,$(call strip_prefix,$(1),$(2)),$\
++  $(if stripped,$${$(or $(3),prefix)}$(stripped),$(2)))
++endef
++
+ ifneq ($(shell which xdg-open 2> $(NULL))$(FREEDESKTOP),)
+ # Running on an FreeDesktop environment, configure for (optional) installation
+ DESTDIR ?= 
+@@ -46,6 +90,22 @@ DATA_DIR ?= $(PREFIX)/share/sameboy/
+ FREEDESKTOP ?= true
+ endif
+ 
++# Autoconf-style conventionally named variables.
++prefix ?= $(PREFIX)
++exec_prefix ?= $(prefix)
++includedir ?= $(prefix)/include
++bindir ?= $(exec_prefix)/bin
++libdir ?= $(exec_prefix)/lib
++datadir ?= $(prefix)/share
++
++# Prettified variants for use in the pkg-config file.
++override PKGCONF_EXEC_PREFIX = \
++	$(call simplify_pkgconf_dir,$(prefix),$(exec_prefix))
++override PKGCONF_INCLUDEDIR = \
++	$(call simplify_pkgconf_dir,$(prefix),$(includedir))
++override PKGCONF_LIBDIR = \
++	$(call simplify_pkgconf_dir,$(exec_prefix),$(libdir),exec_prefix)
++
+ default: $(DEFAULT)
+ 
+ ifeq ($(MAKECMDGOALS),)
+@@ -101,6 +161,9 @@ BIN := build/bin
+ OBJ := build/obj
+ INC := build/include/sameboy
+ LIBDIR := build/lib
++PKGCONF_DIR := $(LIBDIR)/pkgconfig
++LIBTOOL_LIBRARY := $(LIBDIR)/libsameboy.la
++PKGCONF_FILE := $(PKGCONF_DIR)/sameboy.pc
+ 
+ BOOTROMS_DIR ?= $(BIN)/BootROMs
+ 
+@@ -125,6 +188,26 @@ PKG_CONFIG := pkg-config
+ endif
+ endif
+ 
++# Libtool makes it easy to correctly build shared libraries with
++# version info on both MacOS and GNU/Linux; require it if building
++# libraries.
++ifneq ($(LIBRARY),)
++ifneq (, $(shell command -v libtool 2> $(NULL)))
++LIBTOOL := libtool
++LIBTOOL_CC := $(LIBTOOL) --tag=CC --mode=compile $(CC) -c
++LIBTOOL_LD := $(LIBTOOL) --tag=CC --mode=link $(CC) \
++	-version-info $(LT_VERSION_INFO) $(LT_MODE_ARG)
++else
++$(error "please install libtool")
++endif
++else
++# Not building libraries.
++LIBTOOL :=
++LIBTOOL_CC := $(CC)
++LIBTOOL_LD :=
++endif
++
++
+ ifeq ($(PLATFORM),windows32)
+ # To force use of the Unix version instead of the Windows version
+ MKDIR := $(shell which mkdir)
+@@ -276,11 +359,6 @@ LDFLAGS += -Wl,/NODEFAULTLIB:libcmt.lib
+ endif
+ endif
+ 
+-LIBFLAGS := -nostdlib -Wl,-r
+-ifneq ($(PLATFORM),Darwin)
+-LIBFLAGS += -no-pie
+-endif
+-
+ ifeq ($(CONF),debug)
+ CFLAGS += -g
+ else ifeq ($(CONF), release)
+@@ -336,11 +414,14 @@ tester: $(TESTER_TARGET) $(BIN)/tester/dmg_boot.bin $(BIN)/tester/cgb_boot.bin $
+ _ios: $(BIN)/SameBoy-iOS.app $(OBJ)/installer
+ ios-ipa: $(BIN)/SameBoy-iOS.ipa
+ ios-deb: $(BIN)/SameBoy-iOS.deb
++
++# Libraries.
+ ifeq ($(PLATFORM),windows32)
+ lib: lib-unsupported
+-else
+-lib: $(LIBDIR)/libsameboy.o $(LIBDIR)/libsameboy.a
++else ifneq ($(LIBRARY),)
++lib: $(LIBTOOL_LIBRARY) $(PKGCONF_FILE)
+ endif
++
+ all: sdl tester libretro lib
+ ifeq ($(PLATFORM),Darwin)
+ all: cocoa ios-ipa ios-deb
+@@ -361,6 +442,10 @@ CORE_SOURCES += $(shell ls Windows/*.c)
+ endif
+ 
+ CORE_OBJECTS := $(patsubst %,$(OBJ)/%.o,$(CORE_SOURCES))
++# Libtool PIC objects are created along the .o variants, when building
++# a shared library.
++CORE_LOBJECTS := $(patsubst %,$(OBJ)/%.lo,$(CORE_SOURCES))
++$(CORE_LOBJECTS): $(CORE_OBJECTS)
+ PUBLIC_HEADERS := $(patsubst Core/%,$(INC)/%,$(CORE_HEADERS))
+ COCOA_OBJECTS := $(patsubst %,$(OBJ)/%.o,$(COCOA_SOURCES))
+ IOS_OBJECTS := $(patsubst %,$(OBJ)/%.o,$(IOS_SOURCES))
+@@ -404,30 +489,30 @@ $(OBJ)/%.dep: %
+ 
+ $(OBJ)/Core/%.c.o: Core/%.c
+ 	-@$(MKDIR) -p $(dir $@)
+-	$(CC) $(CFLAGS) $(FAT_FLAGS) -DGB_INTERNAL -c $< -o $@
++	$(LIBTOOL_CC) $(CFLAGS) $(FAT_FLAGS) -DGB_INTERNAL -c $< -o $@
+ 
+ $(OBJ)/SDL/%.c.o: SDL/%.c
+ 	-@$(MKDIR) -p $(dir $@)
+-	$(CC) $(CFLAGS) $(FRONTEND_CFLAGS) $(FAT_FLAGS) $(SDL_CFLAGS) $(GL_CFLAGS) -c $< -o $@
++	$(LIBTOOL_CC) $(CFLAGS) $(FRONTEND_CFLAGS) $(FAT_FLAGS) $(SDL_CFLAGS) $(GL_CFLAGS) -c $< -o $@
+ 
+ $(OBJ)/OpenDialog/%.c.o: OpenDialog/%.c
+ 	-@$(MKDIR) -p $(dir $@)
+-	$(CC) $(CFLAGS) $(FRONTEND_CFLAGS) $(FAT_FLAGS) $(SDL_CFLAGS) $(GL_CFLAGS) -c $< -o $@
++	$(LIBTOOL_CC) $(CFLAGS) $(FRONTEND_CFLAGS) $(FAT_FLAGS) $(SDL_CFLAGS) $(GL_CFLAGS) -c $< -o $@
+ 
+ 
+ $(OBJ)/%.c.o: %.c
+ 	-@$(MKDIR) -p $(dir $@)
+-	$(CC) $(CFLAGS) $(FRONTEND_CFLAGS) $(FAT_FLAGS) -c $< -o $@
++	$(LIBTOOL_CC) $(CFLAGS) $(FRONTEND_CFLAGS) $(FAT_FLAGS) -c $< -o $@
+ 	
+ # HexFiend requires more flags
+ $(OBJ)/HexFiend/%.m.o: HexFiend/%.m
+ 	-@$(MKDIR) -p $(dir $@)
+-	$(CC) $(CFLAGS) $(FRONTEND_CFLAGS) $(FAT_FLAGS) $(OCFLAGS) -c $< -o $@ -fno-objc-arc -include HexFiend/HexFiend_2_Framework_Prefix.pch
++	$(LIBTOOL_CC) $(CFLAGS) $(FRONTEND_CFLAGS) $(FAT_FLAGS) $(OCFLAGS) -c $< -o $@ -fno-objc-arc -include HexFiend/HexFiend_2_Framework_Prefix.pch
+ 	
+ $(OBJ)/%.m.o: %.m
+ 	-@$(MKDIR) -p $(dir $@)
+-	$(CC) $(CFLAGS) $(FRONTEND_CFLAGS) $(FAT_FLAGS) $(OCFLAGS) -c $< -o $@
+-    
++	$(LIBTOOL_CC) $(CFLAGS) $(FRONTEND_CFLAGS) $(FAT_FLAGS) $(OCFLAGS) -c $< -o $@
++
+ # iOS Port
+ 
+ $(BIN)/SameBoy-iOS.app: $(BIN)/SameBoy-iOS.app/SameBoy \
+@@ -653,15 +738,28 @@ libretro:
+ # Does not install mimetype icons because FreeDesktop is cursed abomination with no right to exist.
+ # If you somehow find a reasonable way to make associate an icon with an extension in this dumpster
+ # fire of a desktop environment, open an issue or a pull request
++# Install for Linux, and other FreeDesktop platforms.
++install_headers = install -Dm 644 -t $(DESTDIR)$(includedir)/sameboy $(INC)/*
++install_pkgconf_file = install -Dm 644 -t $(DESTDIR)$(libdir)/pkgconfig $(PKGCONF_FILE)
++
+ ifneq ($(FREEDESKTOP),)
+ ICON_NAMES := apps/sameboy mimetypes/x-gameboy-rom mimetypes/x-gameboy-color-rom
+ ICON_SIZES := 16x16 32x32 64x64 128x128 256x256 512x512
+ ICONS := $(foreach name,$(ICON_NAMES), $(foreach size,$(ICON_SIZES),$(DESTDIR)$(PREFIX)/share/icons/hicolor/$(size)/$(name).png))
++ifneq ($(LIBRARY),)
++install: lib pkgconf
++endif
++
+ install: sdl $(DESTDIR)$(PREFIX)/share/mime/packages/sameboy.xml $(ICONS) FreeDesktop/sameboy.desktop
+ 	-@$(MKDIR) -p $(dir $(DESTDIR)$(PREFIX))
+ 	mkdir -p $(DESTDIR)$(DATA_DIR)/ $(DESTDIR)$(PREFIX)/bin/
+ 	cp -rf $(BIN)/SDL/* $(DESTDIR)$(DATA_DIR)/
+ 	mv $(DESTDIR)$(DATA_DIR)/sameboy $(DESTDIR)$(PREFIX)/bin/sameboy
++ifneq ($(LIBRARY),)
++	$(install_headers)
++	$(install_pkgconf_file)
++	$(LIBTOOL) --mode=install install -D $(LIBTOOL_LIBRARY) $(libdir)/libsameboy.la
++endif
+ ifeq ($(DESTDIR),)
+ 	-update-mime-database -n $(PREFIX)/share/mime
+ 	-xdg-desktop-menu install --novendor --mode system FreeDesktop/sameboy.desktop
+@@ -727,20 +825,23 @@ $(OBJ)/control.tar.gz: iOS/deb-postinst iOS/deb-prerm iOS/deb-control
+ $(OBJ)/debian-binary:
+ 	-@$(MKDIR) -p $(dir $@)
+ 	echo 2.0 > $@
+-    
+-$(LIBDIR)/libsameboy.o: $(CORE_OBJECTS)
++
++# Link library objects with libtool.
++$(LIBTOOL_LIBRARY): $(CORE_LOBJECTS)
+ 	-@$(MKDIR) -p $(dir $@)
+-	@# This is a somewhat simple hack to force Clang and GCC to build a native object file out of one or many LTO objects
+-	echo "static const char __attribute__((used)) x=0;"| $(CC) $(filter-out -flto,$(CFLAGS)) -c -x c - -o $(OBJ)/lto_hack.o
+-	@# And this is a somewhat complicated hack to invoke the correct LTO-enabled LD command in a mostly cross-platform nature
+-	$(CC) $(FAT_FLAGS) $(CFLAGS) $(LIBFLAGS) $^ $(OBJ)/lto_hack.o -o $@
+-	-@rm $(OBJ)/lto_hack.o
+-    
+-$(LIBDIR)/libsameboy.a: $(LIBDIR)/libsameboy.o
++	$(LIBTOOL_LD) -rpath $(libdir) $^ -o $@
++
++$(PKGCONF_FILE): sameboy.pc.in
+ 	-@$(MKDIR) -p $(dir $@)
+ 	-@rm -f $@
+-	ar -crs $@ $^
+-	
++	sed -e 's,@prefix@,$(prefix),' \
++	 -e 's/@version@/$(VERSION)/' \
++	 -e 's,@exec_prefix@,$(PKGCONF_EXEC_PREFIX),' \
++	 -e 's,@includedir@,$(PKGCONF_INCLUDEDIR),' \
++	 -e 's,@libdir@,$(PKGCONF_LIBDIR),' $< > $@
++
++pkgconf: $(PKGCONF_FILE)
++
+ $(INC)/%.h: Core/%.h
+ 	-@$(MKDIR) -p $(dir $@)
+ 	-@# CPPP doesn't like multibyte characters, so we replace the single quote character before processing so it doesn't complain
+@@ -754,4 +855,4 @@ lib-unsupported:
+ clean:
+ 	rm -rf build
+ 
+-.PHONY: libretro tester cocoa ios _ios ios-ipa ios-deb liblib-unsupported bootroms
++.PHONY: libretro tester cocoa ios _ios ios-ipa ios-deb lib lib-unsupported bootroms pkgconf
+diff --git a/README.md b/README.md
+index 9c5f8da..e23f2ca 100644
+--- a/README.md
++++ b/README.md
+@@ -53,12 +53,18 @@ On Windows, SameBoy also requires:
+ To compile, simply run `make`. The targets are:
+  * `cocoa` (Default for macOS)
+  * `sdl` (Default for everything else)
+- * `lib` (Creates libsameboy.o and libsameboy.a for statically linking SameBoy, as well as a headers directory with corresponding headers; currently not supported on Windows due to linker limitations)
++ * `lib` (Creates libsameboy.o, libsameboy.a and libsameboy.so for linking SameBoy, as well as a headers directory with corresponding headers; currently not supported on Windows due to linker limitations)
+  * `ios` (Plain iOS .app bundle), `ios-ipa` (iOS IPA archive for side-loading), `ios-deb` (iOS deb package for jailbroken devices)
+  * `libretro`
+  * `bootroms`
+  * `tester` 
+ 
++For convenience, when installing the static and shared libraries is
++desired, you can specify the LIBRARY=1 make variable to have the
++libraries built as part of the default target, as well as installed,
++along the headers. Alternatively, `LIBRARY=shared` will install just
++the shared library, while `LIBRARY=static` only the static one.
++
+ You may also specify `CONF=debug` (default), `CONF=release`, `CONF=native_release` or `CONF=fat_release`  to control optimization, symbols and multi-architectures. `native_release` is faster than `release`, but is optimized to the host's CPU and therefore is not portable. `fat_release` is exclusive to macOS and builds x86-64 and ARM64 fat binaries; this requires using a recent enough `clang` and macOS SDK using `xcode-select`, or setting them explicitly with `CC=` and `SYSROOT=`, respectively. All other configurations will build to your host architecture, except for the iOS targets. You may set `BOOTROMS_DIR=...` to a directory containing precompiled boot ROM files, otherwise the build system will compile and use SameBoy's own boot ROMs.
+ 
+ The SDL port will look for resource files with a path relative to executable and inside the directory specified by the `DATA_DIR` variable. If you are packaging SameBoy, you may wish to override this by setting the `DATA_DIR` variable during compilation to the target path of the directory containing all files (apart from the executable, that's not necessary) from the `build/bin/SDL` directory in the source tree. Make sure the variable ends with a `/` character. On FreeDesktop environments, `DATA_DIR` will default to `/usr/local/share/sameboy/`. `PREFIX` and `DESTDIR` follow their standard usage and default to an empty string an `/usr/local`, respectively
+diff --git a/sameboy.pc.in b/sameboy.pc.in
+new file mode 100644
+index 0000000..dc0ca0b
+--- /dev/null
++++ b/sameboy.pc.in
+@@ -0,0 +1,10 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++includedir=@includedir@
++libdir=@libdir@
++
++Name: sameboy
++Description: The SameBoy library
++Version: @version@
++Cflags: -I${includedir}/sameboy
++Libs: -L${libdir} -lsameboy
-- 
2.46.0





Information forwarded to maxim.cournoyer@HIDDEN, adam.faiz@HIDDEN, liliana.prikler@HIDDEN, iyzsong@HIDDEN, guix-patches@HIDDEN:
bug#73754; Package guix-patches. Full text available.

Message received at 73754 <at> debbugs.gnu.org:


Received: (at 73754) by debbugs.gnu.org; 12 Oct 2024 04:30:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 12 00:29:59 2024
Received: from localhost ([127.0.0.1]:35992 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1szTlP-0000vC-7m
	for submit <at> debbugs.gnu.org; Sat, 12 Oct 2024 00:29:59 -0400
Received: from mail-pl1-f172.google.com ([209.85.214.172]:43123)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maxim.cournoyer@HIDDEN>) id 1szTlM-0000ui-KA
 for 73754 <at> debbugs.gnu.org; Sat, 12 Oct 2024 00:29:58 -0400
Received: by mail-pl1-f172.google.com with SMTP id
 d9443c01a7336-20c8c50fdd9so14816075ad.0
 for <73754 <at> debbugs.gnu.org>; Fri, 11 Oct 2024 21:29:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1728707316; x=1729312116; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=3iKZ1EW4vNKTtUZclJD2j2ylfg3TOEuB4WR4C5fHFx4=;
 b=LXo8OZXGkdoeG1aq2FODbTweFduaztE/nuRTcIFDjK6/4++DS4w8H+uR7ps69sdSGg
 6c4IxAi2TVjwshaKHvJUmCebG7bMr0EcmzrhBCYeBMHEetZyXw88w4rSBUke8dzorFxr
 QNASou4NrnxJ0p8uYGGNTInznXvbKEI8Ix8Cz1lhGO+nyAxvJ6KXZpdoz/ncY3Edh9h9
 Bs2cW1VJsQbv1fuh9DQ4ZJlcn0szcm0rwtlxIOx4MCCHI9FVGuHcaVXD3uclBzQA8IKy
 lpdlmZBisetDrh5mx/5mvICBaVlOWAlAalX1f6h6mkZAWlufMk8CfNGTP2LuT6M9IWTJ
 LrwQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1728707316; x=1729312116;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=3iKZ1EW4vNKTtUZclJD2j2ylfg3TOEuB4WR4C5fHFx4=;
 b=UYgWYM5H+Iqycfp1GRG3/DTEUHzZM0KAXBAGePjhKOMOqTKRXvgthlWoMwjFpT/+66
 o9bC5Gjm09mz9u5CzEHwlyxkYcDruYTe5X8d84Bfbf5fGeOyAoxprwuPQUYMfTm0TSN8
 7dhsLkYGJIs8J2nCXyDQwWD7dt3pKKU3mJEpe9o7WhhSMiactzunWQClslsFInJ6wAoi
 uyGQfGiH/BWXzR3Q/E1b5dj21ULVSGRTVgoaE4JwxYlNKwsVeGS5LiGnEgm3qTPKE6o8
 wswb9LyOsoSMKyrvTmJ0PpA0NrK0N5T2hCoEfPHPyhuMArJS8gMMh2vP7XIdLQWKwD4h
 OfhA==
X-Gm-Message-State: AOJu0YzNeCnjGUq/Ogzw1rnEYXAA+58Vv21QGdyOTYc0G/l2G3lOL2jN
 5ztGWOWEMnGgVwCNRTyNx7XsucTQp8niydf0DDh4AP1hKkyFh98UDnTYdw==
X-Google-Smtp-Source: AGHT+IEJfkcoTOUbK1e1oAp86V+JZj/4b2/YZgeVhfo4UJJ+btU3ZNO+ANxSPS5ia8kz+76scuAHUg==
X-Received: by 2002:a17:903:41cc:b0:20b:a409:329 with SMTP id
 d9443c01a7336-20c80442c36mr147398155ad.5.1728707316159; 
 Fri, 11 Oct 2024 21:28:36 -0700 (PDT)
Received: from localhost.localdomain ([2405:6586:be0:0:c8ff:1707:9b9:af89])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-20c8c36e814sm30913145ad.307.2024.10.11.21.28.34
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 11 Oct 2024 21:28:35 -0700 (PDT)
From: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
To: 73754 <at> debbugs.gnu.org
Subject: [PATCH 3/5] gnu: Add cppp.
Date: Sat, 12 Oct 2024 13:28:12 +0900
Message-ID: <c01c5b711c3167992cd6f7fe4952d649a1b83396.1728684335.git.maxim.cournoyer@HIDDEN>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <cover.1728684335.git.maxim.cournoyer@HIDDEN>
References: <cover.1728684335.git.maxim.cournoyer@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 73754
Cc: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* gnu/packages/c.scm (cppp): New variable.
* gnu/packages/patches/cppp-build-fixes.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.

Change-Id: I7dc2215f4e57aec6356afa82d5740f78a64d3bab
---
 gnu/local.mk                                |  1 +
 gnu/packages/c.scm                          | 36 ++++++++++++++++++++-
 gnu/packages/patches/cppp-build-fixes.patch | 17 ++++++++++
 3 files changed, 53 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/cppp-build-fixes.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 05a8716063..e08ecc744c 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1105,6 +1105,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/coreutils-gnulib-tests.patch		\
   %D%/packages/patches/cppcheck-disable-char-signedness-test.patch	\
   %D%/packages/patches/cppdap-add-CPPDAP_USE_EXTERNAL_GTEST_PACKAGE.patch\
+  %D%/packages/patches/cppp-build-fixes.patch			\
   %D%/packages/patches/cpulimit-with-glib-2.32.patch		\
   %D%/packages/patches/crawl-upgrade-saves.patch		\
   %D%/packages/patches/crc32c-unbundle-googletest.patch		\
diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
index 7c93676f0c..01bfb7eec5 100644
--- a/gnu/packages/c.scm
+++ b/gnu/packages/c.scm
@@ -9,7 +9,7 @@
 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@HIDDEN>
 ;;; Copyright © 2020, 2021 Marius Bakke <marius@HIDDEN>
 ;;; Copyright © 2020 Katherine Cox-Buday <cox.katherine.e@HIDDEN>
-;;; Copyright © 2020, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
+;;; Copyright © 2020, 2022, 2023, 2024 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
 ;;; Copyright © 2020, 2021 Greg Hogan <code@HIDDEN>
 ;;; Copyright © 2021 David Dashyan <mail@HIDDEN>
 ;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@HIDDEN>
@@ -140,6 +140,40 @@ (define-public c-rrb
 slicing.")
      (license license:boost1.0))))
 
+(define-public cppp
+  ;; No release; use the latest commit.
+  (let ((commit "49ccb2162329c6619ab876c6d5765d9d0ac24f61")
+        (revision "0"))
+    (package
+      (name "cppp")
+      (version (git-version "0" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://git.sr.ht/~breadbox/cppp")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "0r3vin9p1ql4ddbszwsvx493h6n0knlgxzpkahdb4a4df1xpqr1s"))
+                (patches (search-patches "cppp-build-fixes.patch"))))
+      (arguments
+       (list
+        #:make-flags #~(list (string-append "prefix=" #$output)
+                             #$(string-append "CC=" (cc-for-target)))
+        #:phases #~(modify-phases %standard-phases
+                     (delete 'configure)))) ;no configure script
+      (build-system gnu-build-system)
+      (home-page "https://www.muppetlabs.com/~breadbox/software/cppp.html")
+      (synopsis "Partial preprocessor for C")
+      (description "@command{cppp} is a partial preprocessor for C/C++ code.
+It implements enough of the C preprocessor to identify the preprocessor
+statements @code{#if}, @code{#ifdef}, et al., and applies their effects for
+the identifiers that are specified on the command-line.  Preprocessor
+statements using identifiers not specified by the user are passed through
+without modification; no other part of the input is altered.")
+      (license license:gpl2+))))
+
 (define-public cproc
   (let ((commit "70fe9ef1810cc6c05bde9eb0970363c35fa7e802")
         (revision "1"))
diff --git a/gnu/packages/patches/cppp-build-fixes.patch b/gnu/packages/patches/cppp-build-fixes.patch
new file mode 100644
index 0000000000..c46be950d8
--- /dev/null
+++ b/gnu/packages/patches/cppp-build-fixes.patch
@@ -0,0 +1,17 @@
+Upstream-status: Submitted to the author via email.
+
+diff --git a/Makefile b/Makefile
+index b4f404d..cbf7cae 100644
+--- a/Makefile
++++ b/Makefile
+@@ -28,8 +28,8 @@ ppproc.o  : ppproc.c ppproc.h gen.h types.h error.h symset.h mstr.h \
+ cppp.o    : cppp.c gen.h types.h unixisms.h error.h symset.h ppproc.h
+ 
+ install:
+-	cp ./cppp $(prefix)/bin/.
+-	cp ./cppp.1 $(prefix)/share/man/man1/.
++	install -D ./cppp $(prefix)/bin/cppp
++	install -D ./cppp.1 $(prefix)/share/man/man1/cppp.1
+ 
+ test: cppp
+ 	./tests/testall
-- 
2.46.0





Information forwarded to maxim.cournoyer@HIDDEN, guix-patches@HIDDEN:
bug#73754; Package guix-patches. Full text available.

Message received at 73754 <at> debbugs.gnu.org:


Received: (at 73754) by debbugs.gnu.org; 12 Oct 2024 04:29:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 12 00:29:55 2024
Received: from localhost ([127.0.0.1]:35989 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1szTlK-0000uw-R0
	for submit <at> debbugs.gnu.org; Sat, 12 Oct 2024 00:29:55 -0400
Received: from mail-pl1-f170.google.com ([209.85.214.170]:56320)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maxim.cournoyer@HIDDEN>) id 1szTlJ-0000ue-97
 for 73754 <at> debbugs.gnu.org; Sat, 12 Oct 2024 00:29:54 -0400
Received: by mail-pl1-f170.google.com with SMTP id
 d9443c01a7336-20bc506347dso21576965ad.0
 for <73754 <at> debbugs.gnu.org>; Fri, 11 Oct 2024 21:29:39 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1728707313; x=1729312113; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=8xh/wVsz2E0/mcK4Qvl9q667KFFbbPXHZ7O1E2xVDpc=;
 b=W4onsG8Ljj0zXj92hgwt+wrGTOw1wsGPrXENyNBaHJAzFs51+FUr8zSq07TSEYb64z
 ugmFHeDgc4jRFsrP/+0IkvqMLtXqMJBFJVbEZ6mIcegVDuCWEqCimPS/MQsFFuL3W+yi
 OUCBxG/0UiUfZGrvm0jIQRnkMu1b1SWA8fZVeX0RHtvCi8tzsUkeXxl1GWrArRSGIHTL
 w0DJIZgCcw5s8EDKLwJJ7SzTa4KdH9tCdesKrkbRpU1HPKXmrBfoiJ4r05oVBjtjt+rE
 MlSM5uO/LlhPsa6VCZz4Lqe/JOrjyk7aIuGOUkse8MCE6rUneQLiPeBYMR45FBLNqoNc
 5yCQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1728707313; x=1729312113;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=8xh/wVsz2E0/mcK4Qvl9q667KFFbbPXHZ7O1E2xVDpc=;
 b=Q+oWqppZ5YFZJYqrtnUWfkYkUosNPkTx/8ySpNbJPhu8MM3iE1LTA0VaTM+Ds3wd78
 F+R2kNf45N57pYBgzRUIJydAN8uEFpF7bIaZml3ILXdFpdeZ7ZzRSJ0Z+htEqq935wPj
 oR/PFCD7k41zyzxOWEfXGSS66Yc4BOfGAkUGihgPHePNICKbyxOvx+LfCc6MThrUkgPN
 0gx+VHUoFQY+T0U9plPKbJQGAN+DAhWFHxlCZdkZ2OOFbe755YOYTtpK0YpFBGi9lxkp
 LCg+l6VgkJYcXryNtxpKeSkwht+hurFvlvV0lz0eUivolMN9XEAhtcNzjOKdKGUnWR61
 EptQ==
X-Gm-Message-State: AOJu0YyWEv+TuyeZ1rBTuA6KORXycvgOLCnwHf48/7kcOXqcndOWTp+c
 7v61cqmQq6ngjFtPdwR8+mitohZycWrACnqCVR4j5j0kp6sOMRLF3MLUAw==
X-Google-Smtp-Source: AGHT+IHIEStTh+mBMkomxb157B7riC4+MhvaQ/+SdtnaesIgjt0s0MuOWpf1DPXfRB2gK2j8rVagpQ==
X-Received: by 2002:a17:902:e5ca:b0:20c:6f6f:afe5 with SMTP id
 d9443c01a7336-20ca16cad0dmr71652095ad.50.1728707313415; 
 Fri, 11 Oct 2024 21:28:33 -0700 (PDT)
Received: from localhost.localdomain ([2405:6586:be0:0:c8ff:1707:9b9:af89])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-20c8c36e814sm30913145ad.307.2024.10.11.21.28.32
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 11 Oct 2024 21:28:32 -0700 (PDT)
From: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
To: 73754 <at> debbugs.gnu.org
Subject: [PATCH 2/5] gnu: sameboy: Use gexps.
Date: Sat, 12 Oct 2024 13:28:11 +0900
Message-ID: <099d74c50d66ceef241185f74ac53af844045849.1728684335.git.maxim.cournoyer@HIDDEN>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <cover.1728684335.git.maxim.cournoyer@HIDDEN>
References: <cover.1728684335.git.maxim.cournoyer@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Maxim Cournoyer <maxim.cournoyer@HIDDEN>, Adam Faiz <adam.faiz@HIDDEN>, Liliana Marie Prikler <liliana.prikler@HIDDEN>, 宋文武 <iyzsong@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 73754
Cc: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* gnu/packages/emulators.scm (sameboy) [arguments]: Use gexps.

Change-Id: Ic5c056f23e94c17072460e92a74663486cfe9e5d
---
 gnu/packages/emulators.scm | 40 +++++++++++++++++---------------------
 1 file changed, 18 insertions(+), 22 deletions(-)

diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index a2a1285d77..b7dff958b7 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -813,29 +813,25 @@ (define-public sameboy
        (sha256
         (base32 "1lab1x156ghfcjcy31rv731wi2b5h56z35n02h4i5pj8wjcf2jr9"))))
     (build-system gnu-build-system)
-    (native-inputs
-     (list rgbds pkg-config))
-    (inputs
-     (list sdl2))
     (arguments
-     `(#:tests? #f                      ; There are no tests
-       #:make-flags `(,(string-append "CC=" ,(cc-for-target))
-                      "NATIVE_CC=gcc" "CONF=release"
-                      ,(string-append "DATA_DIR="
-                                      (assoc-ref %outputs "out")
-                                      "/share/sameboy/"))
-       #:phases
-       (modify-phases %standard-phases
-         (delete 'configure)
-         (replace 'install
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (bin (string-append out "/bin"))
-                    (data (string-append out "/share/sameboy/")))
-               (with-directory-excursion "build/bin/SDL"
-                 (install-file "sameboy" bin)
-                 (delete-file "sameboy")
-                 (copy-recursively "." data))))))))
+     (list
+      #:tests? #f                       ; There are no tests
+      #:make-flags #~(list #$(string-append "CC=" (cc-for-target))
+                           "NATIVE_CC=gcc" "CONF=release"
+                           (string-append "DATA_DIR=" #$output
+                                          "/share/sameboy/"))
+      #:phases
+      #~(modify-phases %standard-phases
+          (delete 'configure)
+          (replace 'install
+            (lambda _
+              (with-directory-excursion "build/bin/SDL"
+                (install-file "sameboy" (string-append #$output "/bin"))
+                (delete-file "sameboy")
+                (copy-recursively
+                 "." (string-append #$output "/share/sameboy/"))))))))
+    (inputs (list sdl2))
+    (native-inputs (list rgbds pkg-config))
     (home-page "https://sameboy.github.io/")
     (synopsis "Accurate Game Boy, Game Boy Color and Super Game Boy emulator")
     (description "SameBoy is a user friendly Game Boy, Game Boy Color
-- 
2.46.0





Information forwarded to maxim.cournoyer@HIDDEN, adam.faiz@HIDDEN, liliana.prikler@HIDDEN, iyzsong@HIDDEN, guix-patches@HIDDEN:
bug#73754; Package guix-patches. Full text available.

Message received at 73754 <at> debbugs.gnu.org:


Received: (at 73754) by debbugs.gnu.org; 12 Oct 2024 04:29:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 12 00:29:47 2024
Received: from localhost ([127.0.0.1]:35986 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1szTlD-0000uX-HC
	for submit <at> debbugs.gnu.org; Sat, 12 Oct 2024 00:29:47 -0400
Received: from mail-pg1-f173.google.com ([209.85.215.173]:56762)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maxim.cournoyer@HIDDEN>) id 1szTlC-0000uQ-6s
 for 73754 <at> debbugs.gnu.org; Sat, 12 Oct 2024 00:29:46 -0400
Received: by mail-pg1-f173.google.com with SMTP id
 41be03b00d2f7-7d916b6a73aso1719829a12.1
 for <73754 <at> debbugs.gnu.org>; Fri, 11 Oct 2024 21:29:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1728707311; x=1729312111; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=ck0uUV/g8vehGW/NnSMTBesfE+z8jL7dnMZYVaqSOL0=;
 b=Be6oYcdODvPBixfz8wBBdHF+Bapd4oGZk7o3DS3Z2XngEMA0DpQbW6CwJUnXVaP0mo
 tqpKEVif2FRbyS0NwnR0KIz/zna+4LtCVZaQGu6J1poahcA7tsvx/oWJvEpLaoiKUmaa
 2Ag1IvId8eJmVJRSM2e3VDYgtJqvr72ob/j1fFfDm+qiInMO6c60DsTZVDQ+qkkfONXb
 /ZdbFJ/Sp6CF2zFux6TZgKkCUfI7vetKrFU5eMRB8aSUaRLDpHHTOao8nRB3JILz94Xq
 5sfNVuLCrkqL39L1L+U13XPOAidYbB54dc1XLNnJmmG0Yg7Vd+kS5mlNMHKaorRLwtoK
 3vzA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1728707311; x=1729312111;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=ck0uUV/g8vehGW/NnSMTBesfE+z8jL7dnMZYVaqSOL0=;
 b=vMUIV4+ofvRJHgiJOhtZPhJIPlrKin1mMvDwmfnIR+cpPFS/tQ7wEwLig0+qp+u7TO
 yUdWCNCZv/PXQwa0/Bja9dxfcGDxW3uENpcWQdGQG4tdzAhfymukDwwCR2btKSajGa1p
 Wr4QzhCqpM5dEMkB5OQCTXltlRErkACqE9z5Dg6dM0zjhkt4mMcZvsxQc6tRq8YfUI4z
 MEp/t7H35jNONknEZRtgkKtxK9C82OZNK9mLGjn7VLV1lmXeG608K7HI3QUKtKKwyaF5
 UZvyOdKPjz0GKvd1cEaER8t7nNI+s7FKtWlju8V6H+GOYnD1YbicNIbLE/IDwTinC1b1
 fRqw==
X-Gm-Message-State: AOJu0YyN9bq1Sc/VCwEM7N2cEvlMYMeRuSDM+LZ+xPElKX3GdOwP2Ji9
 AitQ07f3rVWRiJwbAjzWJqcRt53IbEYGoG05LDKlJfJlBGa7QVhZ8/lqmA==
X-Google-Smtp-Source: AGHT+IHmiVN10GUlZ//6fe/HXouxryelyIbg57HQphYYUGJMqhhFD+Ws/u3ECQ/6cLNajvXBB+SSKA==
X-Received: by 2002:a17:902:f542:b0:20b:a728:d130 with SMTP id
 d9443c01a7336-20ca144eca3mr83274315ad.14.1728707310572; 
 Fri, 11 Oct 2024 21:28:30 -0700 (PDT)
Received: from localhost.localdomain ([2405:6586:be0:0:c8ff:1707:9b9:af89])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-20c8c36e814sm30913145ad.307.2024.10.11.21.28.29
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 11 Oct 2024 21:28:29 -0700 (PDT)
From: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
To: 73754 <at> debbugs.gnu.org
Subject: [PATCH 1/5] gnu: sameboy: Update to 0.16.7.
Date: Sat, 12 Oct 2024 13:28:10 +0900
Message-ID: <a5ea6b16800d01bd48c2dea1a09da2d5920634f8.1728684335.git.maxim.cournoyer@HIDDEN>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <cover.1728684335.git.maxim.cournoyer@HIDDEN>
References: <cover.1728684335.git.maxim.cournoyer@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Maxim Cournoyer <maxim.cournoyer@HIDDEN>, Adam Faiz <adam.faiz@HIDDEN>, Liliana Marie Prikler <liliana.prikler@HIDDEN>, 宋文武 <iyzsong@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 73754
Cc: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* gnu/packages/emulators.scm (sameboy): Update to 0.16.7.

Change-Id: I7283354e0d24a16cd1c6e6a6926616c263ad0526
---
 gnu/packages/emulators.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index d1a9ab5b50..a2a1285d77 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -802,7 +802,7 @@ (define-public mgba
 (define-public sameboy
   (package
     (name "sameboy")
-    (version "0.16.3")
+    (version "0.16.7")
     (source
      (origin
        (method git-fetch)
@@ -811,7 +811,7 @@ (define-public sameboy
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "1jdjg59vzzkbi3c3qaxpsxqx955sb86cd3kcypb0nhjxbnwac1di"))))
+        (base32 "1lab1x156ghfcjcy31rv731wi2b5h56z35n02h4i5pj8wjcf2jr9"))))
     (build-system gnu-build-system)
     (native-inputs
      (list rgbds pkg-config))
-- 
2.46.0





Information forwarded to maxim.cournoyer@HIDDEN, adam.faiz@HIDDEN, liliana.prikler@HIDDEN, iyzsong@HIDDEN, guix-patches@HIDDEN:
bug#73754; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 11 Oct 2024 22:07:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 11 18:07:46 2024
Received: from localhost ([127.0.0.1]:35574 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1szNnW-00067x-Dk
	for submit <at> debbugs.gnu.org; Fri, 11 Oct 2024 18:07:46 -0400
Received: from lists.gnu.org ([209.51.188.17]:46692)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maxim.cournoyer@HIDDEN>) id 1szNnV-00067o-1t
 for submit <at> debbugs.gnu.org; Fri, 11 Oct 2024 18:07:45 -0400
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 <maxim.cournoyer@HIDDEN>)
 id 1szNnF-00087U-TN
 for guix-patches@HIDDEN; Fri, 11 Oct 2024 18:07:30 -0400
Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <maxim.cournoyer@HIDDEN>)
 id 1szNnD-0002qb-SI
 for guix-patches@HIDDEN; Fri, 11 Oct 2024 18:07:29 -0400
Received: by mail-pg1-x529.google.com with SMTP id
 41be03b00d2f7-7db238d07b3so2274273a12.2
 for <guix-patches@HIDDEN>; Fri, 11 Oct 2024 15:07:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1728684441; x=1729289241; darn=gnu.org;
 h=content-transfer-encoding:mime-version:message-id:date:subject:cc
 :to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=4eCNFCgWCZ49Kl/3nI9gb/s6Os1V4SPGQYUrym1+I3E=;
 b=cjRA2MB6eBG8mjNpgNFwjEUudUpQw09aeDjdzFaFYpqJFyZF6LPYJDo7Hs1nRE4vbf
 IuvjF6F7pb2z26Vuz4jzGsJW+mNcrkFN/ol9rJnahTEamhZAGJcAI2pfBY0rM5TTairD
 iq1zszPtaki0HR+/4fxQ7kj9y1BHwY4tJLluQGLnlzqO/YUEQ51TrUUln8bxqHoCSTlb
 XGxtKlvyhcGHJvHpCTmQ4UEC2mHuVEkip95S1I7XEfBxlGtEXgJo8hSaFeJ3uF785e9V
 QFtTAK57JDh36Sy9mlf2JvnLeCqla8NvO+QV5z9cIOPnMKFOCwQG6jtuW515ftJRsY50
 bykA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1728684441; x=1729289241;
 h=content-transfer-encoding:mime-version:message-id:date:subject:cc
 :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=4eCNFCgWCZ49Kl/3nI9gb/s6Os1V4SPGQYUrym1+I3E=;
 b=ar8ucqqu1Yh15kBJXIhc0lswYWER/tS8n7x4NablN6PmKFiW5X3NpYF5sn1ZREzsl1
 AglWuBVNwHTrCwtNVz3zgIFQ/hzpksBlB6kAYgaV0Shmm6gEcnpwWhGNmV+tR28jfSPz
 C1eVA/6CBCFSUZX8cmDaiuCHG+EBGvhnHT/TlQUKvjmWIB3jqDVPjUt9TyrItvvjnLDA
 1QncJppt7e3skBQc8UPBfRwh8WVKOl7r7wDpYSim4m3mz1lnN3Ki2AW3kQJhK2vOHhmz
 WS2mGLpTCbUQF0K97NcNLYPex+4wxGVIiu7+2iIItToJTNLvKIsrbMXcf5MYkMKCp1OB
 /Rvg==
X-Gm-Message-State: AOJu0YxtLU1E5/zd+cdRLH1U21rsN9jHE1qmU20rFlise1+MHHqv8lfs
 tJlVmIcbhDnnvsAfRVhIWTFpmG8TViY7cy1OL/+MquZCclDcNQHQ8Z7ZEg==
X-Google-Smtp-Source: AGHT+IHA6rTlxWU3482TAzVIHIKi3RBEsUxTQM3JCBi02GqC4jeyXombfcYteEcMlib45v9FtElrpQ==
X-Received: by 2002:a05:6a20:cf8a:b0:1d7:5b6c:303c with SMTP id
 adf61e73a8af0-1d8bcf3beccmr6081650637.25.1728684440720; 
 Fri, 11 Oct 2024 15:07:20 -0700 (PDT)
Received: from localhost.localdomain ([2405:6586:be0:0:c8ff:1707:9b9:af89])
 by smtp.gmail.com with ESMTPSA id
 d2e1a72fcca58-71e2aaba5acsm3188439b3a.177.2024.10.11.15.07.19
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 11 Oct 2024 15:07:20 -0700 (PDT)
From: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH games-team 0/5] Unbundle SameBoy from jg-bsnes.
Date: Sat, 12 Oct 2024 07:07:12 +0900
Message-ID: <cover.1728684335.git.maxim.cournoyer@HIDDEN>
X-Mailer: git-send-email 2.46.0
MIME-Version: 1.0
X-Debbugs-Cc: Adam Faiz <adam.faiz@HIDDEN>, Liliana Marie Prikler <liliana.prikler@HIDDEN>, 宋文武 <iyzsong@HIDDEN>
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=2607:f8b0:4864:20::529;
 envelope-from=maxim.cournoyer@HIDDEN; helo=mail-pg1-x529.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
Cc: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

This builds SameBoy as a shared library then uses it to build jg-bsnes,
removing its bundled source copy.

Maxim Cournoyer (5):
  gnu: sameboy: Update to 0.16.7.
  gnu: sameboy: Use gexps.
  gnu: Add cppp.
  gnu: sameboy: Install shared library.
  gnu: jg-bsnes: Unbundle SameBoy.

 gnu/local.mk                                  |   3 +
 gnu/packages/c.scm                            |  36 +-
 gnu/packages/emulators.scm                    |  50 ++-
 gnu/packages/patches/cppp-build-fixes.patch   |  17 +
 .../patches/jg-bsnes-unbundle-sameboy.patch   | 101 ++++++
 gnu/packages/patches/sameboy-shared-lib.patch | 317 ++++++++++++++++++
 6 files changed, 496 insertions(+), 28 deletions(-)
 create mode 100644 gnu/packages/patches/cppp-build-fixes.patch
 create mode 100644 gnu/packages/patches/jg-bsnes-unbundle-sameboy.patch
 create mode 100644 gnu/packages/patches/sameboy-shared-lib.patch


base-commit: d44beb9b4ad836781928a0c5667e94c0d6df13f0
-- 
2.46.0





Acknowledgement sent to Maxim Cournoyer <maxim.cournoyer@HIDDEN>:
New bug report received and forwarded. Copy sent to adam.faiz@HIDDEN, liliana.prikler@HIDDEN, iyzsong@HIDDEN, guix-patches@HIDDEN. Full text available.
Report forwarded to adam.faiz@HIDDEN, liliana.prikler@HIDDEN, iyzsong@HIDDEN, guix-patches@HIDDEN:
bug#73754; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 12 Jan 2025 05:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.