Subject: [PATCH] gnu: torcs: Update to 1.3.8.

From: Nigko Yerden <[email-masked]>
Date: Sat, 10 May 2025 11:10:11 +0500

* gnu/packages/games.scm (torcs): Update to 1.3.8.
* gnu/packages/patches/torcs-glibc-default-source.patch: Delete file.
* gnu/packages/patches/torcs-isnan.patch: Delete file.
* gnu/packages/patches/torcs-nullptr.patch: Delete file.
* gnu/local.mk (dist_patch_DATA): Unregister torcs-glibc-default-source.patch,
torcs-isnan.patch, and torcs-nullptr.patch.

Change-Id: Ieb7b3db0c1ee66e62fb2873722326141815a2008
---
 gnu/local.mk                                  |  3 -
 gnu/packages/games.scm                        | 55 +++++++++----------
 .../patches/torcs-glibc-default-source.patch  | 25 ---------
 gnu/packages/patches/torcs-isnan.patch        | 15 -----
 gnu/packages/patches/torcs-nullptr.patch      | 14 -----
 5 files changed, 27 insertions(+), 85 deletions(-)
 delete mode 100644 gnu/packages/patches/torcs-glibc-default-source.patch
 delete mode 100644 gnu/packages/patches/torcs-isnan.patch
 delete mode 100644 gnu/packages/patches/torcs-nullptr.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index e6ece8cc48..4aa991dcba 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2325,9 +2325,6 @@ 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/torbrowser-compare-paths.patch           \
   %D%/packages/patches/tpetra-remove-duplicate-using.patch	\
   %D%/packages/patches/transcode-ffmpeg.patch	\
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index d75d21e6f7..0c932479ee 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -89,6 +89,7 @@
 ;;; Copyright © 2025 Sharlatan Hellseher <[email-masked]>
 ;;; Copyright © 2023-2025 Adam Faiz <[email-masked]>
 ;;; Copyright © 2025 Andrew Wong <[email-masked]>
+;;; Copyright © 2025 Nigko Yerden <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -8147,39 +8148,37 @@ (define-public tome4
 (define-public torcs
   (package
     (name "torcs")
-    (version "1.3.7")
+    (version "1.3.8")
     (source
      (origin
        (method url-fetch)
-       (uri (string-append "https://sourceforge.net/projects/" name
-                           "/files/all-in-one/" version "/"
-                           name "-" version ".tar.bz2/download"))
-       (file-name (string-append name "-" version ".tar.bz2"))
+       (uri (string-append "mirror://sourceforge/" name
+                           "/all-in-one/" version "/"
+                           name "-" version ".tar.bz2"))
+       ;; Source archive is in fact in gzip format, rename it.
+       (file-name (string-append name "-" version ".tar.gz"))
        (sha256
         (base32
-         "0kdq0sc7dsfzlr0ggbxggcbkivc6yp30nqwjwcaxg9295s3b06wa"))
-       (patches (search-patches "torcs-isnan.patch"
-                                "torcs-nullptr.patch"
-                                "torcs-glibc-default-source.patch"))
+         "1bx7i67b01yfy9lyak4x4xrdb3zb0mr8kwx6h8cl2dpv8lspg5jb"))
+       (modules '((guix build utils)
+                  (ice-9 ftw)
+                  (ice-9 regex)
+                  (srfi srfi-26)))
        (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))))))
+        #~(begin
+            ;; 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
@@ -8229,7 +8228,7 @@ (define-public torcs
                  ;; ownership or permission on /gnu/store/xxx-torcs-1.3.7',
                  ;; rejecting this build output".
                  (lambda _
-                   (chmod #$output #o744))))))
+                   (chmod #$output #o755))))))
     (inputs
      (list bash-minimal
            freealut
diff --git a/gnu/packages/patches/torcs-glibc-default-source.patch b/gnu/packages/patches/torcs-glibc-default-source.patch
deleted file mode 100644
index eb74cfd4ce..0000000000
--- a/gnu/packages/patches/torcs-glibc-default-source.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From: Aurelien Jarno <[email-masked]>
-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
deleted file mode 100644
index 2ec0c4e1c1..0000000000
--- a/gnu/packages/patches/torcs-isnan.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-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
deleted file mode 100644
index a002c48169..0000000000
--- a/gnu/packages/patches/torcs-nullptr.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-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);

base-commit: c3b6b57521404d223ae37d3dd91f7bb60ed0cebc
-- 
2.49.0