From mboxrd@z Thu Jan 1 00:00:00 1970 From: taylanbayirli@gmail.com (Taylan Ulrich =?utf-8?Q?Bay=C4=B1rl=C4=B1?= =?utf-8?Q?=2FKammer?=) Subject: Re: [PATCHES] Mupen64Plus Date: Fri, 06 Nov 2015 17:46:53 +0100 Message-ID: <878u6bxegy.fsf@T420.taylan> References: <8737woawim.fsf@T420.taylan> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39893) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZukAE-0004Z9-9i for guix-devel@gnu.org; Fri, 06 Nov 2015 11:47:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZukAC-0000Io-Gg for guix-devel@gnu.org; Fri, 06 Nov 2015 11:46:58 -0500 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]:38356) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZukAC-0000IF-6c for guix-devel@gnu.org; Fri, 06 Nov 2015 11:46:56 -0500 Received: by wmec201 with SMTP id c201so22563539wme.1 for ; Fri, 06 Nov 2015 08:46:55 -0800 (PST) Received: from T420.taylan ([2a02:908:c32:4740:221:ccff:fe66:68f0]) by smtp.gmail.com with ESMTPSA id 20sm3861221wmh.8.2015.11.06.08.46.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Nov 2015 08:46:54 -0800 (PST) In-Reply-To: <8737woawim.fsf@T420.taylan> ("Taylan Ulrich \=\?utf-8\?Q\?\=5C\=22Bay\=C4\=B1rl\=C4\=B1\=2FKammer\=5C\=22\=22's\?\= message of "Mon, 02 Nov 2015 23:04:17 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable taylanbayirli@gmail.com (Taylan Ulrich "Bay=C4=B1rl=C4=B1/Kammer") writes: > These packages need to be used in a somewhat peculiar way: > > - install *both* mupen64plus-core and mupen64plus-ui-console in your > profile, > > - install all the plugins in your profile, > > - in your config file ($XDG_CONFIG_HOME/mupen64plus/mupen64plus.cfg), > set Core/SharedDataPath to $guix_profile/share/mupen64plus, and set > UI-Console/PluginDir to $guix_profile/lib/mupen64plus, > > - specify your input/audio/video/rsp plugins of choice (for video, the > Glide64 ones work well for me, and the HLE one for RSP). > > That yields a working setup. I don't know if I can make it work any > better out of the box (without horrible hacks and/or substantial patches > to the C code) because the whole system seems to assume the existence of > a single "shared data" and a single "plugin" directory, so a user is > best served by installing all preferred mupen64plus-* packages into one > profile and then pointing the data and plugin directories there as > described above. In particular, the -core package needs to be installed > too (despite ui-console already closing over it) because it also > provides a data file without which some things don't work. I now tackled this problem the following way: - mupen64plus-ui-console is the recommended way to install mupen and propagates a basic set of plugins and the core library package (from which a data file is needed; the .so is referenced absolutely so that's not the reason), - the C code of the console UI gets a Guix-specific patch which prints a flashy notice for Guix users when no plugins are found, instructing the user to edit their config so and so. In the future I might provide some proper patches to the C code to take the directory paths from environment variables in addition to the existing mechanisms (CLI flag, .ini file, hardcoded system paths), but for now I think this is good enough. Comments welcome. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0011-gnu-Add-mupen64plus-ui-console.patch >From 6a2d0bc7cc0d27ce3bbee77faa747ff68466306a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?= Date: Mon, 2 Nov 2015 00:39:22 +0100 Subject: [PATCH 11/11] gnu: Add mupen64plus-ui-console. * gnu/packages/games.scm (mupen64plus-ui-console): New variable. * gnu/packages/patches/mupen64plus-ui-console-notice.patch: New file. * gnu-system.am (dist_patch_DATA): Add it. --- gnu-system.am | 1 + gnu/packages/games.scm | 66 ++++++++++++++++++++++ .../patches/mupen64plus-ui-console-notice.patch | 34 +++++++++++ 3 files changed, 101 insertions(+) create mode 100644 gnu/packages/patches/mupen64plus-ui-console-notice.patch diff --git a/gnu-system.am b/gnu-system.am index 946b77e..c27989c 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -568,6 +568,7 @@ dist_patch_DATA = \ gnu/packages/patches/mplayer2-theora-fix.patch \ gnu/packages/patches/module-init-tools-moduledir.patch \ gnu/packages/patches/mumps-build-parallelism.patch \ + gnu/packages/patches/mupen64plus-ui-console-notice.patch \ gnu/packages/patches/mupdf-buildsystem-fix.patch \ gnu/packages/patches/mutt-store-references.patch \ gnu/packages/patches/net-tools-bitrot.patch \ diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index 5830f9d..b867d52 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -1688,6 +1688,72 @@ which is capable of accurately playing many games. This package contains the Z64 video plugin.") (license license:gpl2+))) +(define-public mupen64plus-ui-console + (package + (name "mupen64plus-ui-console") + (version "2.5") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/mupen64plus/mupen64plus-ui-console/archive/" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 "04qkpd8ic7xsgnqz7spl00wxdygf79m7d1k8rabbygjk5lg6p8z2")) + (patches + (list (search-patch "mupen64plus-ui-console-notice.patch"))))) + (build-system gnu-build-system) + (native-inputs + `(("pkg-config" ,pkg-config) + ("which" ,which))) + (inputs + `(("sdl2" ,sdl2))) + ;; Mupen64Plus supports a single data directory and a single plugin + ;; directory in its configuration, yet we need data and plugin files from + ;; a variety of packages. The best way to deal with this is to install + ;; all packages from which data and plugin files are needed into one's + ;; profile, and point the configuration there. Hence, propagate the most + ;; important packages here to save the user from the bother. The patch + ;; mupen64plus-ui-console-notice also gives users instructions on what + ;; they need to do in order to point the configuration to their profile. + (propagated-inputs + `(("mupen64plus-core" ,mupen64plus-core) + ("mupen64plus-audio-sdl" ,mupen64plus-audio-sdl) + ("mupen64plus-input-sdl" ,mupen64plus-input-sdl) + ("mupen64plus-rsp-hle" ,mupen64plus-rsp-hle) + ("mupen64plus-video-glide64" ,mupen64plus-video-glide64) + ("mupen64plus-video-glide64mk2" ,mupen64plus-video-glide64mk2) + ("mupen64plus-video-rice" ,mupen64plus-video-rice))) + (arguments + '(#:phases + (modify-phases %standard-phases + ;; The mupen64plus build system has no configure phase. + (delete 'configure) + ;; Makefile is in a subdirectory. + (add-before + 'build 'cd-to-project-dir + (lambda _ + (chdir "projects/unix")))) + #:make-flags + (let ((out (assoc-ref %outputs "out")) + (m64p (assoc-ref %build-inputs "mupen64plus-core"))) + (list "all" + (string-append "PREFIX=" out) + (string-append "APIDIR=" m64p "/include/mupen64plus") + ;; Trailing slash matters here. + (string-append "COREDIR=" m64p "/lib/"))) + ;; There are no tests. + #:tests? #f)) + (home-page "http://www.mupen64plus.org/") + (synopsis "Mupen64Plus SDL input plugin") + (description + "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator +which is capable of accurately playing many games. This package contains the +command line user interface. Installing this package is the easiest way +towards a working Mupen64Plus for casual users.") + (license license:gpl2+))) + (define-public nestopia-ue (package (name "nestopia-ue") diff --git a/gnu/packages/patches/mupen64plus-ui-console-notice.patch b/gnu/packages/patches/mupen64plus-ui-console-notice.patch new file mode 100644 index 0000000..1d0b4c4 --- /dev/null +++ b/gnu/packages/patches/mupen64plus-ui-console-notice.patch @@ -0,0 +1,34 @@ +Mupen64Plus supports a single data directory and a single plugin directory in +its configuration, yet we need data and plugin files from a variety of +packages. The best way to deal with this is to install all packages from +which data and plugin files are needed into one's profile, and point the +configuration there. Hence, the ui-console package provides propagated inputs +for packages with the most important data and plugin files, and this patch +provides the user instructions on what needs to be done in order to have +Mupen64Plus find the relevant data and plugins. + +--- a/src/plugin.c ++++ b/src/plugin.c +@@ -122,6 +122,22 @@ m64p_error PluginSearchLoad(m64p_handle ConfigUI) + { + const char *plugindir = (*ConfigGetParamString)(ConfigUI, "PluginDir"); + lib_filelist = osal_library_search(plugindir); ++ /* Guix specific */ ++ if (lib_filelist == NULL) ++ { ++ DebugMessage(M64MSG_ERROR, "No plugins found in PluginDir path: %s", plugindir); ++ DebugMessage(M64MSG_ERROR, ++ "\n\n" ++ "*********************************\n" ++ "*** Notice for GNU Guix users ***\n" ++ "*********************************\n" ++ "\n" ++ "You might want to edit your mupen64plus.cfg (in $XDG_CONFIG_HOME by default)\n" ++ "and set SharedDataPath to /path/to/my_guix_profile/share/mupen64plus and\n" ++ "PluginDir to /path/to/my_guix_profile/lib/mupen64plus so that data and plugins\n" ++ "are found.\n" ++ "\n"); ++ } + } + + /* if still no plugins found, search some common system folders */ -- 2.5.0 --=-=-=--