[gnome-calculator] snap: fix build



commit 097bb047a9e382c7c8cc5d60edb79e4288e087c2
Author: Jeremy Bicha <jbicha ubuntu com>
Date:   Fri Jan 25 09:13:54 2019 -0500

    snap: fix build
    
    We need to build gtksourceview ourselves since gtksourceview4
    isn't available in Ubuntu LTS releases.
    
    This also switches us to the core18 snap which
    Ubuntu isn't ready to do yet for seeded snaps like this one.

 snap/snapcraft.yaml | 50 +++++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 45 insertions(+), 5 deletions(-)
---
diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
index 22ab7a31..1b5a3390 100644
--- a/snap/snapcraft.yaml
+++ b/snap/snapcraft.yaml
@@ -22,12 +22,13 @@ description: |
 
 grade: devel # must be 'stable' to release into candidate/stable channels
 confinement: strict
+base: core18
 
 plugs:
-  gnome-3-26-1604:
+  gnome-3-28-1804:
     interface: content
     target: $SNAP/gnome-platform
-    default-provider: gnome-3-26-1604
+    default-provider: gnome-3-28-1804
   gtk-3-themes:
     interface: content
     target: $SNAP/data-dir/themes
@@ -63,14 +64,54 @@ apps:
       LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/lib/gnome-calculator
 
 parts:
-  gnome-calculator:
-    build-attributes: [no-system-libraries]
+  desktop-gnome-platform:
+    source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
+    source-subdir: gtk
+    plugin: make
+    make-parameters: ["FLAVOR=gtk3"]
+    build-packages:
+      - build-essential
+      - libgtk-3-dev
+    override-build: |
+      snapcraftctl build
+      mkdir -pv $SNAPCRAFT_PART_INSTALL/gnome-platform
+
+  gtksourceview:
     after: [desktop-gnome-platform]
+    source: https://gitlab.gnome.org/GNOME/gtksourceview.git
+    source-type: git
+#    source-tag: 4.0.3
+    plugin: autotools
+    configflags: [--prefix=/usr]
+    organize:
+      snap/gtksourceview/current/usr: usr
+    build-packages:
+      - autoconf-archive
+      - gettext
+      - gobject-introspection
+      - gtk-doc-tools
+      - libgirepository1.0-dev
+      - libglib2.0-dev
+      - libgtk-3-dev
+      - libpeas-dev
+      - libxml2-dev
+      - libxml2-utils
+      - valac
+
+  gnome-calculator:
+    after: [gtksourceview]
     source: .
     plugin: meson
     meson-parameters: [--prefix=/snap/gnome-calculator/current/usr]
     organize:
       snap/gnome-calculator/current/usr: usr
+    build-environment:
+      - PKG_CONFIG_PATH: $SNAPCRAFT_STAGE/usr/lib/pkgconfig
+# overriding vapidir in build-environment doesn't seem to work
+    override-build: |
+      sed -i.bak -e "s|vapi_dir]|vapi_dir, '--vapidir=$SNAPCRAFT_STAGE/usr/share/vala/vapi']|g" meson.build
+      sed -i.bak -e "s|config',|config', '--vapidir=$SNAPCRAFT_STAGE/usr/share/vala/vapi',|g" src/meson.build
+      snapcraftctl build
     build-packages:
       - desktop-file-utils
       - gettext
@@ -80,7 +121,6 @@ parts:
       - intltool
       - libglib2.0-dev
       - libgtk-3-dev
-      - libgtksourceview-4-dev
       - libxml2-dev
       - libsoup2.4-dev
       - libmpc-dev


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]