Package: guix-patches;
Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Date: Thu, 24 Oct 2024 15:47:01 UTC
Severity: normal
Tags: patch
Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 73989 in the body.
You can then email your comments to 73989 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
View this report as an mbox folder, status mbox, maintainer mbox
adam.faiz <at> disroot.org, liliana.prikler <at> gmail.com, iyzsong <at> envs.net, guix-patches <at> gnu.org
:bug#73989
; Package guix-patches
.
(Thu, 24 Oct 2024 15:47:02 GMT) Full text and rfc822 format available.Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
:adam.faiz <at> disroot.org, liliana.prikler <at> gmail.com, iyzsong <at> envs.net, guix-patches <at> gnu.org
.
(Thu, 24 Oct 2024 15:47:02 GMT) Full text and rfc822 format available.Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: guix-patches <at> gnu.org Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Subject: [PATCH games-team 0/2] Add TORCS. Date: Fri, 25 Oct 2024 00:45:25 +0900
This adds TORCS, a car racing game/simulator. Maxim Cournoyer (2): gnu: plib: Build with -fPIC. gnu: Add torcs. gnu/packages/game-development.scm | 10 ++- gnu/packages/games.scm | 123 ++++++++++++++++++++++++++++++ 2 files changed, 129 insertions(+), 4 deletions(-) base-commit: e4e1e16bc1b27684b55e6bf047f9f669e1a0c7b5 -- 2.46.0
maxim.cournoyer <at> gmail.com, adam.faiz <at> disroot.org, liliana.prikler <at> gmail.com, iyzsong <at> envs.net, guix-patches <at> gnu.org
:bug#73989
; Package guix-patches
.
(Thu, 24 Oct 2024 16:06:02 GMT) Full text and rfc822 format available.Message #8 received at 73989 <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: 73989 <at> debbugs.gnu.org Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Subject: [PATCH 1/2] gnu: plib: Build with -fPIC. Date: Fri, 25 Oct 2024 01:04:04 +0900
* gnu/packages/game-development.scm (plib) [configure-flags]: New argument. [inputs]: Move field after... [native-inputs]: ... this one. Change-Id: Ieddfb8814632f74c98d0e2cda949709b718c7a0d --- gnu/packages/game-development.scm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm index ee869c9cc5..7d2d47ce7b 100644 --- a/gnu/packages/game-development.scm +++ b/gnu/packages/game-development.scm @@ -2572,10 +2572,12 @@ (define-public plib (patches (search-patches "plib-CVE-2011-4620.patch" "plib-CVE-2012-4552.patch")))) (build-system gnu-build-system) - (inputs - (list mesa libxi libxmu)) - (native-inputs - (list pkg-config)) + ;; plib exists only as a static library, per the author's choice (see: + ;; https://sourceforge.net/p/plib/mailman/message/10289018/). Build it + ;; with PIC, so that shared programs can at least "link" to it. + (arguments (list #:configure-flags #~(list "CXXFLAGS=-fPIC"))) + (native-inputs (list autoconf automake pkg-config)) + (inputs (list mesa libxi libxmu)) (home-page "https://plib.sourceforge.net/") (synopsis "Suite of portable game libraries") (description "PLIB is a set of libraries that will permit programmers to base-commit: e4e1e16bc1b27684b55e6bf047f9f669e1a0c7b5 -- 2.46.0
maxim.cournoyer <at> gmail.com, adam.faiz <at> disroot.org, liliana.prikler <at> gmail.com, iyzsong <at> envs.net, guix-patches <at> gnu.org
:bug#73989
; Package guix-patches
.
(Thu, 24 Oct 2024 16:07:02 GMT) Full text and rfc822 format available.Message #11 received at 73989 <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: 73989 <at> debbugs.gnu.org Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Subject: [PATCH 2/2] gnu: Add torcs. Date: Fri, 25 Oct 2024 01:04:05 +0900
* gnu/packages/games.scm (torcs): New variable. Change-Id: I1e55fc65ff303c309fed50f2071de0eaf4266d57 --- gnu/local.mk | 3 + gnu/packages/games.scm | 123 ++++++++++++++++++ .../patches/torcs-glibc-default-source.patch | 25 ++++ gnu/packages/patches/torcs-isnan.patch | 15 +++ gnu/packages/patches/torcs-nullptr.patch | 14 ++ 5 files changed, 180 insertions(+) create mode 100644 gnu/packages/patches/torcs-glibc-default-source.patch create mode 100644 gnu/packages/patches/torcs-isnan.patch create mode 100644 gnu/packages/patches/torcs-nullptr.patch diff --git a/gnu/local.mk b/gnu/local.mk index 911af88627..5ddbcec9f4 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -2221,6 +2221,9 @@ dist_patch_DATA = \ %D%/packages/patches/tla2tools-build-xml.patch \ %D%/packages/patches/tlf-support-hamlib-4.2+.patch \ %D%/packages/patches/tofi-32bit-compat.patch \ + %D%/packages/patches/torcs-glibc-default-source.patch \ + %D%/packages/patches/torcs-isnan.patch \ + %D%/packages/patches/torcs-nullptr.patch \ %D%/packages/patches/tpetra-remove-duplicate-using.patch \ %D%/packages/patches/transcode-ffmpeg.patch \ %D%/packages/patches/transmission-4.0.6-fix-build.patch \ diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index 64b6b0941a..17c418c5d6 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -7702,6 +7702,129 @@ (define-public tome4 abilities and powers.") (license license:gpl3+))) +(define-public torcs + (package + (name "torcs") + (version "1.3.7") + (source + (origin + (method url-fetch) + (uri (string-append "https://sourceforge.net/projects/" name + "/files/all-in-one/" version "/" + name "-" version ".tar.bz2/download")) + (sha256 + (base32 + "0kdq0sc7dsfzlr0ggbxggcbkivc6yp30nqwjwcaxg9295s3b06wa")) + (patches (search-patches "torcs-isnan.patch" + "torcs-nullptr.patch" + "torcs-glibc-default-source.patch")) + (snippet + '(begin + (use-modules (guix build utils) + (ice-9 ftw) + (ice-9 regex) + (srfi srfi-26)) + ;; Delete Windows-specific sources and pre-built binaries. + (delete-file-recursively "src/windows") + ;; The license of the kw-* and pw-* car models includes a + ;; non-commercial clause, hence does not comply with the GNU FSDG. + (with-directory-excursion "data/cars/models" + (for-each delete-file-recursively + (scandir "." (cut string-match "^(kc|pw)-" <>)))) + ;; Delete extraneous CVS directories. + (for-each delete-file-recursively + (find-files "." (lambda (file stat) + (and (eq? 'directory (stat:type stat)) + (string=? "CVS" (basename file)))) + #:directories? #t)))))) + (build-system gnu-build-system) + (arguments + ;; Building in parallel fails due to a race where include files have not + ;; yet been generated, with errors such as "controlconfig.cpp:30:10: + ;; fatal error: tgfclient.h: No such file or directory". The issue was + ;; reported to the 'torcs-devel' mailing list (see: + ;; https://sourceforge.net/p/torcs/mailman/torcs-devel/). + (list #:modules `(,@%default-gnu-modules (srfi srfi-26)) + #:parallel-build? #f + #:tests? #f ;no test suite + ;; Ensure the binaries find libraries provided by this very package + ;; (see: https://issues.guix.gnu.org/73979). + #:configure-flags + #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output + "/lib/torcs/lib")) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-commands + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "src/linux/torcs.in" + (("/bin/bash") + (search-input-file inputs "bin/bash"))))) + (add-after 'install 'install-data + (lambda _ + (invoke "make" "datainstall"))) + (add-after 'install-data 'install-doc + (lambda _ + (let ((docdir (string-append #$output "/share/doc/torcs/")) + (man6 (string-append #$output "/share/man/man6"))) + (for-each (cut install-file <> man6) + (find-files "doc/man" "\\.6$")) + (install-file "doc/userman/how_to_drive.html" docdir) + (install-file "doc/faq/faq.html" docdir) + (copy-recursively "doc/userman/images" + (string-append docdir "/images"))))) + (add-after 'install 'install-freedesktop-entry + (lambda _ + (let ((iconsdir (string-append #$output "/share/icons/hicolor/" + "48x48/apps"))) + (mkdir-p iconsdir) + (copy-file "Ticon.png" (string-append iconsdir "/torcs.png"))) + (install-file "torcs.desktop" + (string-append #$output + "/share/applications/")))) + (add-after 'install 'fix-permissions + ;; XXX: Otherwise, the guix daemon reports: "suspicious + ;; ownership or permission on /gnu/store/xxx-torcs-1.3.7', + ;; rejecting this build output". + (lambda _ + (chmod #$output #o744)))))) + (inputs + (list bash-minimal + freealut + freeglut + libice + libpng + libsm + libvorbis + libxi + libxmu + libxrandr + libxrender + libxt + mesa + openal + plib + zlib)) + (home-page "https://sourceforge.net/projects/torcs/") + (synopsis "Car racing simulator") + (description "TORCS stands for The Open Racing Car Simulator. It can be +used as an ordinary car racing game, as an artificial intelligence (AI) racing +game, or as a research platform. The game has features such as: +@itemize +@item Input support for a driving wheel, joystick, keyboard or mouse +@item More than 30 car models +@item 30 tracks +@item 50 opponents to race against +@item Lighting, smoke, skidmarks and glowing brake disks graphics +@item Simple damage model and collisions +@item Tire and wheel properties (springs, dampers, stiffness, etc.) +@item Aerodynamics (ground effect, spoilers, etc.) +@end itemize +The difficulty level can be configured, impacting how much damage is caused by +collisions and the level of traction the car has on the track, which makes the +game fun for both novice and experts.") + (license (list license:gpl2+ ;source and most assets + license:fdl1.2+)))) ;how_to_drive.html, faq.html + (define-public quakespasm (package (name "quakespasm") diff --git a/gnu/packages/patches/torcs-glibc-default-source.patch b/gnu/packages/patches/torcs-glibc-default-source.patch new file mode 100644 index 0000000000..eb74cfd4ce --- /dev/null +++ b/gnu/packages/patches/torcs-glibc-default-source.patch @@ -0,0 +1,25 @@ +From: Aurelien Jarno <aurelien <at> aurel32.net> +Date: Mon, 1 May 2017 15:58:31 +0200 +Subject: glibc default source + +_SVID_SOURCE and _BSD_SOURCE are deprecated, using _DEFAULT_SOURCE +instead. + +Forwarded: https://sourceforge.net/p/torcs/mailman/message/35831161/ +--- + Make-config.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Make-config.in b/Make-config.in +index f0e0a12..8041327 100644 +--- a/Make-config.in ++++ b/Make-config.in +@@ -48,7 +48,7 @@ INSTALL_DATA = @INSTALL_DATA@ + INSTALL_SCRIPT = @INSTALL_SCRIPT@ + mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs + +-CFLAGSD = -D_SVID_SOURCE -D_BSD_SOURCE -DSHM -DHAVE_CONFIG_H ++CFLAGSD = -D_DEFAULT_SOURCE -DSHM -DHAVE_CONFIG_H + CXXFLAGS = @CXXFLAGS@ @CPPFLAGS@ ${CFLAGSD} + CFLAGS = @CFLAGS@ ${CFLAGSD} + diff --git a/gnu/packages/patches/torcs-isnan.patch b/gnu/packages/patches/torcs-isnan.patch new file mode 100644 index 0000000000..2ec0c4e1c1 --- /dev/null +++ b/gnu/packages/patches/torcs-isnan.patch @@ -0,0 +1,15 @@ +Source: https://src.fedoraproject.org/rpms/torcs/raw/rawhide/f/torcs-1.3.7-isnan.patch +Upstream-status: https://sourceforge.net/p/torcs/mailman/torcs-devel/thread/0bd466b7-e158-471b-13ad-504167587d01%40embecosm.com/#msg35836767 + +diff -up torcs-1.3.7/src/drivers/olethros/geometry.cpp.orig torcs-1.3.7/src/drivers/olethros/geometry.cpp +--- torcs-1.3.7/src/drivers/olethros/geometry.cpp.orig 2016-06-07 19:49:11.347896827 +0100 ++++ torcs-1.3.7/src/drivers/olethros/geometry.cpp 2016-06-07 19:49:46.532894257 +0100 +@@ -27,6 +27,8 @@ + #ifdef WIN32 + #include <float.h> + #define isnan _isnan ++#else ++#define isnan std::isnan + #endif + + diff --git a/gnu/packages/patches/torcs-nullptr.patch b/gnu/packages/patches/torcs-nullptr.patch new file mode 100644 index 0000000000..a002c48169 --- /dev/null +++ b/gnu/packages/patches/torcs-nullptr.patch @@ -0,0 +1,14 @@ +Source: https://src.fedoraproject.org/rpms/torcs/raw/rawhide/f/torcs-1.3.7-nullptr.patch +Upstream-status: https://sourceforge.net/p/torcs/mailman/message/36490328/ + +--- torcs-1.3.7/src/libs/musicplayer/OpenALMusicPlayer.cpp.orig 2014-02-05 10:54:43.000000000 +0100 ++++ torcs-1.3.7/src/libs/musicplayer/OpenALMusicPlayer.cpp 2018-07-09 20:56:42.521607205 +0100 +@@ -161,7 +161,7 @@ + { + char pcm[BUFFERSIZE]; + int size = 0; +- const char* error = '\0'; ++ const char* error = nullptr; + + if (!stream->read(pcm, BUFFERSIZE, &size, &error)) { + GfError("OpenALMusicPlayer: Stream read error: %s\n", error); -- 2.46.0
guix-patches <at> gnu.org
:bug#73989
; Package guix-patches
.
(Wed, 06 Nov 2024 20:42:08 GMT) Full text and rfc822 format available.Message #14 received at 73989 <at> debbugs.gnu.org (full text, mbox):
From: Rodion Goritskov <rodion.goritskov <at> gmail.com> To: 73989 <at> debbugs.gnu.org Subject: [PATCH games-team 0/2] Add TORCS. Date: Thu, 07 Nov 2024 00:40:10 +0400
I tried to apply and build this patchset with the current master. It applies fine (with some warnings on whitespaces). Plib builds fine. However, TORCS fails to build with the following error: building /gnu/store/1r1lq54yhvh748jsdmd1apdxss5qbk11-download.drv... source is at 'download' applying '/gnu/store/jlgga73s3qj44kkdqagqhg32ipiqmlrk-torcs-isnan.patch'... can't find file to patch at input line 7 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |Source: https://src.fedoraproject.org/rpms/torcs/raw/rawhide/f/torcs-1.3.7-isnan.patch |Upstream-status: https://sourceforge.net/p/torcs/mailman/torcs-devel/thread/0bd466b7-e158-471b-13ad-504167587d01%40embecosm.com/#msg35836767 | |diff -up torcs-1.3.7/src/drivers/olethros/geometry.cpp.orig torcs-1.3.7/src/drivers/olethros/geometry.cpp |--- torcs-1.3.7/src/drivers/olethros/geometry.cpp.orig 2016-06-07 19:49:11.347896827 +0100 |+++ torcs-1.3.7/src/drivers/olethros/geometry.cpp 2016-06-07 19:49:46.532894257 +0100 -------------------------- No file to patch. Skipping patch. 1 out of 1 hunk ignored Backtrace: 5 (primitive-load "/gnu/store/chd1n6n2aaiqljahnh858rs8dbr?") In ice-9/eval.scm: 619:8 4 (_ #(#(#<directory (guile-user) 7ffff7850c80> "dow?") #)) In ice-9/boot-9.scm: 142:2 3 (dynamic-wind #<procedure 7ffff5f6ab20 at ice-9/eval.s?> ?) In ice-9/eval.scm: 619:8 2 (_ #(#(#<directory (guile-user) 7ffff7850c80>))) In srfi/srfi-1.scm: 634:9 1 (for-each #<procedure apply-patch (a)> ("/gnu/store/?" ?)) In guix/build/utils.scm: 822:6 0 (invoke "/gnu/store/4jhlsg65s1zx90gnnfmaax52i8prnl45-p?" ?) guix/build/utils.scm:822:6: In procedure invoke: ERROR: 1. &invoke-error: program: "/gnu/store/4jhlsg65s1zx90gnnfmaax52i8prnl45-patch-2.7.6/bin/patch" arguments: ("--force" "--no-backup-if-mismatch" "-p1" "--input" "/gnu/store/jlgga73s3qj44kkdqagqhg32ipiqmlrk-torcs-isnan.patch") exit-status: 1 term-signal: #f stop-signal: #f builder for `/gnu/store/1r1lq54yhvh748jsdmd1apdxss5qbk11-download.drv' failed with exit code 1 build of /gnu/store/1r1lq54yhvh748jsdmd1apdxss5qbk11-download.drv failed Could not find build log for '/gnu/store/1r1lq54yhvh748jsdmd1apdxss5qbk11-download.drv'. cannot build derivation `/gnu/store/n9lsyw8ksynkwq88mr5jikdcwcz4lfnh-torcs-1.3.7.drv': 1 dependencies couldn't be built guix build: error: build of `/gnu/store/n9lsyw8ksynkwq88mr5jikdcwcz4lfnh-torcs-1.3.7.drv' failed
Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
:Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
:Message #19 received at 73989-done <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: Rodion Goritskov <rodion.goritskov <at> gmail.com> Cc: 73989-done <at> debbugs.gnu.org Subject: Re: [bug#73989] [PATCH games-team 0/2] Add TORCS. Date: Tue, 12 Nov 2024 20:49:51 +0900
Hi! Rodion Goritskov <rodion.goritskov <at> gmail.com> writes: > I tried to apply and build this patchset with the current master. > It applies fine (with some warnings on whitespaces). > > Plib builds fine. However, TORCS fails to build with the following error: > > building /gnu/store/1r1lq54yhvh748jsdmd1apdxss5qbk11-download.drv... > source is at 'download' > applying '/gnu/store/jlgga73s3qj44kkdqagqhg32ipiqmlrk-torcs-isnan.patch'... > can't find file to patch at input line 7 > Perhaps you used the wrong -p or --strip option? > The text leading up to this was: > -------------------------- > |Source: https://src.fedoraproject.org/rpms/torcs/raw/rawhide/f/torcs-1.3.7-isnan.patch > |Upstream-status: > | https://sourceforge.net/p/torcs/mailman/torcs-devel/thread/0bd466b7-e158-471b-13ad-504167587d01%40embecosm.com/#msg35836767 > | > |diff -up torcs-1.3.7/src/drivers/olethros/geometry.cpp.orig torcs-1.3.7/src/drivers/olethros/geometry.cpp > |--- torcs-1.3.7/src/drivers/olethros/geometry.cpp.orig 2016-06-07 19:49:11.347896827 +0100 > |+++ torcs-1.3.7/src/drivers/olethros/geometry.cpp 2016-06-07 19:49:46.532894257 +0100 > -------------------------- Ah! That download.drv seemed wrong. I think it is caused by a last minute change I did following 'guix lint', which suggested adapting the URL; I had added /download at the end of the URL and apparently that threw off our unpacking phase, which no longer considered it a tarball or something. Anyway, fixed by adding a 'file-name' field to the origin, and pushed as 18bd867b24 as a fixup commit. Enjoy! -- Maxim
guix-patches <at> gnu.org
:bug#73989
; Package guix-patches
.
(Wed, 13 Nov 2024 02:59:02 GMT) Full text and rfc822 format available.Message #22 received at 73989-done <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: Rodion Goritskov <rodion.goritskov <at> gmail.com> Cc: 73989-done <at> debbugs.gnu.org Subject: Re: [bug#73989] [PATCH games-team 0/2] Add TORCS. Date: Wed, 13 Nov 2024 11:57:40 +0900
Hi Rodion, Rodion Goritskov <rodion.goritskov <at> gmail.com> writes: > I tried to apply and build this patchset with the current master. > It applies fine (with some warnings on whitespaces). > > Plib builds fine. However, TORCS fails to build with the following error: Thanks, I've fixed it, now also on master. It had todo with a last minute change in the source URL, which caused the file name in the store to be just 'download' and broke the unpack logic, which uses the filename extension. -- Thanks, Maxim
Debbugs Internal Request <help-debbugs <at> gnu.org>
to internal_control <at> debbugs.gnu.org
.
(Wed, 11 Dec 2024 12:24:16 GMT) Full text and rfc822 format available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.