[gnome-games/wip/alex/example-app-extension: 2/2] Example how to build an extension
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/alex/example-app-extension: 2/2] Example how to build an extension
- Date: Wed, 8 Mar 2017 11:27:17 +0000 (UTC)
commit 4a16d7d80e68a81b37bd7479404a4add62db65a6
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 | 36 +++++++++++++++++++++
flatpak/org.gnome.Games.Plugin.NonFree.json | 28 ++++++++++++++++
flatpak/org.gnome.Games.json | 4 ++
5 files changed, 106 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..3a3d230
--- /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 that upstream */
+ "mkdir -p /app/lib/libretro/extra.d/NonFree",
+ "install -m644 -p picodrive.libretro /app/lib/libretro/extra.d/NonFree"
+ ],
+ "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..23e3028
--- /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/NonFree
+ install -p -m755 picodrive_libretro.so $(DESTDIR)$(prefix)/lib/libretro/extra.d/NonFree
diff --git a/flatpak/libretro-cores/picodrive.libretro b/flatpak/libretro-cores/picodrive.libretro
new file mode 100644
index 0000000..888b268
--- /dev/null
+++ b/flatpak/libretro-cores/picodrive.libretro
@@ -0,0 +1,36 @@
+[Libretro]
+Type=Emulator
+Version=1.0
+NamePicoDrive
+Module=picodrive_libretro.so
+LibretroVersion=1
+Authors=notaz;fdave;
+License=MAME;
+
+[Platform:SegaGenesis]
+MimeType=application/x-genesis-rom;
+
+[Platform:Sega32X]
+MimeType=application/x-genesis-32x-rom;
+
+[Platform:SegaCD]
+MimeType=application/x-cue;application/x-sega-cd-rom;
+Firmwares=SegaCDE;SegaCDJ;SegaCDU;
+
+[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.NonFree.json b/flatpak/org.gnome.Games.Plugin.NonFree.json
new file mode 100644
index 0000000..e68b6df
--- /dev/null
+++ b/flatpak/org.gnome.Games.Plugin.NonFree.json
@@ -0,0 +1,28 @@
+{
+ "id": "org.gnome.Games.Plugin.NonFree",
+ "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 95cf648..0d60b6f 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.Plugin=directory=lib/libretro/extra.d",
+ "--extension=org.gnome.Games.Plugin=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]