all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#31672] [PATCH 0/2] Add Mame
@ 2018-05-31 19:39 Nicolas Goaziou
  2018-05-31 19:44 ` [bug#31672] [PATCH 1/2] gnu: asio: New variable Nicolas Goaziou
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Nicolas Goaziou @ 2018-05-31 19:39 UTC (permalink / raw)
  To: 31672

Hello,

The following patch set adds Mame.

Feedback welcome.

Regards,

Nicolas Goaziou (2):
  gnu: asio: New variable.
  gnu: mame: New variable.

 gnu/packages/emulators.scm  | 170 ++++++++++++++++++++++++++++++++++++
 gnu/packages/networking.scm |  44 ++++++++++
 2 files changed, 214 insertions(+)

-- 
2.17.0

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [bug#31672] [PATCH 1/2] gnu: asio: New variable.
  2018-05-31 19:39 [bug#31672] [PATCH 0/2] Add Mame Nicolas Goaziou
@ 2018-05-31 19:44 ` Nicolas Goaziou
  2018-05-31 19:44   ` [bug#31672] [PATCH 2/2] gnu: mame: " Nicolas Goaziou
  2018-06-01  3:10 ` [bug#31672] [PATCH 0/2] Add Mame Eric Bavier
  2018-06-01 11:27 ` Rutger Helling
  2 siblings, 1 reply; 12+ messages in thread
From: Nicolas Goaziou @ 2018-05-31 19:44 UTC (permalink / raw)
  To: 31672

* gnu/packages/networking.scm (asio): New variable.
---
 gnu/packages/networking.scm | 44 +++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm
index d4cfffcc3..ba359b9a8 100644
--- a/gnu/packages/networking.scm
+++ b/gnu/packages/networking.scm
@@ -56,6 +56,7 @@
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bison)
+  #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
   #:use-module (gnu packages code)
   #:use-module (gnu packages compression)
@@ -1856,3 +1857,46 @@ eight bytes) tools
 @end itemize")
     ;; Either BSD-3 or GPL-2 can be used.
     (license (list license:bsd-3 license:gpl2))))
+
+(define-public asio
+  (package
+    (name "asio")
+    (version "1.12.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/chriskohlhoff/asio.git")
+             (commit (string-join (cons name (string-split version #\.))
+                                  "-"))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "04dg8kpgriay7q62mqcq2gl439k5y4mf761zghsd6wfl0farh3mx"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)))
+    (inputs
+     `(("boost" ,boost)
+       ("openssl" ,openssl)))
+    (arguments
+     `(#:configure-flags
+       (list
+        (string-append "--with-boost=" (assoc-ref %build-inputs "boost"))
+        (string-append "--with-openssl=" (assoc-ref %build-inputs "openssl")))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'chdir-to-asio
+           (lambda _
+             (chdir "asio")))
+         (add-before 'configure 'bootstrap
+           (lambda _
+             (invoke "sh" "autogen.sh"))))))
+    (home-page "https://think-async.com/Asio")
+    (synopsis "C++ library for ASynchronous network I/O")
+    (description "Asio is a cross-platform C++ library for network and
+low-level I/O programming that provides developers with a consistent
+asynchronous model using a modern C++ approach.")
+    (license license:boost1.0)))
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [bug#31672] [PATCH 2/2] gnu: mame: New variable.
  2018-05-31 19:44 ` [bug#31672] [PATCH 1/2] gnu: asio: New variable Nicolas Goaziou
@ 2018-05-31 19:44   ` Nicolas Goaziou
  0 siblings, 0 replies; 12+ messages in thread
From: Nicolas Goaziou @ 2018-05-31 19:44 UTC (permalink / raw)
  To: 31672

* gnu/packages/emulators.scm (mame): New variable.
---
 gnu/packages/emulators.scm | 170 +++++++++++++++++++++++++++++++++++++
 1 file changed, 170 insertions(+)

diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index c354386bd..19872b009 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -56,13 +56,19 @@
   #:use-module (gnu packages libedit)
   #:use-module (gnu packages libusb)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages lua)
+  #:use-module (gnu packages maths)
   #:use-module (gnu packages mp3)
+  #:use-module (gnu packages music)
   #:use-module (gnu packages ncurses)
+  #:use-module (gnu packages networking)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages sdl)
+  #:use-module (gnu packages texinfo)
+  #:use-module (gnu packages textutils)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages upnp)
   #:use-module (gnu packages video)
@@ -72,6 +78,7 @@
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
+  #:use-module (gnu packages web)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu))
 
@@ -1167,3 +1174,166 @@ already have their data files.  The clever part about this: ScummVM
 just replaces the executables shipped with the games, allowing you to
 play them on systems for which they were never designed!")
     (license license:gpl2+)))
+
+(define-public mame
+  (package
+    (name "mame")
+    (version "0.198")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/mamedev/mame.git")
+             (commit (apply string-append "mame" (string-split version #\.)))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0kl7qll8d6xlx7bj5920ljs888a6nc1fj2kfw1fz0r8za3m7wiq9"))
+       (modules '((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")))
+           #t))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:make-flags
+       (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"))
+       #:tests? #f                      ;no test in regular release
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (add-after 'build 'build-documentation
+           (lambda _ (invoke "make" "-C" "docs" "man" "info")))
+         (replace 'install
+           ;; Upstream does not provide an installation phase.
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (share (string-append out "/share/mame")))
+               ;; Install data.
+               (for-each (lambda (dir)
+                           (copy-recursively dir (string-append share "/" dir)))
+                         '("artwork" "bgfx" "ctrlr" "hash" "ini" "language"
+                           "plugins" "samples"))
+               (let ((keymaps (string-append share "/keymaps")))
+                 (for-each (lambda (file) (install-file file keymaps))
+                           (find-files "keymaps" ".*LINUX\\.map")))
+               (let ((fonts (string-append share "/fonts")))
+                 (install-file "uismall.bdf" fonts))
+               (install-file "mame64" share)
+               ;; Create "mame" executable.  MAME expects to be called from
+               ;; the directory where the "mame64" directory lives.  Since we
+               ;; cannot afford to do that, we start a sub-shell in the
+               ;; appropriate directory.
+               (let* ((bin (string-append out "/bin"))
+                      (script (string-append bin "/mame")))
+                 (mkdir-p bin)
+                 (with-output-to-file script
+                   (lambda _
+                     (format #t
+                             "#!~a\n(cd ~a && exec ./mame64 \"$@\")~%"
+                             (which "sh") share)))
+                 (chmod script #o555)))
+             #t))
+         (add-after 'install 'install-documentation
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (man (string-append out "/share/man/man1"))
+                    (info (string-append out "/share/info")))
+               (install-file "docs/build/man/MAME.1" man)
+               (install-file "docs/build/texinfo/MAME.info" info))
+             #t))
+         (add-after 'install 'install-ini-file
+           ;; Generate an ini file so as to set some directories (e.g., roms)
+           ;; to a writable location, i.e., "$HOME/.mame/" and "$HOME/mame/".
+           ;; It must be located in the same directory as the executable
+           ;; "mame64", otherwise MAME cannot find it.
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (share (string-append out "/share/mame")))
+               (with-output-to-file (string-append share "/mame.ini")
+                 (lambda _
+                   (format #t
+                           "inipath              $HOME/.mame;.;ini~@
+                            homepath             $HOME/mame~@
+                            rompath              $HOME/mame/roms~@
+                            samplepath           $HOME/mame/samples;samples~@
+                            cheatpath            $HOME/mame/cheat~@
+                            artpath              $HOME/mame/artwork;artwork~@
+                            crosshairpath        $HOME/mame/crosshair~@
+                            hashpath             hash~@
+                            fontpath             fonts~@
+                            ctrlrpath            ctrlr~@
+                            bgfx_path            bgfx~@
+                            pluginspath          plugins~@
+                            languagepath         language~@
+                            cfg_directory        $HOME/.mame/cfg~@
+                            nvram_directory      $HOME/.mame/nvram~@
+                            input_directory      $HOME/.mame/inp~@
+                            state_directory      $HOME/.mame/sta~@
+                            snapshot_directory   $HOME/.mame/snap~@
+                            diff_directory       $HOME/.mame/diff~@
+                            comment_directory    $HOME/.mame/comments~%")))
+               #t)))
+         (add-after 'install 'install-desktop-file
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (desktop (string-append out "/share/applications"))
+                    (executable (string-append out "/bin/mame")))
+               (mkdir-p desktop)
+               (with-output-to-file (string-append desktop "/mame.desktop")
+                 (lambda _
+                   (format #t
+                           "[Desktop Entry]~@
+                           Name=~a~@
+                           Comment=Multi-purpose emulation framework~@
+                           Exec=~a~@
+                           TryExec=~@*~a~@
+                           Terminal=false~@
+                           Type=Application~@
+                           Categories=Game;Emulator;~@
+                           Keywords=Game;Emulator;Arcade;~%"
+                           ,name executable)))
+               #t))))))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("pugixml" ,pugixml)
+       ("python-sphinx" ,python-sphinx)
+       ("texinfo" ,texinfo)))
+    (inputs
+     `(("alsa-lib" ,alsa-lib)
+       ("asio" ,asio)
+       ("expat" ,expat)
+       ("flac" ,flac)
+       ("fontconfig" ,fontconfig)
+       ("glm" ,glm)
+       ("libjpeg" ,libjpeg-8)    ;jpeg_read_header argument error in libjpeg-9
+       ("libxinerama" ,libxinerama)
+       ("lua" ,lua)
+       ("portaudio" ,portaudio)
+       ("portmidi" ,portmidi)
+       ("python-wrapper" ,python-wrapper)
+       ("qtbase" ,qtbase)
+       ("rapidjson" ,rapidjson)
+       ("sdl" ,(sdl-union (list sdl2 sdl2-ttf)))
+       ("sqlite" ,sqlite)
+       ("utf8proc" ,utf8proc)
+       ("zlib" ,zlib)))
+    (home-page "http://mamedev.org/")
+    (synopsis "Multi-purpose emulation framework")
+    (description "MAME's purpose is to preserve decades of software
+history.  As electronic technology continues to rush forward, MAME
+prevents this important @emph{vintage} software from being lost and
+forgotten.  This is achieved by documenting the hardware and how it
+functions.  The source code to MAME serves as this documentation.")
+    ;; The MAME project as a whole is distributed under the terms of GPL2+.
+    ;; However, over 90% of the files are under Expat license.  Also, artwork,
+    ;; keymaps, languages and samples are under CC0.
+    (license (list license:gpl2+ license:expat license:cc0))))
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [bug#31672] [PATCH 0/2] Add Mame
  2018-05-31 19:39 [bug#31672] [PATCH 0/2] Add Mame Nicolas Goaziou
  2018-05-31 19:44 ` [bug#31672] [PATCH 1/2] gnu: asio: New variable Nicolas Goaziou
@ 2018-06-01  3:10 ` Eric Bavier
  2018-06-01 22:05   ` Nicolas Goaziou
  2018-06-01 11:27 ` Rutger Helling
  2 siblings, 1 reply; 12+ messages in thread
From: Eric Bavier @ 2018-06-01  3:10 UTC (permalink / raw)
  To: 31672, mail

[-- Attachment #1: Type: text/plain, Size: 744 bytes --]

I haven't reviewed the patches properly, but just wondering whether/how these patches relate to those posted a while back to add MAME and the resulting discussion there.

I will try to give these patches a try in the next few days.

On May 31, 2018 2:39:23 PM CDT, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
>Hello,
>
>The following patch set adds Mame.
>
>Feedback welcome.
>
>Regards,
>
>Nicolas Goaziou (2):
>  gnu: asio: New variable.
>  gnu: mame: New variable.
>
> gnu/packages/emulators.scm  | 170 ++++++++++++++++++++++++++++++++++++
> gnu/packages/networking.scm |  44 ++++++++++
> 2 files changed, 214 insertions(+)
>
>-- 
>2.17.0

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

[-- Attachment #2: Type: text/html, Size: 1009 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [bug#31672] [PATCH 0/2] Add Mame
  2018-05-31 19:39 [bug#31672] [PATCH 0/2] Add Mame Nicolas Goaziou
  2018-05-31 19:44 ` [bug#31672] [PATCH 1/2] gnu: asio: New variable Nicolas Goaziou
  2018-06-01  3:10 ` [bug#31672] [PATCH 0/2] Add Mame Eric Bavier
@ 2018-06-01 11:27 ` Rutger Helling
  2018-06-02 17:21   ` Nicolas Goaziou
  2 siblings, 1 reply; 12+ messages in thread
From: Rutger Helling @ 2018-06-01 11:27 UTC (permalink / raw)
  To: ericbavier; +Cc: 31672

[-- Attachment #1: Type: text/plain, Size: 145 bytes --]

The patches LGTM and I've succesfully built MAME with them. Unless
there's some specific reason why we can't I think it's fine to include
it.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [bug#31672] [PATCH 0/2] Add Mame
  2018-06-01  3:10 ` [bug#31672] [PATCH 0/2] Add Mame Eric Bavier
@ 2018-06-01 22:05   ` Nicolas Goaziou
  0 siblings, 0 replies; 12+ messages in thread
From: Nicolas Goaziou @ 2018-06-01 22:05 UTC (permalink / raw)
  To: Eric Bavier; +Cc: 31672

Hello,

Eric Bavier <ericbavier@centurylink.net> writes:

> I haven't reviewed the patches properly, but just wondering
> whether/how these patches relate to those posted a while back to add
> MAME and the resulting discussion there.

I'm not the author of the original MAME patch. 

They are also very different (you can compare the current patch with
<https://notabug.org/rain1/pkgs/src/master/rain/mame.scm>)

Regards,

-- 
Nicolas Goaziou                                                0x80A93738

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [bug#31672] [PATCH 0/2] Add Mame
  2018-06-01 11:27 ` Rutger Helling
@ 2018-06-02 17:21   ` Nicolas Goaziou
  2018-06-02 17:57     ` Nicolas Goaziou
  0 siblings, 1 reply; 12+ messages in thread
From: Nicolas Goaziou @ 2018-06-02 17:21 UTC (permalink / raw)
  To: Rutger Helling; +Cc: 31672

[-- Attachment #1: Type: text/plain, Size: 393 bytes --]

Hello,

Rutger Helling <rhelling@mykolab.com> writes:

> The patches LGTM and I've succesfully built MAME with them. Unless
> there's some specific reason why we can't I think it's fine to include
> it.

Great. Thank you.

I'm updating the package with more default settings while waiting for
the "go".


Regards,

-- 
Nicolas Goaziou                                                0x80A93738

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: mame (v2) --]
[-- Type: text/x-diff, Size: 11412 bytes --]

From 8af50f9208db13ae9461ee73112a6505211518d0 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Date: Thu, 31 May 2018 17:08:10 +0200
Subject: [PATCH 2/2] gnu: mame: New variable.

* gnu/packages/emulators.scm (mame): New variable.
---
 gnu/packages/emulators.scm | 193 +++++++++++++++++++++++++++++++++++++
 1 file changed, 193 insertions(+)

diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index c354386bd..e1a742426 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -56,13 +56,19 @@
   #:use-module (gnu packages libedit)
   #:use-module (gnu packages libusb)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages lua)
+  #:use-module (gnu packages maths)
   #:use-module (gnu packages mp3)
+  #:use-module (gnu packages music)
   #:use-module (gnu packages ncurses)
+  #:use-module (gnu packages networking)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages sdl)
+  #:use-module (gnu packages texinfo)
+  #:use-module (gnu packages textutils)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages upnp)
   #:use-module (gnu packages video)
@@ -72,6 +78,7 @@
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
+  #:use-module (gnu packages web)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu))
 
@@ -1167,3 +1174,189 @@ already have their data files.  The clever part about this: ScummVM
 just replaces the executables shipped with the games, allowing you to
 play them on systems for which they were never designed!")
     (license license:gpl2+)))
+
+(define-public mame
+  (package
+    (name "mame")
+    (version "0.198")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/mamedev/mame.git")
+             (commit (apply string-append "mame" (string-split version #\.)))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0kl7qll8d6xlx7bj5920ljs888a6nc1fj2kfw1fz0r8za3m7wiq9"))
+       (modules '((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")))
+           #t))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:make-flags
+       (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"))
+       #:tests? #f                      ;no test in regular release
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (add-after 'build 'build-documentation
+           (lambda _ (invoke "make" "-C" "docs" "man" "info")))
+         (replace 'install
+           ;; Upstream does not provide an installation phase.
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (share (string-append out "/share/mame")))
+               ;; Install data.
+               (for-each (lambda (dir)
+                           (copy-recursively dir (string-append share "/" dir)))
+                         '("artwork" "bgfx" "ctrlr" "hash" "ini" "language"
+                           "plugins" "samples"))
+               (let ((keymaps (string-append share "/keymaps")))
+                 (for-each (lambda (file) (install-file file keymaps))
+                           (find-files "keymaps" ".*LINUX\\.map")))
+               (let ((fonts (string-append share "/fonts")))
+                 (install-file "uismall.bdf" fonts))
+               (install-file "mame64" share)
+               ;; Create "mame" executable.  MAME expects to be called from
+               ;; the directory where the "mame64" directory lives.  Since we
+               ;; cannot afford to do that, we start a sub-shell in the
+               ;; appropriate directory.
+               (let* ((bin (string-append out "/bin"))
+                      (script (string-append bin "/mame")))
+                 (mkdir-p bin)
+                 (with-output-to-file script
+                   (lambda _
+                     (format #t
+                             "#!~a\n~a/mame64 -inipath ~a/mame \"$@\"~%"
+                             (which "sh") share share)))
+                 (chmod script #o555)))
+             #t))
+         (add-after 'install 'install-documentation
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (man (string-append out "/share/man/man1"))
+                    (info (string-append out "/share/info")))
+               (install-file "docs/build/man/MAME.1" man)
+               (install-file "docs/build/texinfo/MAME.info" info))
+             #t))
+         (add-after 'install 'install-ini-file
+           ;; Generate an ini file so as to set some directories (e.g., roms)
+           ;; to a writable location, i.e., "$HOME/.mame/" and "$HOME/mame/".
+           ;; It must be located in the same directory as the executable
+           ;; "mame64", otherwise MAME cannot find it.
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (share (string-append out "/share/mame")))
+               (with-output-to-file (string-append share "/mame.ini")
+                 (lambda _
+                   (format #t
+                           "inipath              $HOME/.mame;.;ini~@
+                            homepath             $HOME/mame~@
+                            rompath              $HOME/mame/roms~@
+                            samplepath           $HOME/mame/samples;samples~@
+                            cheatpath            $HOME/mame/cheat~@
+                            artpath              $HOME/mame/artwork;artwork~@
+                            crosshairpath        $HOME/mame/crosshair~@
+                            snapshot_directory   $HOME/mame/snapshots~@
+                            hashpath             hash~@
+                            fontpath             $HOME/mame/fonts;fonts~@
+                            ctrlrpath            $HOME/mame/ctrlr;ctrlr~@
+                            bgfx_path            bgfx~@
+                            pluginspath          $HOME/mame/plugins;plugins~@
+                            languagepath         language~@
+                            cfg_directory        $HOME/.mame/cfg~@
+                            nvram_directory      $HOME/.mame/nvram~@
+                            input_directory      $HOME/.mame/inp~@
+                            state_directory      $HOME/.mame/sta~@
+                            diff_directory       $HOME/.mame/diff~@
+                            comment_directory    $HOME/.mame/comments~%")))
+               (with-output-to-file (string-append share "/ui.ini")
+                 (lambda _
+                   (format #t
+                           "historypath          $HOME/mame/history~@
+                            categorypath         $HOME/mame/folders~@
+                            cabinets_directory   $HOME/mame/cabinets~@
+                            cpanels_directory    $HOME/mame/cpanel~@
+                            pcbs_directory       $HOME/mame/pcb~@
+                            flyers_directory     $HOME/mame/flyers~@
+                            titles_directory     $HOME/mame/titles~@
+                            ends_directory       $HOME/mame/ends~@
+                            marquees_directory   $HOME/mame/marquees~@
+                            artwork_preview_directory $HOME/mame/artpreview~@
+                            bosses_directory     $HOME/mame/bosses~@
+                            logos_directory      $HOME/mame/logo~@
+                            scores_directory     $HOME/mame/scores~@
+                            versus_directory     $HOME/mame/versus~@
+                            gameover_directory   $HOME/mame/gameover~@
+                            howto_directory      $HOME/mame/howto~@
+                            select_directory     $HOME/mame/select~@
+                            icons_directory      $HOME/mame/icons~@
+                            covers_directory     $HOME/mame/covers~@
+                            ui_path              $HOME/.mame/ui~%")))
+               #t)))
+         (add-after 'install 'install-desktop-file
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (desktop (string-append out "/share/applications"))
+                    (executable (string-append out "/bin/mame")))
+               (mkdir-p desktop)
+               (with-output-to-file (string-append desktop "/mame.desktop")
+                 (lambda _
+                   (format #t
+                           "[Desktop Entry]~@
+                           Name=~a~@
+                           Comment=Multi-purpose emulation framework~@
+                           Exec=~a~@
+                           TryExec=~@*~a~@
+                           Terminal=false~@
+                           Type=Application~@
+                           Categories=Game;Emulator;~@
+                           Keywords=Game;Emulator;Arcade;~%"
+                           ,name executable)))
+               #t))))))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("pugixml" ,pugixml)
+       ("python-sphinx" ,python-sphinx)
+       ("texinfo" ,texinfo)))
+    (inputs
+     `(("alsa-lib" ,alsa-lib)
+       ("asio" ,asio)
+       ("expat" ,expat)
+       ("flac" ,flac)
+       ("fontconfig" ,fontconfig)
+       ("glm" ,glm)
+       ("libjpeg" ,libjpeg-8)    ;jpeg_read_header argument error in libjpeg-9
+       ("libxinerama" ,libxinerama)
+       ("lua" ,lua)
+       ("portaudio" ,portaudio)
+       ("portmidi" ,portmidi)
+       ("python-wrapper" ,python-wrapper)
+       ("qtbase" ,qtbase)
+       ("rapidjson" ,rapidjson)
+       ("sdl" ,(sdl-union (list sdl2 sdl2-ttf)))
+       ("sqlite" ,sqlite)
+       ("utf8proc" ,utf8proc)
+       ("zlib" ,zlib)))
+    (home-page "http://mamedev.org/")
+    (synopsis "Multi-purpose emulation framework")
+    (description "MAME's purpose is to preserve decades of software
+history.  As electronic technology continues to rush forward, MAME
+prevents this important @emph{vintage} software from being lost and
+forgotten.  This is achieved by documenting the hardware and how it
+functions.  The source code to MAME serves as this documentation.")
+    ;; The MAME project as a whole is distributed under the terms of GPL2+.
+    ;; However, over 90% of the files are under Expat license.  Also, artwork,
+    ;; keymaps, languages and samples are under CC0.
+    (license (list license:gpl2+ license:expat license:cc0))))
-- 
2.17.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [bug#31672] [PATCH 0/2] Add Mame
  2018-06-02 17:21   ` Nicolas Goaziou
@ 2018-06-02 17:57     ` Nicolas Goaziou
  2018-06-03 22:22       ` Nicolas Goaziou
  0 siblings, 1 reply; 12+ messages in thread
From: Nicolas Goaziou @ 2018-06-02 17:57 UTC (permalink / raw)
  To: Rutger Helling; +Cc: 31672

Correcting myself,

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> +               ;; Create "mame" executable.  MAME expects to be called from
> +               ;; the directory where the "mame64" directory lives.  Since we
> +               ;; cannot afford to do that, we start a sub-shell in the
> +               ;; appropriate directory.
> +               (let* ((bin (string-append out "/bin"))
> +                      (script (string-append bin "/mame")))
> +                 (mkdir-p bin)
> +                 (with-output-to-file script
> +                   (lambda _
> +                     (format #t
> +                             "#!~a\n~a/mame64 -inipath ~a/mame \"$@\"~%"
> +                             (which "sh") share share)))

Oops. Wrong patch. I meant:

                 (with-output-to-file script
                   (lambda _
                     (format #t
                             "#!~a\n(cd ~a/share/mame && exec ./mame64 \"$@\"~%"
                             (which "sh") share)))

Anyway, this is not totally satisfactory because one cannot use, e.g.,
"mame -createconfig" and have ini files generated in current directory.

I don't know how to fix that issue.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [bug#31672] [PATCH 0/2] Add Mame
  2018-06-02 17:57     ` Nicolas Goaziou
@ 2018-06-03 22:22       ` Nicolas Goaziou
  2018-06-04 15:56         ` Rutger Helling
  2018-06-08 13:32         ` Ludovic Courtès
  0 siblings, 2 replies; 12+ messages in thread
From: Nicolas Goaziou @ 2018-06-03 22:22 UTC (permalink / raw)
  To: Rutger Helling; +Cc: 31672

[-- Attachment #1: Type: text/plain, Size: 286 bytes --]

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Anyway, this is not totally satisfactory because one cannot use, e.g.,
> "mame -createconfig" and have ini files generated in current directory.
>
> I don't know how to fix that issue.

The following may be an acceptable compromise.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Mame (v3) --]
[-- Type: text/x-diff, Size: 11296 bytes --]

From c0c5ec4dcf374f13fc7928053f351f67353e3d6f Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Date: Thu, 31 May 2018 17:08:10 +0200
Subject: [PATCH 2/2] gnu: mame: New variable.

* gnu/packages/emulators.scm (mame): New variable.
---
 gnu/packages/emulators.scm | 191 +++++++++++++++++++++++++++++++++++++
 1 file changed, 191 insertions(+)

diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index c354386bd..7b20e2d0c 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -56,13 +56,19 @@
   #:use-module (gnu packages libedit)
   #:use-module (gnu packages libusb)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages lua)
+  #:use-module (gnu packages maths)
   #:use-module (gnu packages mp3)
+  #:use-module (gnu packages music)
   #:use-module (gnu packages ncurses)
+  #:use-module (gnu packages networking)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages sdl)
+  #:use-module (gnu packages texinfo)
+  #:use-module (gnu packages textutils)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages upnp)
   #:use-module (gnu packages video)
@@ -72,6 +78,7 @@
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
+  #:use-module (gnu packages web)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu))
 
@@ -1167,3 +1174,187 @@ already have their data files.  The clever part about this: ScummVM
 just replaces the executables shipped with the games, allowing you to
 play them on systems for which they were never designed!")
     (license license:gpl2+)))
+
+(define-public mame
+  (package
+    (name "mame")
+    (version "0.198")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/mamedev/mame.git")
+             (commit (apply string-append "mame" (string-split version #\.)))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0kl7qll8d6xlx7bj5920ljs888a6nc1fj2kfw1fz0r8za3m7wiq9"))
+       (modules '((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")))
+           #t))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:make-flags
+       (cons*
+        (string-append "QT_HOME=" (assoc-ref %build-inputs "qtbase"))
+        (string-append "SDL_INI_PATH="
+                       (assoc-ref %outputs "out")
+                       "/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")))
+       #:tests? #f                      ;no test in regular release
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (add-after 'build 'build-documentation
+           (lambda _ (invoke "make" "-C" "docs" "man" "info")))
+         (replace 'install
+           ;; Upstream does not provide an installation phase.
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (share (string-append out "/share/mame")))
+               ;; Install data.
+               (for-each (lambda (dir)
+                           (copy-recursively dir (string-append share "/" dir)))
+                         '("artwork" "bgfx" "ctrlr" "hash" "ini" "language"
+                           "plugins" "samples"))
+               (let ((keymaps (string-append share "/keymaps")))
+                 (for-each (lambda (file) (install-file file keymaps))
+                           (find-files "keymaps" ".*LINUX\\.map")))
+               (let ((fonts (string-append share "/fonts")))
+                 (install-file "uismall.bdf" fonts))
+               (rename-file "mame64" "mame")
+               (install-file "mame" (string-append out "/bin")))
+             #t))
+         (add-after 'install 'install-documentation
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (man (string-append out "/share/man/man1"))
+                    (info (string-append out "/share/info")))
+               (install-file "docs/build/man/MAME.1" man)
+               (install-file "docs/build/texinfo/MAME.info" info))
+             #t))
+         (add-after 'install 'install-ini-file
+           ;; Generate an ini file so as to set some directories (e.g., roms)
+           ;; to a writable location, i.e., "$HOME/.mame/" and "$HOME/mame/".
+           ;;
+           ;; XXX: We need to insert absolute references to the store.  It can
+           ;; be an issue if they leak into user's home directory, e.g., with
+           ;; "mame -createconfig" and the package is later GC'ed.
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (share (string-append out "/share/mame"))
+                    (ini (string-append share "/ini")))
+               (with-output-to-file (string-append ini "/mame.ini")
+                 (lambda _
+                   (format #t
+                           "inipath              $HOME/.mame;~a/ini~@
+                            homepath             $HOME/mame~@
+                            rompath              $HOME/mame/roms~@
+                            samplepath           $HOME/mame/samples;~a/samples~@
+                            cheatpath            $HOME/mame/cheat~@
+                            artpath              $HOME/mame/artwork;~a/artwork~@
+                            crosshairpath        $HOME/mame/crosshair~@
+                            snapshot_directory   $HOME/mame/snapshots~@
+                            hashpath             ~a/hash~@
+                            fontpath             $HOME/mame/fonts;~a/fonts~@
+                            ctrlrpath            $HOME/mame/ctrlr;~a/ctrlr~@
+                            bgfx_path            ~a/bgfx~@
+                            pluginspath          $HOME/mame/plugins;~a/plugins~@
+                            languagepath         ~a/language~@
+                            cfg_directory        $HOME/.mame/cfg~@
+                            nvram_directory      $HOME/.mame/nvram~@
+                            input_directory      $HOME/.mame/inp~@
+                            state_directory      $HOME/.mame/sta~@
+                            diff_directory       $HOME/.mame/diff~@
+                            comment_directory    $HOME/.mame/comments~%"
+                           share share share share share share share share
+                           share)))
+               (with-output-to-file (string-append ini "/ui.ini")
+                 (lambda _
+                   (format #t
+                           "historypath          $HOME/mame/history~@
+                            categorypath         $HOME/mame/folders~@
+                            cabinets_directory   $HOME/mame/cabinets~@
+                            cpanels_directory    $HOME/mame/cpanel~@
+                            pcbs_directory       $HOME/mame/pcb~@
+                            flyers_directory     $HOME/mame/flyers~@
+                            titles_directory     $HOME/mame/titles~@
+                            ends_directory       $HOME/mame/ends~@
+                            marquees_directory   $HOME/mame/marquees~@
+                            artwork_preview_directory $HOME/mame/artpreview~@
+                            bosses_directory     $HOME/mame/bosses~@
+                            logos_directory      $HOME/mame/logo~@
+                            scores_directory     $HOME/mame/scores~@
+                            versus_directory     $HOME/mame/versus~@
+                            gameover_directory   $HOME/mame/gameover~@
+                            howto_directory      $HOME/mame/howto~@
+                            select_directory     $HOME/mame/select~@
+                            icons_directory      $HOME/mame/icons~@
+                            covers_directory     $HOME/mame/covers~@
+                            ui_path              $HOME/.mame/ui~%")))
+               #t)))
+         (add-after 'install 'install-desktop-file
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (desktop (string-append out "/share/applications"))
+                    (executable (string-append out "/bin/mame")))
+               (mkdir-p desktop)
+               (with-output-to-file (string-append desktop "/mame.desktop")
+                 (lambda _
+                   (format #t
+                           "[Desktop Entry]~@
+                           Name=mame~@
+                           Comment=Multi-purpose emulation framework~@
+                           Exec=~a~@
+                           TryExec=~@*~a~@
+                           Terminal=false~@
+                           Type=Application~@
+                           Categories=Game;Emulator;~@
+                           Keywords=Game;Emulator;Arcade;~%"
+                           executable)))
+               #t))))))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("pugixml" ,pugixml)
+       ("python-sphinx" ,python-sphinx)
+       ("texinfo" ,texinfo)))
+    (inputs
+     `(("alsa-lib" ,alsa-lib)
+       ("asio" ,asio)
+       ("expat" ,expat)
+       ("flac" ,flac)
+       ("fontconfig" ,fontconfig)
+       ("glm" ,glm)
+       ("libjpeg" ,libjpeg-8)    ;jpeg_read_header argument error in libjpeg-9
+       ("libxinerama" ,libxinerama)
+       ("lua" ,lua)
+       ("portaudio" ,portaudio)
+       ("portmidi" ,portmidi)
+       ("python-wrapper" ,python-wrapper)
+       ("qtbase" ,qtbase)
+       ("rapidjson" ,rapidjson)
+       ("sdl" ,(sdl-union (list sdl2 sdl2-ttf)))
+       ("sqlite" ,sqlite)
+       ("utf8proc" ,utf8proc)
+       ("zlib" ,zlib)))
+    (home-page "http://mamedev.org/")
+    (synopsis "Multi-purpose emulation framework")
+    (description "MAME's purpose is to preserve decades of software
+history.  As electronic technology continues to rush forward, MAME
+prevents this important @emph{vintage} software from being lost and
+forgotten.  This is achieved by documenting the hardware and how it
+functions.  The source code to MAME serves as this documentation.")
+    ;; The MAME project as a whole is distributed under the terms of GPL2+.
+    ;; However, over 90% of the files are under Expat license.  Also, artwork,
+    ;; keymaps, languages and samples are under CC0.
+    (license (list license:gpl2+ license:expat license:cc0))))
-- 
2.17.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [bug#31672] [PATCH 0/2] Add Mame
  2018-06-03 22:22       ` Nicolas Goaziou
@ 2018-06-04 15:56         ` Rutger Helling
  2018-06-08 13:32         ` Ludovic Courtès
  1 sibling, 0 replies; 12+ messages in thread
From: Rutger Helling @ 2018-06-04 15:56 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: 31672

[-- Attachment #1: Type: text/plain, Size: 514 bytes --]

I can confirm this new version builds fine as well. I think that this is
an acceptable solution too.

On Mon, 04 Jun 2018 00:22:01 +0200
Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:

> Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
> 
> > Anyway, this is not totally satisfactory because one cannot use,
> > e.g., "mame -createconfig" and have ini files generated in current
> > directory.
> >
> > I don't know how to fix that issue.  
> 
> The following may be an acceptable compromise.
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [bug#31672] [PATCH 0/2] Add Mame
  2018-06-03 22:22       ` Nicolas Goaziou
  2018-06-04 15:56         ` Rutger Helling
@ 2018-06-08 13:32         ` Ludovic Courtès
  2018-06-08 22:28           ` bug#31672: " Nicolas Goaziou
  1 sibling, 1 reply; 12+ messages in thread
From: Ludovic Courtès @ 2018-06-08 13:32 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Ricardo Wurmus, 31672, Rutger Helling

Hi Nicolas,

Nicolas Goaziou <mail@nicolasgoaziou.fr> skribis:

>>From c0c5ec4dcf374f13fc7928053f351f67353e3d6f Mon Sep 17 00:00:00 2001
> From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
> Date: Thu, 31 May 2018 17:08:10 +0200
> Subject: [PATCH 2/2] gnu: mame: New variable.
>
> * gnu/packages/emulators.scm (mame): New variable.

We had a lengthy and quite unproductive discussion a while back about
MAME.  As long as it follows the FSDG, it’s OK to include it.

So please make sure it doesn’t include non-free software and does not
download or point users at sites providing non-free software.

If this is OK, and if it actually works ;-), then you can go ahead
and push!

Thank you,
Ludo’.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#31672: [PATCH 0/2] Add Mame
  2018-06-08 13:32         ` Ludovic Courtès
@ 2018-06-08 22:28           ` Nicolas Goaziou
  0 siblings, 0 replies; 12+ messages in thread
From: Nicolas Goaziou @ 2018-06-08 22:28 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Ricardo Wurmus, 31672-done, Rutger Helling

Hello,

ludo@gnu.org (Ludovic Courtès) writes:

> We had a lengthy and quite unproductive discussion a while back about
> MAME.  As long as it follows the FSDG, it’s OK to include it.
>
> So please make sure it doesn’t include non-free software and does not
> download or point users at sites providing non-free software.

I think it is clean.

> If this is OK, and if it actually works ;-), then you can go ahead
> and push!

Pushed as c8b2fd2866c0d68d62c4ce990e0b41a422bd7030. Thank you.

Regards,

-- 
Nicolas Goaziou                                                0x80A93738

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-06-08 22:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-31 19:39 [bug#31672] [PATCH 0/2] Add Mame Nicolas Goaziou
2018-05-31 19:44 ` [bug#31672] [PATCH 1/2] gnu: asio: New variable Nicolas Goaziou
2018-05-31 19:44   ` [bug#31672] [PATCH 2/2] gnu: mame: " Nicolas Goaziou
2018-06-01  3:10 ` [bug#31672] [PATCH 0/2] Add Mame Eric Bavier
2018-06-01 22:05   ` Nicolas Goaziou
2018-06-01 11:27 ` Rutger Helling
2018-06-02 17:21   ` Nicolas Goaziou
2018-06-02 17:57     ` Nicolas Goaziou
2018-06-03 22:22       ` Nicolas Goaziou
2018-06-04 15:56         ` Rutger Helling
2018-06-08 13:32         ` Ludovic Courtès
2018-06-08 22:28           ` bug#31672: " Nicolas Goaziou

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.