Skip to content

Commit

Permalink
Add snapcraft packaging.
Browse files Browse the repository at this point in the history
  • Loading branch information
Casey Marshall committed Oct 2, 2016
1 parent 333f592 commit 0273484
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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

30 changes: 30 additions & 0 deletions snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions wfc-wrapper
Original file line number Diff line number Diff line change
@@ -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 "$@"

0 comments on commit 0273484

Please sign in to comment.