diff mbox series

[bug#62724,v11] gnu: mame: Update to 0.255.

Message ID 960d106218b9b6ec68861fa8a800eadcec09e349.1686343392.git.mail@nicolasgoaziou.fr
State New
Headers show
Series [bug#62724,v11] gnu: mame: Update to 0.255. | expand

Commit Message

Nicolas Goaziou June 9, 2023, 8:43 p.m. UTC
* gnu/packages/emulators.scm (mame): Update to 0.254.
[source]: Add modules for CUT and SCANDIR.  Preserve the minimum set of
third-party libraries.
[arguments]<#:make-flags>: Remove unnecessary flags.
<#:phases>: Add a phase to use all possible system libraries instead of
listing them piece wise.
[native-inputs]: Add NASM.
[inputs]: Replace LUA with LUA-5.4.
---

v11: Update to 0.255.  Preserve luafilesystem library.

 gnu/packages/emulators.scm | 64 +++++++++++++++++++++++++++-----------
 1 file changed, 46 insertions(+), 18 deletions(-)


base-commit: 44bbfc24e4bcc48d0e3343cd3d83452721af8c36

Comments

Ludovic Courtès June 18, 2023, 9:22 p.m. UTC | #1
Hi,

Apparently v11 is failing as well:
<https://qa.guix.gnu.org/issue/62724>.

Any idea?

Ludo’.
Nicolas Goaziou June 19, 2023, 6:19 a.m. UTC | #2
Hello,

Ludovic Courtès <ludo@gnu.org> writes:

> Apparently v11 is failing as well:
> <https://qa.guix.gnu.org/issue/62724>.

Indeed :(

> Any idea?

It seems related to Lua. They ship 5.4.4 compiled as C++, whereas ours
is 5.4.3 compiled as C (or so I think).

Once I'm done with the texlive branch, I'll try to re-bundle (!) their
Lua and send a v12, unless someone beats me to it.

Regards,
diff mbox series

Patch

diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index 13b6022308..30082ca163 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -1760,7 +1760,7 @@  (define-public libticalcs2
 (define-public mame
   (package
     (name "mame")
-    (version "0.252")
+    (version "0.255")
     (source
      (origin
        (method git-fetch)
@@ -1769,33 +1769,60 @@  (define-public mame
              (commit (apply string-append "mame" (string-split version #\.)))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "07qhcm1v47sy2wj30nx3cbhvcbgki0cl83gabr0miiw60fhgyn6j"))
-       (modules '((guix build utils)))
+        (base32 "13basy5gjrkyfy9ha2nhww1yl0q3q0fawcx6sk3vfmi927c5asq0"))
+       (modules '((ice-9 ftw)
+                  (srfi srfi-26)
+                  (guix build utils)))
        (snippet
-        ;; Remove bundled libraries.
-        '(begin
-           (with-directory-excursion "3rdparty"
-             (for-each delete-file-recursively
-                       '("asio" "expat" "glm" "libflac" "libjpeg" "lua"
-                         "portaudio" "portmidi" "pugixml" "rapidjson" "SDL2"
-                         "SDL2-override" "sqlite3" "utf8proc" "zlib")))))))
+        ;; Remove most bundled libraries.
+        ;;
+        ;; TODO: Some of the preserved the libraries below ship with Guix, but
+        ;; may prove difficult to un-bundle.
+        #~(with-directory-excursion "3rdparty"
+            (let ((keep (list "." ".."
+                              "asmjit"
+                              "bgfx"
+                              "bimg"
+                              "bx"
+                              "genie"
+                              "linenoise"
+                              "lsqlite3"
+                              "lua-linenoise"
+                              "lua-zlib"
+                              "luafilesystem"
+                              "lzma"
+                              "minimp3"
+                              "nanosvg"
+                              "softfloat"
+                              "softfloat3"
+                              "sol2"
+                              "wdlfft"
+                              "ymfm")))
+              (for-each delete-file-recursively
+                        (scandir "." (negate (cut member <> keep)))))))))
     (build-system gnu-build-system)
     (arguments
      (list
       #:make-flags
-      #~(cons*
+      #~(list
          ;; A 'strict-overflow' error pops up on i686 so disable '-Werror'.
          "NOWERROR=1"
          (string-append "QT_HOME=" #$(this-package-input "qtbase"))
-         (string-append "SDL_INI_PATH=" #$output "/share/mame/ini")
-         (map (lambda (lib)
-                (string-append "USE_SYSTEM_LIB_" (string-upcase lib) "=1"))
-              '("asio" "expat" "flac" "glm" "jpeg" "lua" "portaudio" "portmidi"
-                "pugixml" "rapidjson" "sqlite3" "utf8proc" "zlib")))
+         (string-append "SDL_INI_PATH=" #$output "/share/mame/ini"))
       #:tests? #f                       ;no test in regular release
       #:phases
       #~(modify-phases %standard-phases
+          (add-after 'unpack 'fix-sol2-build-error
+            ;; Fix "error: operator '!=' has no left operand" because
+            ;; LUA_COMPAT_BITLIB is empty.
+            (lambda _
+              (substitute* "3rdparty/sol2/sol/sol.hpp"
+                (("&& \\(LUA_COMPAT_BITLIB != 0\\)") ""))))
           (delete 'configure)
+          (add-before 'build 'use-system-libraries
+            (lambda _
+              (substitute* "makefile"
+                (("# +(USE_SYSTEM_LIB)" _ option) option))))
           (add-after 'build 'build-documentation
             (lambda _ (invoke "make" "-C" "docs" "man" "info")))
           (replace 'install
@@ -1898,7 +1925,8 @@  (define-public mame
                            Keywords=Game;Emulator;Arcade;~%"
                             executable)))))))))
     (native-inputs
-     (list pkg-config
+     (list nasm
+           pkg-config
            python-sphinx
            python-sphinxcontrib-svg2pdfconverter
            texinfo))
@@ -1912,7 +1940,7 @@  (define-public mame
            libjpeg-turbo
            libxi
            libxinerama
-           lua
+           lua-5.4
            portaudio
            portmidi
            pugixml