[gnome-games/wip/aplazas/example-app-extension: 2/2] Example how to build an extension
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/aplazas/example-app-extension: 2/2] Example how to build an extension
- Date: Tue, 14 Mar 2017 07:18:24 +0000 (UTC)
commit 4190ca8a6b788e1d3ad1994246c4e36853af9fc1
Author: Adrien Plazas <kekun plazas laposte net>
Date: Wed Mar 8 10:09:02 2017 +0100
Example how to build an extension
This creates a directory /app/lib/libretro/extra.d which is a
subdirectory-style extensionpoint called org.gnome.Games.Plugin.
It then adds an extension called org.gnome.Games.Plugin.NonFree.
The contents of this plugin will, if installed, appear in
/app/lib/libretro/extra.d/NonFree
Alternatively we could have made it a non-subdirectory extensionpoint.
Then the NonFree files would have appeared in the exact directory
specified (/app/lib/libretro/extra.d atm), but you can then only have
one plugin.
Note: gnome-games doesn't currently look in this directory, so this
doesn't *quite* work as-is. Its more of an example.
Note2: This requires flatpak from git master
flatpak/libretro-cores/libretro-picodrive.json | 33 +++++++++++++++
flatpak/libretro-cores/picodrive-Makefile.install | 5 ++
flatpak/libretro-cores/picodrive.libretro | 46 +++++++++++++++++++++
flatpak/org.gnome.Games.Plugin.PicoDrive.json | 28 +++++++++++++
flatpak/org.gnome.Games.json | 4 ++
5 files changed, 116 insertions(+), 0 deletions(-)
---
diff --git a/flatpak/libretro-cores/libretro-picodrive.json b/flatpak/libretro-cores/libretro-picodrive.json
new file mode 100644
index 0000000..1dccbf8
--- /dev/null
+++ b/flatpak/libretro-cores/libretro-picodrive.json
@@ -0,0 +1,33 @@
+ {
+ "name": "libretro-picodrive",
+ "no-autogen": true,
+ "rm-configure": true,
+ "make-args": [
+ "--makefile=Makefile.install",
+ "prefix=/app"
+ ],
+ "make-install-args": [
+ "--makefile=Makefile.install",
+ "prefix=/app"
+ ],
+ "post-install": [
+ /* TODO: Send a generic version of that upstream */
+ "mkdir -p /app/lib/libretro/extra.d/PicoDrive",
+ "install -m644 -p picodrive.libretro /app/lib/libretro/extra.d/PicoDrive"
+ ],
+ "sources": [
+ {
+ "type": "git",
+ "url": "https://github.com/libretro/picodrive"
+ },
+ {
+ "type": "file",
+ "path": "libretro-cores/picodrive-Makefile.install",
+ "dest-filename": "Makefile.install"
+ },
+ {
+ "type": "file",
+ "path": "libretro-cores/picodrive.libretro"
+ }
+ ]
+ }
diff --git a/flatpak/libretro-cores/picodrive-Makefile.install
b/flatpak/libretro-cores/picodrive-Makefile.install
new file mode 100644
index 0000000..2af0225
--- /dev/null
+++ b/flatpak/libretro-cores/picodrive-Makefile.install
@@ -0,0 +1,5 @@
+include Makefile.libretro
+
+install:
+ mkdir -p $(DESTDIR)$(prefix)/lib/libretro/extra.d/PicoDrive
+ install -p -m755 picodrive_libretro.so $(DESTDIR)$(prefix)/lib/libretro/extra.d/PicoDrive
diff --git a/flatpak/libretro-cores/picodrive.libretro b/flatpak/libretro-cores/picodrive.libretro
new file mode 100644
index 0000000..8034f3e
--- /dev/null
+++ b/flatpak/libretro-cores/picodrive.libretro
@@ -0,0 +1,46 @@
+[Libretro]
+Type=Emulator
+Version=1.0
+NamePicoDrive
+Module=picodrive_libretro.so
+LibretroVersion=1
+Authors=notaz;fdave;
+License=MAME;
+
+[Platform:MasterSystem]
+MimeType=application/x-sms-rom;
+
+[Platform:Sega32X]
+MimeType=application/x-genesis-32x-rom;
+
+[Platform:SegaCD]
+MimeType=application/x-cue;application/x-sega-cd-rom;
+Firmwares=SegaCDE;SegaCDJ;SegaCDU;
+
+[Platform:SegaCD32X]
+MimeType=application/x-cue;application/x-sega-cd-rom;
+Firmwares=SegaCDE;SegaCDJ;SegaCDU;
+
+[Platform:SegaGenesis]
+MimeType=application/x-genesis-rom;
+
+[Platform:SegaPico]
+MimeType=application/x-sega-pico-rom;
+
+[Firmware:SegaCDE]
+Path=bios_CD_E.bin
+MD5=e66fa1dc5820d254611fdcdba0662372
+SHA-512=b3725b0577260d8e2b12b782869573824741f5cbe09f2bc49fd8b2346229d1b308a9f54ef08177aa26be7a3580fa8317d0426a2ef7f6bb5103ce039c8e25148f
+Mandatory=true
+
+[Firmware:SegaCDJ]
+Path=bios_CD_J.bin
+MD5=2efd74e3232ff260e371b99f84024f7f
+SHA-512=abdaecbc7222392ba4c0c25bc700316ec0a80fcf3e3080a49d6b736fea58e6ec750ac8c477b8ae016c76cf536c1442d834c243fab939d17b856fbc9ed8db8fde
+Mandatory=true
+
+[Firmware:SegaCDU]
+Path=bios_CD_U.bin
+MD5=278a9397d192149e84e820ac621a8edd
+SHA-512=abc4347551b6b8a9b4b913b333c8bc35f47cc85e35be1155c7a7287dad05373d0e497f2b73fde56f7ed43fae6d1287faaed3cbf338700a21396262e4180b9158
+Mandatory=true
diff --git a/flatpak/org.gnome.Games.Plugin.PicoDrive.json b/flatpak/org.gnome.Games.Plugin.PicoDrive.json
new file mode 100644
index 0000000..0227824
--- /dev/null
+++ b/flatpak/org.gnome.Games.Plugin.PicoDrive.json
@@ -0,0 +1,28 @@
+{
+ "id": "org.gnome.Games.LibretroPlugin.PicoDrive",
+ "runtime": "org.gnome.Games",
+ "runtime-version": "master",
+ "build-extension": true,
+ "sdk": "org.gnome.Sdk",
+ "tags": ["nightly"],
+ "finish-args": [
+ /* Needed to find the ROMs */
+ "--filesystem=home:ro"
+ ],
+ "build-options" : {
+ "cflags": "-O2 -g",
+ "cxxflags": "-O2 -g"
+ },
+ "cleanup": ["/include", "/lib/pkgconfig",
+ "/share/pkgconfig", "/share/aclocal",
+ "/man", "/share/man", "/share/gtk-doc",
+ "*.la", "*.a",
+ "/lib/girepository-1.0",
+ "/share/dbus-1", "/share/doc", "/share/gir-1.0"
+ ],
+ "modules": [
+ /* Emulator cores for libretro */
+ "libretro-cores/libretro-picodrive.json"
+ /* End libretro cores */
+ ]
+}
diff --git a/flatpak/org.gnome.Games.json b/flatpak/org.gnome.Games.json
index 6557d9e..d6c98fb 100644
--- a/flatpak/org.gnome.Games.json
+++ b/flatpak/org.gnome.Games.json
@@ -7,6 +7,9 @@
"tags": ["nightly"],
"desktop-file-name-prefix": "(Nightly) ",
"finish-args": [
+ /* Extension point */
+ "--extension=org.gnome.Games.LibretroPlugin=directory=lib/libretro/extra.d",
+ "--extension=org.gnome.Games.LibretroPlugin=subdirectories",
/* X11 + XShm access */
"--share=ipc", "--socket=x11",
/* Wayland access */
@@ -125,6 +128,7 @@
},
{
"name": "gnome-games",
+ "post-install": ["mkdir -p /app/lib/libretro/extra.d"],
"sources": [
{
"type": "git",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]