The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Snap package

These changes was commited to the Birdfont repository Thu, 14 Jul 2016 15:02:08 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Thu, 14 Jul 2016 15:02:08 +0000]

Updated Files

birdfont/GtkWindow.vala
install.py
scripts/snap.py
scripts/snap.sh
scripts/snapcraft.yaml
--- a/birdfont/GtkWindow.vala +++ b/birdfont/GtkWindow.vala @@ -161,9 +161,14 @@ }); scrollbar.set_visible (false); - + show_all (); + MainWindow.open_recent_files_tab (); + + #if FREE + MainWindow.show_license_dialog (); + #endif } public void window_focus (void* data) {
--- a/install.py +++ b/install.py @@ -131,6 +131,7 @@ 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 scripts/snap.py(new)
--- /dev/null +++ b/scripts/snap.py @@ -1,1 +1,38 @@ + #!/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 scripts/snap.sh(new)
--- /dev/null +++ b/scripts/snap.sh @@ -1,1 +1,29 @@ + #!/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 snap
diff --git scripts/snapcraft.yaml(new)
--- /dev/null +++ b/scripts/snapcraft.yaml @@ -1,1 +1,40 @@ + 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]