From 0273484ed9aedf9f00a46f9c9b19cae3ed4f4f2c Mon Sep 17 00:00:00 2001 From: Casey Marshall Date: Sun, 2 Oct 2016 11:22:15 -0500 Subject: [PATCH] Add snapcraft packaging. --- Makefile | 16 ++++++++++++++++ snapcraft.yaml | 30 ++++++++++++++++++++++++++++++ wfc-wrapper | 11 +++++++++++ 3 files changed, 57 insertions(+) create mode 100644 Makefile create mode 100644 snapcraft.yaml create mode 100755 wfc-wrapper diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..20d0d08 --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ + +CSC=mcs + +.PHONY: all +all: wfc.exe + +install: wfc.exe + cp wfc.exe $(DESTDIR)/wfc.exe + +wfc.exe: + $(CSC) /reference:System.Drawing.dll *.cs /out:$@ + +.PHONY: clean +clean: + $(RM) wfc.exe + diff --git a/snapcraft.yaml b/snapcraft.yaml new file mode 100644 index 0000000..07c1f12 --- /dev/null +++ b/snapcraft.yaml @@ -0,0 +1,30 @@ +name: wfc +version: 0 +summary: This program generates bitmaps that are locally similar to the input bitmap. +description: | + Bitmap & tilemap generation from a single example with the help of ideas from + quantum mechanics. + +grade: stable # must be 'stable' to release into candidate/stable channels +confinement: strict # use 'strict' once you have the right plugs and slots + +apps: + wfc: + command: wfc-wrapper + plugs: + - home + +parts: + build-wfc: + plugin: make + source: . + build-packages: [mono-devel] + stage-packages: [mono-runtime, libmono-system-core4.0-cil, libmono-system-drawing4.0-cil] + copy-wfc: + plugin: dump + source: . + snap: + - wfc-wrapper + - wfc.exe + - usr/lib/mono/*/* + - usr/bin/mono diff --git a/wfc-wrapper b/wfc-wrapper new file mode 100755 index 0000000..2a50c6c --- /dev/null +++ b/wfc-wrapper @@ -0,0 +1,11 @@ +#!/bin/bash -e + +export MONO_PATH=${SNAP}/usr/lib/mono/4.5 +export HOME=${SNAP_USER_DATA} + +if [ ! -e "${HOME}/.mono/config" ]; then + mkdir -p ${HOME}/.mono + cp ${SNAP}/etc/mono/config ${HOME}/.mono/config +fi + +exec ${SNAP}/usr/bin/mono ${SNAP}/wfc.exe "$@"