Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add necessary files for building a Snap package #752

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Packaging/snap/gui/devilutionx.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Desktop Entry]
Name=DevilutionX
GenericName=DevilutionX
Comment=Play Diablo I on Linux
Comment[da]=Spil Diablo I på Linux
Comment[de]=Spiele Diablo I unter Linux
Comment[hr]=Igrajte Diablo I na Linuxu
Exec=devilutionx
Icon=${SNAP}/meta/gui/devilutionx.png
Terminal=false
Type=Application
X-DCOP-ServiceType=Multi
X-KDE-StartupNotify=true
Categories=Game;RolePlaying;
Binary file added Packaging/snap/gui/devilutionx.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions Packaging/snap/local/patches/001-missing-diabdat-notice.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--- Source/appfat.cpp
+++ Source/appfat.cpp
@@ -139,7 +139,10 @@ void InsertCDDlg(const char *fileName)
1024,
"Unable to open %s.\n"
"\n"
- "Make sure that it is in the game folder and that the file name is in all lowercase.",
+ "Make sure that it is in the game folder and that the file name is in all lowercase.\n"
+ "\n"
+ "Please copy the file diabdat.mpq from your Diablo game disc or from the GOG \n"
+ "installer to the directory ~/snap/devilutionx/common/",
fileName);

UiErrorOkDialog("Data File Error", text);
84 changes: 84 additions & 0 deletions Packaging/snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: devilutionx
base: core18
adopt-info: devilutionx
summary: DevilutionX - Diablo build for modern operating systems
description: |
DevilutionX is a reimplementation of Blizzard's Diablo 1,
developed by careful and deep analysis of the original game files.

This allows you to play Diablo 1 on a wide variety of operating systems,
including GNU/Linux.

Even though DevilutionX is an open source project, the Diablo 1 game files
are not free and protected by Blizzard's copyright.

Therefore, you need to provide your own legitimate copy of the game.
confinement: strict
grade: stable

apps:
devilutionx:
command: desktop-launch $SNAP/usr/bin/devilutionx --data-dir $SNAP_USER_COMMON
plugs:
- x11
- wayland
- unity7
- opengl
- audio-playback
- joystick
- network
- network-bind

environment:
XDG_DATA_HOME: $SNAP_USER_COMMON/
DBUS_FATAL_WARNINGS: 0

layout:
/usr/share/fonts/truetype:
bind: $SNAP/usr/share/fonts/truetype

parts:
devilutionx:
plugin: cmake
after: [patches,desktop-glib-only]
source: https://github.com/diasurgical/devilutionx.git
source-type: git
configflags:
- '-DCMAKE_INSTALL_PREFIX=/usr'
- '-DBINARY_RELEASE=ON'
override-build: |
patch -l --binary -d$SNAPCRAFT_PART_SRC -p0 -i $SNAPCRAFT_STAGE/patches/001-missing-diabdat-notice.patch
snapcraftctl set-version "$(git -C $SNAPCRAFT_PART_SRC describe --tags)"
snapcraftctl build

build-packages:
- cmake
- g++
- libsdl2-dev
- libsdl2-mixer-dev
- libsdl2-ttf-dev
- libsodium-dev

stage-packages:
- libstdc++6
- libgl1-mesa-dri
- libgl1-mesa-glx
- libglu1-mesa
- libwayland-egl1-mesa
- libsdl2-2.0-0
- libsdl2-mixer-2.0-0
- libsdl2-ttf-2.0-0

patches:
source: snap/local/
plugin: dump

desktop-glib-only:
source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
source-subdir: glib-only
plugin: make
build-packages:
- libglib2.0-dev
stage-packages:
- libglib2.0-bin