Flatpak building optimizations

parent d03b7716
......@@ -14,3 +14,7 @@ Cargo.lock
bin/
*.snap
# For the flatpak
.flatpak-builder/
flatpak
# Install to /usr unless otherwise specified, such as `make PREFIX=/app`
PREFIX=/usr
# What to run to install various files
INSTALL=install
# Run to install the actual binary
INSTALL_PROGRAM=$(INSTALL)
# Run to install application data, with differing permissions
INSTALL_DATA=$(INSTALL) -m 644
# Directories into which to install the various files
bindir=$(DESTDIR)$(PREFIX)/bin
sharedir=$(DESTDIR)$(PREFIX)/share
# These targets have no associated build files.
.PHONY : clean clean-all install uninstall
# Build the application
......@@ -6,16 +21,27 @@ target/release/gdiceroller : src
# Install onto the system
install : target/release/gdiceroller
cp data/codes.nora.gdiceroller.desktop /usr/share/applications/codes.nora.gdiceroller.desktop
mkdir -p /usr/share/icons/hicolor/codes.nora.gdiceroller/scalable/
cp data/codes.nora.gdiceroller.svg /usr/share/icons/hicolor/scalable/apps/codes.nora.gdiceroller.svg
cp target/release/gdiceroller /usr/bin/codes.nora.gdiceroller
# Install binary
$(INSTALL_PROGRAM) target/release/gdiceroller $(bindir)/codes.nora.gdiceroller
# Install icon
$(INSTALL_DATA) data/codes.nora.gdiceroller.svg $(sharedir)/icons/hicolor/scalable/apps/codes.nora.gdiceroller.svg
touch $(sharedir)/icons/hicolor
# Install desktop file
$(INSTALL_DATA) data/codes.nora.gdiceroller.desktop $(sharedir)/applications/codes.nora.gdiceroller.desktop
# Remove an existing install from the system
uninstall :
rm -f /usr/share/applications/codes.nora.gdiceroller.desktop
rm -f /usr/share/icons/hicolor/scalable/apps/codes.nora.gdiceroller.svg
rm -f /usr/bin/codes.nora.gdiceroller
# Remove the desktop file
rm -f $(sharedir)/applications/codes.nora.gdiceroller.desktop
# Remove the icon
rm -f $(sharedir)/icons/hicolor/scalable/apps/codes.nora.gdiceroller.svg
# Remove the binary
rm -f $(bindir)/bin/codes.nora.gdiceroller
# Build a Flatpak package
flatpak : target/release/gdiceroller
mkdir -p flatpak
flatpak-builder flatpak data/codes.nora.gdiceroller.json
# Remove all files
clean-all : clean
......@@ -23,5 +49,6 @@ clean-all : clean
# Remove supplemental build files
clean :
rm -rf snap/
rm -rf flatpak/
rm -rf snap/ *.snap
{
"app-id" : "codes.nora.gdiceroller",
"runtime" : "org.gnome.Platform",
"runtime-version" : "master",
"sdk" : "org.gnome.Sdk",
"sdk-extensions" : [
"org.freedesktop.Sdk.Extension.rust-stable"
],
"command" : "gdiceroller",
"tags" : [
"nightly"
],
"desktop-file-name-suffix" : " ☢️",
"finish-args" : [
"--socket=x11",
"--socket=wayland",
"--socket=pulseaudio",
"--device=dri"
],
"build-options" : {
"append-path" : "/usr/lib/sdk/rust-stable/bin",
"build-args" : [
"--share=network"
],
"env" : {
"CARGO_HOME" : "/run/build/gdiceroller/cargo",
"RUSTFLAGS" : "--error-format=short --remap-path-prefix =../",
"RUST_BACKTRACE" : "1"
}
},
"modules" : [
{
"name" : "gdiceroller",
"buildsystem" : "simple",
"build-commands": [
"make",
"make install PREFIX=/app"
],
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/NoraCodes/gdiceroller.git"
}
]
}
]
}
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>sm.puri.hellorustgtk.desktop</id>
<name>HelloRustGTK</name>
<project_license>GPL-3.0</project_license>
<metadata_license>CC0-1.0</metadata_license>
<developer_name>Thomas Markiewicz</developer_name>
<summary>Rust GTK flatpak template app</summary>
<url type="homepage">https://source.puri.sm/ThomasMarkiewicz/HelloRustGTK</url>
<description>
<p>
Rust GTK flatpak template app
</p>
</description>
<!-- <screenshots>
<screenshot type="default">
<image type="source">https://gitlab.gnome.org/World/fractal/raw/master/screenshots/fractal.png</image>
</screenshot>
</screenshots> -->
<releases>
<release version="0.1.0" date="2019-02-01"/>
</releases>
<update_contact>thomas.markiewicz@puri.sm</update_contact>
<content_rating type="oars-1.0">
<content_attribute id="violence-cartoon">none</content_attribute>
<content_attribute id="violence-fantasy">none</content_attribute>
<content_attribute id="violence-realistic">none</content_attribute>
<content_attribute id="violence-bloodshed">none</content_attribute>
<content_attribute id="violence-sexual">none</content_attribute>
<content_attribute id="drugs-alcohol">none</content_attribute>
<content_attribute id="drugs-narcotics">none</content_attribute>
<content_attribute id="drugs-tobacco">none</content_attribute>
<content_attribute id="sex-nudity">none</content_attribute>
<content_attribute id="sex-themes">none</content_attribute>
<content_attribute id="language-profanity">none</content_attribute>
<content_attribute id="language-humor">none</content_attribute>
<content_attribute id="language-discrimination">none</content_attribute>
<content_attribute id="social-chat">intense</content_attribute>
<content_attribute id="social-info">none</content_attribute>
<content_attribute id="social-audio">moderate</content_attribute>
<content_attribute id="social-location">none</content_attribute>
<content_attribute id="social-contacts">none</content_attribute>
<content_attribute id="money-purchasing">none</content_attribute>
<content_attribute id="money-gambling">none</content_attribute>
</content_rating>
</component>
Source: codes.nora.gdiceroller
Section: web
Priority: important
Maintainer: Leonora Tindall <nora@nora.codes>
Build-Depends:
Standards-Version: 3.8.4
Homepage: http://www.gnu.org/software/wget/
Package: wget
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: retrieves files from the web
Wget is a network utility to retrieve files from the Web
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment