From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39371) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPAEA-000475-CU for guix-patches@gnu.org; Sat, 02 Jun 2018 13:22:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fPAE6-0006ya-7j for guix-patches@gnu.org; Sat, 02 Jun 2018 13:22:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:51619) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fPAE6-0006yV-0q for guix-patches@gnu.org; Sat, 02 Jun 2018 13:22:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fPAE5-0005ux-Nd for guix-patches@gnu.org; Sat, 02 Jun 2018 13:22:01 -0400 Subject: [bug#31672] [PATCH 0/2] Add Mame Resent-Message-ID: From: Nicolas Goaziou In-Reply-To: <20180601132729.64064a84@mykolab.com> (Rutger Helling's message of "Fri, 1 Jun 2018 13:27:29 +0200") References: <20180601132729.64064a84@mykolab.com> Date: Sat, 02 Jun 2018 19:21:07 +0200 Message-ID: <87muwd85q4.fsf@nicolasgoaziou.fr> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Rutger Helling Cc: 31672@debbugs.gnu.org --=-=-= Content-Type: text/plain Hello, Rutger Helling 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 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0002-gnu-mame-New-variable.patch Content-Description: mame (v2) >From 8af50f9208db13ae9461ee73112a6505211518d0 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou 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 --=-=-=--