From 520eed9efe77d48d6544dc57a8e0a35afee56d32 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Sun, 28 Jul 2019 19:01:37 -0700 Subject: [PATCH 01/24] Rename App ID to fit within freedesktop guidelines Previously the app used "writeas-gtk" as the app id. This was invalid according to freedesktop specifications. See https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-id-generic for details on what an App ID should be. --- ...=> com.abunchtell.WriteAsDesktop.appdata.xml.in} | 0 ....in => com.abunchtell.WriteAsDesktop.desktop.in} | 0 ...as-gtk.png => com.abunchtell.WriteAsDesktop.png} | Bin ...as-gtk.png => com.abunchtell.WriteAsDesktop.png} | Bin ...as-gtk.png => com.abunchtell.WriteAsDesktop.png} | Bin ...as-gtk.png => com.abunchtell.WriteAsDesktop.png} | Bin ...as-gtk.png => com.abunchtell.WriteAsDesktop.png} | Bin ...as-gtk.png => com.abunchtell.WriteAsDesktop.png} | Bin data/meson.build | 6 +++--- meson.build | 2 +- src/application.vala | 2 +- src/meson.build | 8 +++++++- 12 files changed, 12 insertions(+), 6 deletions(-) rename data/{writeas-gtk.appdata.xml.in => com.abunchtell.WriteAsDesktop.appdata.xml.in} (100%) rename data/{writeas-gtk.desktop.in => com.abunchtell.WriteAsDesktop.desktop.in} (100%) rename data/icons/128/{writeas-gtk.png => com.abunchtell.WriteAsDesktop.png} (100%) rename data/icons/16/{writeas-gtk.png => com.abunchtell.WriteAsDesktop.png} (100%) rename data/icons/24/{writeas-gtk.png => com.abunchtell.WriteAsDesktop.png} (100%) rename data/icons/32/{writeas-gtk.png => com.abunchtell.WriteAsDesktop.png} (100%) rename data/icons/48/{writeas-gtk.png => com.abunchtell.WriteAsDesktop.png} (100%) rename data/icons/64/{writeas-gtk.png => com.abunchtell.WriteAsDesktop.png} (100%) diff --git a/data/writeas-gtk.appdata.xml.in b/data/com.abunchtell.WriteAsDesktop.appdata.xml.in similarity index 100% rename from data/writeas-gtk.appdata.xml.in rename to data/com.abunchtell.WriteAsDesktop.appdata.xml.in diff --git a/data/writeas-gtk.desktop.in b/data/com.abunchtell.WriteAsDesktop.desktop.in similarity index 100% rename from data/writeas-gtk.desktop.in rename to data/com.abunchtell.WriteAsDesktop.desktop.in diff --git a/data/icons/128/writeas-gtk.png b/data/icons/128/com.abunchtell.WriteAsDesktop.png similarity index 100% rename from data/icons/128/writeas-gtk.png rename to data/icons/128/com.abunchtell.WriteAsDesktop.png diff --git a/data/icons/16/writeas-gtk.png b/data/icons/16/com.abunchtell.WriteAsDesktop.png similarity index 100% rename from data/icons/16/writeas-gtk.png rename to data/icons/16/com.abunchtell.WriteAsDesktop.png diff --git a/data/icons/24/writeas-gtk.png b/data/icons/24/com.abunchtell.WriteAsDesktop.png similarity index 100% rename from data/icons/24/writeas-gtk.png rename to data/icons/24/com.abunchtell.WriteAsDesktop.png diff --git a/data/icons/32/writeas-gtk.png b/data/icons/32/com.abunchtell.WriteAsDesktop.png similarity index 100% rename from data/icons/32/writeas-gtk.png rename to data/icons/32/com.abunchtell.WriteAsDesktop.png diff --git a/data/icons/48/writeas-gtk.png b/data/icons/48/com.abunchtell.WriteAsDesktop.png similarity index 100% rename from data/icons/48/writeas-gtk.png rename to data/icons/48/com.abunchtell.WriteAsDesktop.png diff --git a/data/icons/64/writeas-gtk.png b/data/icons/64/com.abunchtell.WriteAsDesktop.png similarity index 100% rename from data/icons/64/writeas-gtk.png rename to data/icons/64/com.abunchtell.WriteAsDesktop.png diff --git a/data/meson.build b/data/meson.build index 73b7444..be9fec1 100644 --- a/data/meson.build +++ b/data/meson.build @@ -2,7 +2,7 @@ icon_sizes = ['16', '24', '32', '48', '64', '128'] foreach i : icon_sizes install_data( - join_paths('icons', i, meson.project_name() + '.png'), + join_paths('icons', i, 'com.abunchtell.WriteAsDesktop.png'), install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', i + 'x' + i, 'apps'), rename: '@0@.png'.format(app_id) ) @@ -11,13 +11,13 @@ endforeach data_conf = configuration_data() data_conf.set('app_id', app_id) configure_file( - input: 'writeas-gtk.desktop.in', + input: 'com.abunchtell.WriteAsDesktop.desktop.in', output: '@0@.desktop'.format(app_id), configuration: data_conf, install_dir: join_paths(get_option('datadir'), 'applications') ) configure_file( - input: 'writeas-gtk.appdata.xml.in', + input: 'com.abunchtell.WriteAsDesktop.appdata.xml.in', output: '@0@.appdata.xml'.format(app_id), configuration: data_conf, install_dir: join_paths(get_option('datadir'), 'metainfo') diff --git a/meson.build b/meson.build index 00b1074..23a648f 100644 --- a/meson.build +++ b/meson.build @@ -9,7 +9,7 @@ build_platform = get_option('platform') if build_platform == 'elementary' app_id = 'com.github.writeas.writeas-gtk' else - app_id = 'writeas-gtk' + app_id = 'com.abunchtell.WriteAsDesktop' endif conf = configuration_data() diff --git a/src/application.vala b/src/application.vala index 848daa9..c77e3c9 100644 --- a/src/application.vala +++ b/src/application.vala @@ -26,7 +26,7 @@ public class WriteAs.Application : Gtk.Application { Intl.setlocale(LocaleCategory.ALL, ""); Intl.textdomain("write.as"); - application_id = APP_ID + ".desktop"; + application_id = APP_ID; } public override void activate() { diff --git a/src/meson.build b/src/meson.build index 75de727..6e68eae 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,4 +1,10 @@ -executable(app_id, +if build_platform == 'elementary' + executable = 'com.github.writeas.writeas-gtk' +else + executable = 'writeas-gtk' +endif + +executable(executable, 'application.vala', 'window.vala', 'Granite/Accels.vala', From 2df7d612f2114936ef1ee0bf3887ec593b33d7fc Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Thu, 1 Aug 2019 12:10:09 -0700 Subject: [PATCH 02/24] flatpak: Create flatpak manifest Creates a flatpak manifest to build the app. Does not yet build the writeas-cli. Related to T663 --- flatpak/com.abunchtell.WriteAsDesktop.json | 73 ++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 flatpak/com.abunchtell.WriteAsDesktop.json diff --git a/flatpak/com.abunchtell.WriteAsDesktop.json b/flatpak/com.abunchtell.WriteAsDesktop.json new file mode 100644 index 0000000..b1a3073 --- /dev/null +++ b/flatpak/com.abunchtell.WriteAsDesktop.json @@ -0,0 +1,73 @@ +{ + "app-id": "com.abunchtell.WriteAsDesktop", + "base": "io.elementary.BaseApp", + "base-version": "juno", + "runtime": "org.gnome.Platform", + "runtime-version": "3.32", + "sdk": "org.gnome.Sdk", + "sdk-extensions": [ + "org.freedesktop.Sdk.Extension.golang" + ], + "command": "writeas-gtk", + "finish-args": [ + "--socket=wayland", + "--share=ipc", + "--socket=x11", + "--device=dri", + "--share=network" + ], + "build-options": { + "append-path": "/usr/lib/sdk/golang/bin/", + "build-args" : [ + "--share=network" + ], + "env": { + "GOPATH": "/run/build/go" + } + }, + "modules": [ + { + "name": "gb", + "buildsystem": "simple", + "build-commands": [ + "/usr/lib/sdk/golang/enable.sh; env GOPATH=\"$(pwd)\" go build github.com/constabulary/gb/cmd/gb", + "install -Dm0755 -t /app/bin gb" + ], + "sources": [ + { + "type": "git", + "url": "https://github.com/pkg/errors.git", + "dest": "src/github.com/pkg/errors" + }, + { + "type": "git", + "url": "https://github.com/constabulary/gb.git", + "dest": "src/github.com/constabulary/gb" + } + ] + }, + { + "name": "gtksourceview3", + "config-opts" : [ + "--disable-Werror" + ], + "sources": [ + { + "type": "git", + "url": "https://gitlab.gnome.org/GNOME/gtksourceview.git", + "branch": "gnome-3-24" + } + ] + }, + { + "name": "writeas-gtk", + "buildsystem": "meson", + "sources": [ + { + "type": "git", + "url": "https://github.com/writeas/writeas-gtk.git" + } + ] + } + ] +} From aced5b5617956a693dd172f760978b8539e794b9 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Thu, 1 Aug 2019 12:11:44 -0700 Subject: [PATCH 03/24] gitignore: Add common build directories from flatpak These are the directories flatpak can create while building an app. Since they should not be committed, they belong in the gitignore. --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index ca6cfcb..3aa443e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ *~ build +_build/ +.flatpak-builder/ .ninja_* build.ninja data/writeas From de4ed79693365a06c16f336b1e466794904a2b38 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Thu, 1 Aug 2019 14:51:41 -0700 Subject: [PATCH 04/24] build: Rework cli script setup for flatpak Flatpak doesn't support running extra commands, so we need to make the cli build it's own target. This is made optional since the cli doesn't always need to be shipped with the app. Related to T663 --- .gitignore | 4 ++++ debian/control | 2 +- debian/rules | 4 +--- flatpak/com.abunchtell.WriteAsDesktop.json | 5 ++++- meson.build | 4 ++-- meson/build-cli.sh | 5 +++++ meson_options.txt | 1 + src/meson.build | 18 ++++++++++++++++++ 8 files changed, 36 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 3aa443e..3b2ab93 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,7 @@ _build/ .ninja_* build.ninja data/writeas + +# Files generated by gb +pkg/ +bin/ diff --git a/debian/control b/debian/control index a849fba..8e65d76 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: com.github.writeas.writeas-gtk Section: x11 Priority: extra Maintainer: Write.as -Build-Depends: meson, +Build-Depends: meson (>= 0.48), debhelper (>= 9), libgtk-3-dev, libgtksourceview-3.0-dev, diff --git a/debian/rules b/debian/rules index d3fbd4c..8c29f48 100755 --- a/debian/rules +++ b/debian/rules @@ -19,7 +19,7 @@ override_dh_auto_clean: override_dh_auto_configure: mkdir -p debian/build - cd debian/build && meson --prefix=/usr ../.. -Dplatform=elementary + cd debian/build && meson --prefix=/usr ../.. -Dplatform=elementary -Dauto_build_cli=true override_dh_auto_build: cd debian/build && ninja -v && ninja build @@ -29,5 +29,3 @@ override_dh_auto_test: override_dh_auto_install: cd debian/build && DESTDIR=${CURDIR}/debian/com.github.writeas.writeas-gtk ninja install - mkdir -p debian/com.github.writeas.writeas-gtk/usr/bin - cp bin/writeas debian/com.github.writeas.writeas-gtk/usr/bin/ diff --git a/flatpak/com.abunchtell.WriteAsDesktop.json b/flatpak/com.abunchtell.WriteAsDesktop.json index b1a3073..29889e0 100644 --- a/flatpak/com.abunchtell.WriteAsDesktop.json +++ b/flatpak/com.abunchtell.WriteAsDesktop.json @@ -22,7 +22,7 @@ "--share=network" ], "env": { - "GOPATH": "/run/build/go" + "GOROOT": "/usr/lib/sdk/golang/" } }, "modules": [ @@ -62,6 +62,9 @@ { "name": "writeas-gtk", "buildsystem": "meson", + "config-opts": [ + "-Dauto_build_cli=true" + ], "sources": [ { "type": "git", diff --git a/meson.build b/meson.build index 23a648f..6fd8d7c 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project('writeas-gtk', ['vala', 'c'], version: '1.0.2', license: 'GPL', - meson_version: '>=0.46.0') + meson_version: '>=0.48.0') i18n = import('i18n') @@ -19,7 +19,7 @@ conf.set_quoted('BUILD_PLATFORM', build_platform) config_h = configure_file(output: 'config.h', configuration: conf) config_h_dir = include_directories('.') -run_target('build', command: 'meson/build-cli.sh') +cli_build_script = find_program('meson/build-cli.sh') subdir('data') subdir('src') diff --git a/meson/build-cli.sh b/meson/build-cli.sh index 023c655..2dfc7a2 100755 --- a/meson/build-cli.sh +++ b/meson/build-cli.sh @@ -3,5 +3,10 @@ exec_name=writeas echo "Building $exec_name CLI..." +cd $1 && gb build github.com/writeas/writeas-cli/cmd/writeas && +mv bin/writeas $3/$2 && +# Cleanup +rm -rf bin/ && +rm -rf pkg/ && echo "Success." diff --git a/meson_options.txt b/meson_options.txt index 29bd56e..113c1f9 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1 +1,2 @@ option('platform', type: 'combo', choices: ['default', 'elementary'], value: 'default') +option('auto_build_cli', type: 'boolean', value: 'false') diff --git a/src/meson.build b/src/meson.build index 6e68eae..0be3d9b 100644 --- a/src/meson.build +++ b/src/meson.build @@ -4,6 +4,24 @@ else executable = 'writeas-gtk' endif +if get_option('auto_build_cli') + gb = find_program('gb') + + cli_target = custom_target('build-cli', + build_by_default: true, + output: 'writeas', + install: true, + install_dir: get_option('bindir'), + console: true, + command: [ + cli_build_script, + '@SOURCE_ROOT@', + '@OUTPUT@', + meson.build_root() + ] + ) +endif + executable(executable, 'application.vala', 'window.vala', From a70938bdfc93bcfabf4e2096fa3533969467c9ed Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Thu, 1 Aug 2019 15:33:50 -0700 Subject: [PATCH 05/24] build: Properly set executable name in all files This was missed during the consolidation of repositiories. Since the app has different executable names for the different builds, the app_id cannot be used as the "exec" line unconditionally. --- data/com.abunchtell.WriteAsDesktop.appdata.xml.in | 2 +- data/com.abunchtell.WriteAsDesktop.desktop.in | 2 +- data/meson.build | 1 + meson.build | 3 +++ src/meson.build | 6 ------ 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/data/com.abunchtell.WriteAsDesktop.appdata.xml.in b/data/com.abunchtell.WriteAsDesktop.appdata.xml.in index 7107478..d9a0081 100644 --- a/data/com.abunchtell.WriteAsDesktop.appdata.xml.in +++ b/data/com.abunchtell.WriteAsDesktop.appdata.xml.in @@ -28,7 +28,7 @@ hello@write.as - @app_id@ + @exec@ diff --git a/data/com.abunchtell.WriteAsDesktop.desktop.in b/data/com.abunchtell.WriteAsDesktop.desktop.in index 0ec22b5..0ec54e7 100644 --- a/data/com.abunchtell.WriteAsDesktop.desktop.in +++ b/data/com.abunchtell.WriteAsDesktop.desktop.in @@ -2,7 +2,7 @@ Type=Application Name=Write.as Comment=Publish a thought in seconds. -Exec=@app_id@ +Exec=@exec@ Icon=@app_id@ Terminal=false MimeType= diff --git a/data/meson.build b/data/meson.build index be9fec1..82d7659 100644 --- a/data/meson.build +++ b/data/meson.build @@ -10,6 +10,7 @@ endforeach data_conf = configuration_data() data_conf.set('app_id', app_id) +data_conf.set('exec', executable) configure_file( input: 'com.abunchtell.WriteAsDesktop.desktop.in', output: '@0@.desktop'.format(app_id), diff --git a/meson.build b/meson.build index 6fd8d7c..c424f86 100644 --- a/meson.build +++ b/meson.build @@ -8,10 +8,13 @@ i18n = import('i18n') build_platform = get_option('platform') if build_platform == 'elementary' app_id = 'com.github.writeas.writeas-gtk' + executable = 'com.github.writeas.writeas-gtk' else app_id = 'com.abunchtell.WriteAsDesktop' + executable = 'writeas-gtk' endif + conf = configuration_data() conf.set_quoted('GETTEXT_PACKAGE', app_id) conf.set_quoted('APP_ID', app_id) diff --git a/src/meson.build b/src/meson.build index 0be3d9b..48de256 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,9 +1,3 @@ -if build_platform == 'elementary' - executable = 'com.github.writeas.writeas-gtk' -else - executable = 'writeas-gtk' -endif - if get_option('auto_build_cli') gb = find_program('gb') From ed8548696d8dbb846b9a6f51f38e63e11a96a807 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Thu, 1 Aug 2019 15:47:35 -0700 Subject: [PATCH 06/24] debian: Remove "build" run_target usage This run_target no longer exists. --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 8c29f48..176ce5e 100755 --- a/debian/rules +++ b/debian/rules @@ -22,7 +22,7 @@ override_dh_auto_configure: cd debian/build && meson --prefix=/usr ../.. -Dplatform=elementary -Dauto_build_cli=true override_dh_auto_build: - cd debian/build && ninja -v && ninja build + cd debian/build && ninja -v override_dh_auto_test: cd debian/build && ninja test From 2a7cbea201297f183af6ed33f23fe5cc09498576 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Fri, 2 Aug 2019 14:34:46 -0700 Subject: [PATCH 07/24] flatpak: Add clipboard tooling Fixes publishing and copies the post link to the clipboard. --- flatpak/com.abunchtell.WriteAsDesktop.json | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/flatpak/com.abunchtell.WriteAsDesktop.json b/flatpak/com.abunchtell.WriteAsDesktop.json index 29889e0..0311847 100644 --- a/flatpak/com.abunchtell.WriteAsDesktop.json +++ b/flatpak/com.abunchtell.WriteAsDesktop.json @@ -59,6 +59,39 @@ } ] }, + { + "name": "wl-clipboard", + "buildsystem": "meson", + "sources": [ + { + "type": "git", + "url": "https://github.com/bugaevc/wl-clipboard.git" + } + ] + }, + { + "name": "libXmu", + "config-opts": [ + "--disable-static", + "--disable-docs" + ], + "sources": [ + { + "type": "archive", + "url": "https://www.x.org/releases/individual/lib/libXmu-1.1.2.tar.bz2", + "sha256": "756edc7c383254eef8b4e1b733c3bf1dc061b523c9f9833ac7058378b8349d0b" + } + ] + }, + { + "name": "xclip", + "sources": [ + { + "type": "git", + "url": "https://github.com/astrand/xclip.git" + } + ] + }, { "name": "writeas-gtk", "buildsystem": "meson", From 98125f93d5de738799fb5dd4f057aa7c7e51b6b6 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Fri, 2 Aug 2019 14:53:12 -0700 Subject: [PATCH 08/24] flatpak: Add sandbox hole for ~/.writeas Allows for flatpak users to have persistent drafts, and for the bundled cli to access them. --- flatpak/com.abunchtell.WriteAsDesktop.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flatpak/com.abunchtell.WriteAsDesktop.json b/flatpak/com.abunchtell.WriteAsDesktop.json index 0311847..f0ced69 100644 --- a/flatpak/com.abunchtell.WriteAsDesktop.json +++ b/flatpak/com.abunchtell.WriteAsDesktop.json @@ -14,7 +14,8 @@ "--share=ipc", "--socket=x11", "--device=dri", - "--share=network" + "--share=network", + "--filesystem=~/.writeas" ], "build-options": { "append-path": "/usr/lib/sdk/golang/bin/", From 1199c3a85428ecc14f40e8e3a948e0e227686f5d Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Fri, 2 Aug 2019 15:07:46 -0700 Subject: [PATCH 09/24] window: Use FileChooserNative instead of FileChooserDialog Required for saving to work within flatpaks. Does not affect non-flatpak usage. Related to T663 --- src/window.vala | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/window.vala b/src/window.vala index fe91c6a..b109df2 100644 --- a/src/window.vala +++ b/src/window.vala @@ -386,21 +386,18 @@ public class WriteAs.MainWindow : Gtk.ApplicationWindow { private File prompt_file(Gtk.FileChooserAction mode, string action) throws UserCancellable { - var file_chooser = new Gtk.FileChooserDialog(action, this, mode, - _("Cancel"), Gtk.ResponseType.CANCEL, - action, Gtk.ResponseType.ACCEPT); - + var file_chooser = new Gtk.FileChooserNative(action, this, mode, + _("Save"), _("Cancel")); file_chooser.select_multiple = false; var filter = new Gtk.FileFilter(); filter.add_mime_type("text/plain"); file_chooser.set_filter(filter); var resp = file_chooser.run(); - file_chooser.close(); if (resp == Gtk.ResponseType.ACCEPT) { return file_chooser.get_file(); } else { - throw new UserCancellable.USER_CANCELLED("FileChooserDialog"); + throw new UserCancellable.USER_CANCELLED("FileChooserNative"); } } From 3cee7bb075d6a884287e5c15702b5e61d975c141 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Thu, 8 Aug 2019 18:32:29 -0700 Subject: [PATCH 10/24] flatpak: Ensure read-write access to .writeas dir Needed to make sure we can create, read, and write to this directory. --- flatpak/com.abunchtell.WriteAsDesktop.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flatpak/com.abunchtell.WriteAsDesktop.json b/flatpak/com.abunchtell.WriteAsDesktop.json index f0ced69..29110ce 100644 --- a/flatpak/com.abunchtell.WriteAsDesktop.json +++ b/flatpak/com.abunchtell.WriteAsDesktop.json @@ -15,7 +15,7 @@ "--socket=x11", "--device=dri", "--share=network", - "--filesystem=~/.writeas" + "--filesystem=~/.writeas:rw" ], "build-options": { "append-path": "/usr/lib/sdk/golang/bin/", From 9f727169e517d74659d579b0d8b7e24647f6034a Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Thu, 8 Aug 2019 21:15:00 -0700 Subject: [PATCH 11/24] CI: Add flatpak build stage Sets ups build stage for flatpak builds. For T678 --- .travis.yml | 52 +++++++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/.travis.yml b/.travis.yml index a2ba685..42108d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,27 +1,29 @@ --- -language: node_js - -node_js: - - lts/* - -sudo: required - -services: - - docker - -addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - libstdc++-5-dev - -install: - - npm i -g @elementaryos/houston - -script: - - houston ci - -notifications: - email: false +jobs: + - stage: "Elementary" + language: node_js + node_js: + - lts/* + sudo: required + services: + - docker + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - libstdc++-5-dev + install: + - npm i -g @elementaryos/houston + script: + - houston ci + notifications: + email: false + - stage: "Flatpak" + sudo: required + before_install: + - docker pull christopherdavis/elementary-flatpak-writeas:latest + - docker run -it -d --name flatpak christopherdavis/elementary-flatpak-writeas bash + script: + - docker exec flatpak flatpak-builder --repo=repo app flatpak/com.abunchtell.WriteAsDesktop.json From dfb6a75845d665d90685400311788b90faced454 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Thu, 8 Aug 2019 21:17:28 -0700 Subject: [PATCH 12/24] CI: Use C as programming language Travis defaults to Ruby if a language is not specified, which results in a build failure. For T678 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 42108d2..54e76b0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,7 @@ jobs: notifications: email: false - stage: "Flatpak" + language: c sudo: required before_install: - docker pull christopherdavis/elementary-flatpak-writeas:latest From 0fa62f190112a32fba940d3e2fefa52e494234a7 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Thu, 8 Aug 2019 21:20:03 -0700 Subject: [PATCH 13/24] CI: Add docker service Docker is required for the flatpak build. For T678 --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 54e76b0..a75ec60 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,8 @@ jobs: email: false - stage: "Flatpak" language: c + services: + - docker sudo: required before_install: - docker pull christopherdavis/elementary-flatpak-writeas:latest From 9ccec0ad248082ee74d03fdf47551131d18adb49 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Thu, 8 Aug 2019 21:28:00 -0700 Subject: [PATCH 14/24] CI: Use build matrix for multiple jobs Based on the tips from https://github.com/travis-ci/travis-ci/issues/2646 For T678 --- .travis.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index a75ec60..c265afc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,12 @@ --- -jobs: - - stage: "Elementary" - language: node_js +matrix: + include: + - language: node_js node_js: - lts/* sudo: required + before_install: [] services: - docker addons: @@ -20,7 +21,6 @@ jobs: - houston ci notifications: email: false - - stage: "Flatpak" language: c services: - docker @@ -28,5 +28,7 @@ jobs: before_install: - docker pull christopherdavis/elementary-flatpak-writeas:latest - docker run -it -d --name flatpak christopherdavis/elementary-flatpak-writeas bash + addons: [] + install: [] script: - docker exec flatpak flatpak-builder --repo=repo app flatpak/com.abunchtell.WriteAsDesktop.json From f87e30268cfbe169dccbaf7f14f2505c1e119c9b Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Thu, 8 Aug 2019 21:30:06 -0700 Subject: [PATCH 15/24] CI: Set toplevel language to C This ensures that Travis doesn't think we're using Ruby. For T678 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index c265afc..5ac16e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ --- +language: c matrix: include: From 73b8d6705bf1c6ce864282ce33227f7bd8487422 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Thu, 8 Aug 2019 21:36:05 -0700 Subject: [PATCH 16/24] CI: list directory contents before building Ensure that the flatpak directories exist. For T678 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 5ac16e2..0f68848 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,4 +32,5 @@ matrix: addons: [] install: [] script: + - docker exec flatpak ls - docker exec flatpak flatpak-builder --repo=repo app flatpak/com.abunchtell.WriteAsDesktop.json From 313fa1fc84a3858138307e5b917662cf024aefe7 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Thu, 8 Aug 2019 21:56:08 -0700 Subject: [PATCH 17/24] CI: Bind repo directory Ensures that the docker container will be able to access the repository on the host. For T678 --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0f68848..69e1fd7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,10 +27,10 @@ matrix: - docker sudo: required before_install: + - ls - docker pull christopherdavis/elementary-flatpak-writeas:latest - - docker run -it -d --name flatpak christopherdavis/elementary-flatpak-writeas bash + - docker run -v writeas/writeas-gtk:/build/writeas/writeas-gtk -it -d --name flatpak christopherdavis/elementary-flatpak-writeas bash addons: [] install: [] script: - - docker exec flatpak ls - - docker exec flatpak flatpak-builder --repo=repo app flatpak/com.abunchtell.WriteAsDesktop.json + - docker exec flatpak flatpak-builder --repo=repo app /build/writeas/writeas-gtk/flatpak/com.abunchtell.WriteAsDesktop.json From f82fca53ef3603b7b6f97ce3e178c3520acb4807 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Thu, 8 Aug 2019 21:58:13 -0700 Subject: [PATCH 18/24] CI: Disable email notifications for whole process Carries over the original configuration. For T678 --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 69e1fd7..16c61f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,9 @@ --- language: c +notifications: + email: false + matrix: include: - language: node_js @@ -20,8 +23,6 @@ matrix: - npm i -g @elementaryos/houston script: - houston ci - notifications: - email: false language: c services: - docker From 4aea447cf070518df2965c3497ae5d6a5e9284cd Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Thu, 8 Aug 2019 22:04:43 -0700 Subject: [PATCH 19/24] CI: Use absolute path to writeas dir Required to specify a host directory. For T678 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 16c61f8..8617380 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,7 @@ matrix: before_install: - ls - docker pull christopherdavis/elementary-flatpak-writeas:latest - - docker run -v writeas/writeas-gtk:/build/writeas/writeas-gtk -it -d --name flatpak christopherdavis/elementary-flatpak-writeas bash + - docker run -v "$(pwd)":/build/writeas/writeas-gtk -it -d --name flatpak christopherdavis/elementary-flatpak-writeas bash addons: [] install: [] script: From e043493f3fa2c286c7ab8a587b64a675a963c754 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Thu, 8 Aug 2019 22:24:44 -0700 Subject: [PATCH 20/24] CI: Make sure fusermount is executable fusermount not being executable can cause build failures for flatpak builds. For T678 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 8617380..d07b76b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,6 +31,7 @@ matrix: - ls - docker pull christopherdavis/elementary-flatpak-writeas:latest - docker run -v "$(pwd)":/build/writeas/writeas-gtk -it -d --name flatpak christopherdavis/elementary-flatpak-writeas bash + - docker exec flatpak chmod +x /usr/bin/fusermount addons: [] install: [] script: From 479e687af65679efb0acc18a3b67c53aa283477a Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Thu, 8 Aug 2019 22:35:53 -0700 Subject: [PATCH 21/24] CI: Run docker as priviledged Needed for Fuse to work for flatpak. For T678 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d07b76b..aae9f72 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,7 @@ matrix: before_install: - ls - docker pull christopherdavis/elementary-flatpak-writeas:latest - - docker run -v "$(pwd)":/build/writeas/writeas-gtk -it -d --name flatpak christopherdavis/elementary-flatpak-writeas bash + - docker run --priviledged -v "$(pwd)":/build/writeas/writeas-gtk -it -d --name flatpak christopherdavis/elementary-flatpak-writeas bash - docker exec flatpak chmod +x /usr/bin/fusermount addons: [] install: [] From 40214b8b9a41ddd53a2362d6690d866e96cf65df Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Thu, 8 Aug 2019 22:42:35 -0700 Subject: [PATCH 22/24] CI: fix docker typo Incorrectly spelled a flag. For T678 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index aae9f72..3a59ac7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,7 @@ matrix: before_install: - ls - docker pull christopherdavis/elementary-flatpak-writeas:latest - - docker run --priviledged -v "$(pwd)":/build/writeas/writeas-gtk -it -d --name flatpak christopherdavis/elementary-flatpak-writeas bash + - docker run --privileged -v "$(pwd)":/build/writeas/writeas-gtk -it -d --name flatpak christopherdavis/elementary-flatpak-writeas bash - docker exec flatpak chmod +x /usr/bin/fusermount addons: [] install: [] From 3229853b193afa2025431b1b4da933786e0dae52 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Thu, 8 Aug 2019 23:11:24 -0700 Subject: [PATCH 23/24] CI: Manually build writeas-gtk flatpak module This ensures that the CI is building from the current PR instead of git master. For T678 --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3a59ac7..0d4ddf1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,4 +35,7 @@ matrix: addons: [] install: [] script: - - docker exec flatpak flatpak-builder --repo=repo app /build/writeas/writeas-gtk/flatpak/com.abunchtell.WriteAsDesktop.json + - docker exec flatpak flatpak-builder --stop-at=writeas-gtk app /build/writeas/writeas-gtk/flatpak/com.abunchtell.WriteAsDesktop.json + - docker exec flatpak flatpak-builder --run app meson _build /build/writeas/writeas-gtk --prefix=/app -Dauto_build_cli=true + - docker exec flatpak flatpak-builder --run app ninja -C _build install + - docker exec flatpak flatpak-builder --finish-only app /build/writeas/writeas-gtk/flatpak/com.abunchtell.WriteAsDesktop.json From ce92eed6cf8cf1f5c336aa6928fa96af17c52d1c Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Thu, 8 Aug 2019 23:22:49 -0700 Subject: [PATCH 24/24] CI: Use MANIFEST_PATH env variable flatpak-builder needs the path to the manifest. To avoid duplication we use an env variable. For T678 --- .travis.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0d4ddf1..f9bccea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,7 @@ matrix: node_js: - lts/* sudo: required + env: [] before_install: [] services: - docker @@ -27,6 +28,8 @@ matrix: services: - docker sudo: required + env: + - MANIFEST_PATH=/build/writeas/writeas-gtk/flatpak/com.abunchtell.WriteAsDesktop.json before_install: - ls - docker pull christopherdavis/elementary-flatpak-writeas:latest @@ -35,7 +38,7 @@ matrix: addons: [] install: [] script: - - docker exec flatpak flatpak-builder --stop-at=writeas-gtk app /build/writeas/writeas-gtk/flatpak/com.abunchtell.WriteAsDesktop.json - - docker exec flatpak flatpak-builder --run app meson _build /build/writeas/writeas-gtk --prefix=/app -Dauto_build_cli=true - - docker exec flatpak flatpak-builder --run app ninja -C _build install - - docker exec flatpak flatpak-builder --finish-only app /build/writeas/writeas-gtk/flatpak/com.abunchtell.WriteAsDesktop.json + - docker exec flatpak flatpak-builder --stop-at=writeas-gtk app ${MANIFEST_PATH} + - docker exec flatpak flatpak-builder --run app ${MANIFEST_PATH} meson _build /build/writeas/writeas-gtk --prefix=/app -Dauto_build_cli=true + - docker exec flatpak flatpak-builder --run app ${MANIFEST_PATH} ninja -C _build install + - docker exec flatpak flatpak-builder --finish-only app ${MANIFEST_PATH}