[neon/snap-packaging/okular-snap] /: Add meson-deps and ninja

Scarlett Moore null at kde.org
Wed Apr 16 19:32:02 BST 2025


Git commit ef7470e397017057b770ccb6953b41aefb840ba0 by Scarlett Moore.
Committed on 16/04/2025 at 18:31.
Pushed by scarlettmoore into branch 'master'.

Add meson-deps and ninja

M  +40   -0    snapcraft.yaml

https://invent.kde.org/neon/snap-packaging/okular-snap/-/commit/ef7470e397017057b770ccb6953b41aefb840ba0

diff --git a/snapcraft.yaml b/snapcraft.yaml
index da9dc0d..84bda35 100644
--- a/snapcraft.yaml
+++ b/snapcraft.yaml
@@ -47,7 +47,47 @@ package-repositories:
     url: http://origin.archive.neon.kde.org/user
     key-server: keyserver.ubuntu.com
 parts:
+  ninja:
+    plugin: nil
+    source: https://github.com/ninja-build/ninja.git
+    source-tag: 'v1.11.1'
+    source-depth: 1
+    override-build: |
+      rm -rf build
+      rm -f ninja
+      rm -f ninja_bootstrap
+      sed -i 's_^#!/usr/bin/env python$_#!/usr/bin/env python3_g' configure.py
+      ./configure.py --bootstrap
+      mv ninja ninja_bootstrap
+      rm -rf build
+      ./ninja_bootstrap
+      rm -f ninja_bootstrap
+      mkdir -p $CRAFT_PART_INSTALL/usr/bin
+      mv ninja $CRAFT_PART_INSTALL/usr/bin/
+    build-packages:
+      - python3
+
+  meson-deps:
+    after: [ ninja ]
+    plugin: nil
+    source: https://github.com/mesonbuild/meson.git
+    source-tag: '1.2.3'
+    source-depth: 1
+    override-build: |
+      python3 -m pip install .
+      mkdir -p $CRAFT_PART_INSTALL/usr/lib/python3/dist-packages
+      rm -rf $CRAFT_PART_INSTALL/usr/lib/python3/dist-packages/meson*
+      python3 -m pip install --target=$CRAFT_PART_INSTALL/usr .
+      mv $CRAFT_PART_INSTALL/usr/meson* $CRAFT_PART_INSTALL/usr/lib/python3/dist-packages/
+      sed -i "s%^#!/usr/bin/python3$%#!/usr/bin/env python3%g" /usr/local/bin/meson
+      sed -i "s%^#!/usr/bin/python3$%#!/usr/bin/env python3%g" $CRAFT_PART_INSTALL/usr/bin/meson
+    build-packages:
+      - python3-pip
+
   gsettings-desktop-schemas:
+    after:
+      - meson-deps
+      - ninja
     source: https://gitlab.gnome.org/GNOME/gsettings-desktop-schemas.git
     source-tag: '42.0'
     source-depth: 1


More information about the Neon-commits mailing list