Clone in a terminal:
Commit 562fe6e
Johan Mattsson - 2016-07-14T22:08:23+00:00
562fe6e9d17c25ea2bebb009f7d662c73910a1ebjohan.mattsson.m@gmail.com

Snap package

Changed files (5)

Diff

diff --git a/birdfont/GtkWindow.vala b/birdfont/GtkWindow.valaindex eec31e4..6b75d22 100644--- a/birdfont/GtkWindow.vala+++ b/birdfont/GtkWindow.vala@@ -161,9 +161,14 @@ public class GtkWindow : Gtk.Window, NativeWindow { 		}); 		 		scrollbar.set_visible (false);-		+	 		show_all ();+ 		MainWindow.open_recent_files_tab ();		++#if FREE+		MainWindow.show_license_dialog ();+#endif 	}  	public void window_focus (void* data) {diff --git a/install.py b/install.pyindex 7637820..051c916 100755--- a/install.py+++ b/install.py@@ -131,6 +131,7 @@ elif not options.libdir: 	if platform.dist()[0] == 'Ubuntu' or platform.dist()[0] == 'Debian': 		process = subprocess.Popen(['dpkg-architecture', '-qDEB_HOST_MULTIARCH'], stdout=subprocess.PIPE) 		out, err = process.communicate()+		out = str(out) 		libdir = '/lib/' + out.rstrip ('\n') 	else: 		p = platform.machine()diff --git a/scripts/snap.py b/scripts/snap.pynew file mode 100755index 0000000..dd1b886--- /dev/null+++ b/scripts/snap.py@@ -0,0 +1,37 @@+#!/usr/bin/python3+import version+from optparse import OptionParser++parser = OptionParser()+parser.add_option('-f', '--free', dest='free', action="store_true", help="generate non-commercial version")+(options, args) = parser.parse_args()++template = open('./scripts/snapcraft.yaml', 'r')+yaml = template.read();++if options.free:+	v = version.VERSION + "-free"+else:+	v = version.VERSION++yaml = yaml.replace("VERSION", v)++make_script = open('./build/snapsource/birdfont/Makefile', 'w+')+make_script.write("#Don't edit, the file is generated by a script\n")+make_script.write("all:\n")++if options.free:+    make_script.write ("\t./configure --valac-flags=\"-D FREE\"\n")+else:+    make_script.write ("\t./configure\n")++make_script.write("\t./build.py\n")+make_script.write("""++install:+	./install.py -d $(DESTDIR)+""")++build_script = open('./build/snapcraft.yaml', 'w+')+build_script.write(yaml)+diff --git a/scripts/snap.sh b/scripts/snap.shnew file mode 100755index 0000000..e70b611--- /dev/null+++ b/scripts/snap.sh@@ -0,0 +1,28 @@+#!/bin/sh++SOURCE_DIR="$(pwd)"++rm -rf $SOURCE_DIR/build/snapsource+mkdir -p $SOURCE_DIR/build/snapsource && \+cd $SOURCE_DIR/build/snapsource++if [ -f  birdfont ] ; then+	git pull file:///$SOURCE_DIR+else+	git clone --depth=1 file:///$SOURCE_DIR birdfont+fi++cd $SOURCE_DIR/build/snapsource/birdfont && \+python3 ./scripts/complete_translations.py -t 93 -i && \+cd .. && \+cd .. && \+mkdir -p setup/gui && \+cp ../resources/linux/256x256/birdfont.png setup/gui/icon.png && \+cd .. && \+./scripts/snap.py --free && \+cd build && \+snapcraft snap && \+cd .. && \+./scripts/snap.py && \+cd build && \+snapcraft snapdiff --git a/scripts/snapcraft.yaml b/scripts/snapcraft.yamlnew file mode 100644index 0000000..25e445f--- /dev/null+++ b/scripts/snapcraft.yaml@@ -0,0 +1,39 @@+name: birdfont+version: VERSION+summary: Font editor+description: A font edior which can create TTF, EOT and SVG fonts+confinement: strict++build-packages: [valac, python3, libglib2.0-dev, libgtk-3-dev,+ libwebkit2gtk-3.0-dev, libgee-0.8-dev, libnotify-dev, libsqlite3-dev, + libxmlbird-dev, python-pkg-resources]++apps: +  birdfont: +    command: gtk-launch usr/bin/birdfont+    plugs: [home, gsettings, x11, unity7]++  run: +    command: gtk-launch usr/bin/birdfont+    plugs: [home, gsettings, x11, unity7]++  debug: +    command: gdb usr/bin/birdfont+    plugs: [home, gsettings, x11, unity7]++parts: +  birdfont: +    plugin: make+    source: snapsource/birdfont+    stage-packages:+      - desktop-file-utils+      - gsettings-desktop-schemas+      - libglib2.0-0+      - libwebkit2gtk-3.0-25+      - libgee-0.8-2+      - libnotify4+      - libsqlite3-0+      - libxmlbird1+      - dconf-tools+      - gdb+    after: [desktop/gtk3]

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112