Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

CMake with a PPA plugin #1

Merged
merged 1 commit into from Mar 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions snap/plugins/cmake_with_ppa.py
@@ -0,0 +1,16 @@
from snapcraft.plugins import cmake
import subprocess

class CMakeWithPpa(cmake.CMakePlugin):

@classmethod
def schema(cls):
schema = super().schema()
schema['properties']['ppa'] = { 'type': 'string', 'default': 'mir-team/release' }
return schema


def __init__(self, name, options, project):
super().__init__(name, options, project)
subprocess.run(["sudo", "apt", "--assume-yes", "install", "software-properties-common"])
subprocess.run(["sudo", "add-apt-repository", "-yu", "ppa:"+self.options.ppa])
11 changes: 2 additions & 9 deletions snap/snapcraft.yaml
Expand Up @@ -17,13 +17,6 @@ apps:
command: bin/egmde.launcher

parts:
ppa-mir:
plugin: nil
override-pull: |
sudo apt --assume-yes install software-properties-common
sudo add-apt-repository -yu ppa:mir-team/release
snapcraftctl pull

recipe-version:
plugin: nil
source: .
Expand All @@ -34,15 +27,15 @@ parts:
- -recipe-version

egmde:
after: [ppa-mir, recipe-version]
after: [recipe-version]
override-pull: |
snapcraftctl pull
server_version=`git rev-list --count HEAD`
mir_version=`LANG=C apt-cache policy mir-graphics-drivers-desktop | sed -rne 's/^\s+Candidate:\s+([^-]*)-.+$/\1/p'`
recipe_version=`cat $SNAPCRAFT_STAGE/recipe-version`
snapcraftctl set-version $server_version-mir$mir_version-snap$recipe_version
if echo $mir_version | grep dev; then snapcraftctl set-grade devel; else snapcraftctl set-grade stable; fi
plugin: cmake
plugin: cmake-with-ppa
source: https://github.com/AlanGriffiths/egmde.git
build-packages:
- pkg-config
Expand Down