Add initial flatpak support

This commit is contained in:
rderooy 2020-09-16 15:13:45 +02:00
parent 116196c706
commit 9ad4ba3d5f
4 changed files with 133 additions and 2 deletions

View File

@ -1090,6 +1090,7 @@ src/xBRZ/Makefile
include/Makefile
contrib/macos/dosbox-x.plist
contrib/linux/dosbox-x.spec
contrib/linux/dosbox-x.appdata.xml
make-rpm.sh
])
AC_OUTPUT

View File

@ -0,0 +1,94 @@
app-id: com.dosbox_x.DOSBox-X
runtime: org.freedesktop.Platform
runtime-version: '20.08'
sdk: org.freedesktop.Sdk
command: dosbox-x
finish-args: # flatpak permissions
- --device=all # needed for gamepads and serial/parallel
- --share=ipc # needed for X11
- --share=network # needed for networking (NE2000, IPX)
- --socket=x11
#- --socket=wayland # pointless with SDL1
- --socket=pulseaudio
- --filesystem=home
cleanup:
- '/include'
- '/lib/pkgconfig'
- '/share/aclocal'
- '/share/man'
- '*.la'
- '*.a'
- '/share/doc'
modules:
# Build Mesa / GLU
- name: GLU
config-opts:
- --disable-static
sources:
- type: archive
url: https://mesa.freedesktop.org/archive/glu/glu-9.0.1.tar.xz
sha256: fb5a4c2dd6ba6d1c21ab7c05129b0769544e1d68e1e3b0ffecb18e73c93055bc
cleanup:
- /include
- /lib/*.a
- /lib/*.la
- /lib/pkgconfig
# Build final FluidSynth 1.x release
# FluidSynth 2.x causes "checking for fluid_synth_sysex in -lfluidsynth... no"
- name: FluidSynth
buildsystem: cmake-ninja
config-opts:
- -DLIB_SUFFIX=
cleanup:
- /bin
- /include
- /lib/pkgconfig
- /share/man
- "*.so"
sources:
- type: archive
url: https://github.com/FluidSynth/fluidsynth/archive/v1.1.11.tar.gz
sha256: da8878ff374d12392eecf87e96bad8711b8e76a154c25a571dd8614d1af80de8
# Build libpcap for NE2000 (and run setcap at the end)
- name: libpcap
cleanup:
- "/include"
- "/share"
- "/lib/pkgconfig"
sources:
- type: archive
url: https://www.tcpdump.org/release/libpcap-1.9.1.tar.gz
sha256: 635237637c5b619bcceba91900666b64d56ecb7be63f298f601ec786ce087094
# Build DOSBox-X
- name: dosbox-x
rm-configure: true
sources:
- type: dir
path: ../..
- type: file
path: ../icons/dosbox-x.svg
- type: file
path: dosbox-x.appdata.xml
- type: file
path: dosbox-x.desktop
buildsystem: simple
build-commands:
# We need to first build the included (modified) SDL1, otherwise the build will fail
- cd vs2015/sdl ; ./build-dosbox.sh
# Build the SDL1 debugger enabled version of DOSBox-X
- ./build-debug
post-install:
- install -D src/dosbox-x /app/bin/dosbox-x
# - setcap cap_net_raw+ep /app/bin/dosbox-x # fails due to needing root permission
- install -Dm644 dosbox-x.svg /app/share/icons/hicolor/scalable/apps/${FLATPAK_ID}.svg
- install -Dm644 dosbox-x.appdata.xml /app/share/metainfo/${FLATPAK_ID}.appdata.xml
- install -Dm644 dosbox-x.desktop /app/share/applications/${FLATPAK_ID}.desktop
- sed -i s/Icon=.*/Icon=com.dosbox_x.DOSBox-X/ /app/share/applications/${FLATPAK_ID}.desktop

View File

@ -1,17 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2020 Jonathan Campbell -->
<component type="desktop">
<id>dosbox-x.desktop</id>
<project_license>GPL-2.0</project_license>
<metadata_license>CC0-1.0</metadata_license>
<name>DOSBox-X</name>
<summary>x86/DOS emulator with sound and graphics</summary>
<categories>
<category>Emulation</category>
</categories>
<releases>
<release version="@PACKAGE_VERSION@" date="2020-9-15"/>
</releases>
<screenshots>
<screenshot/>
</screenshots>
<content_rating type="oars-1.1" />
<translation/>
<update_contact>noreply@example.com</update_contact>
<description>
<p>
DOSBox-X is a cross-platform DOS emulator based on DOSBox-X. It aims to be a complete and accurate DOS
DOSBox-X is a cross-platform DOS emulator based on DOSBox. It aims to be a complete and accurate DOS
emulation package, including the ability to run Windows 95 and 98. It also adds support for the NEC PC-98.
</p>
<p>
DOSBox-X emulates a legacy IBM PC and DOS environment, and has many emulation options and features such as:
</p>
<ul>
<li>8086, 286, 386, 486, Pentium, Pentium MMX and Pentium Pro CPU options</li>
<li>Mounting host directory, Harddisk Images, Diskette Images and CD-ROM images</li>
@ -24,7 +38,7 @@
<li>Support for running Windows 3.1, Windows 95 and Windows 98</li>
</ul>
With the help of DOSBox-X, it can run plenty of the old classics that don't run on your new computer!
</p>
</description>
<url type="homepage">https://www.dosbox-x.com</url>
<url type="wiki">https://github.com/joncampbell123/dosbox-x/wiki</url>
</component>

View File

@ -22,3 +22,25 @@ print X "#define GIT_COMMIT_HASH \"$commit\"\n";
print X "#define COPYRIGHT_END_YEAR \"$year\"\n";
close(X);
# why perl....
use strict;
use warnings;
my $file = "contrib/linux/dosbox-x.appdata.xml.in";
open FILE, $file or die "Can't read from $file!\n";
my @lines;
while (my $line = <FILE>) {
if ($line =~ /date=/) {
push @lines, (" <release version=\"\@PACKAGE_VERSION\@\" date=\"" . $year . "-" . $mon . "-" . $mday . "\"/>\n");
} elsif ($line =~ /<!-- Copyright/) {
push @lines, ("<!-- Copyright $year Jonathan Campbell -->\n");
} else {
push @lines, $line;
}
}
close FILE;
open FILE, '>', $file or die "Can't write to $file!\n";
print FILE @lines;
close FILE;