Skip to content
Permalink
Browse files

INitial snapcraft packaging

  • Loading branch information
ralsina committed Jun 16, 2016
1 parent 43d3c51 commit 421694d3dbd38e06ba8f63451b6ba07eb3253b6e
Showing with 78 additions and 0 deletions.
  1. +24 −0 snapcraft/README
  2. +23 −0 snapcraft/nikola.sh
  3. +31 −0 snapcraft/snapcraft.yaml
@@ -0,0 +1,24 @@
This folder contains an experimental attempt to build a snap package for nikola.

To build, in Ubuntu 16.04:

apt install snapd snapcraft
snap login some.account@whatever.com
snapcraft
snapd install nikola*snap --devmode

To just use it:

apt install snapd snapcraft
snap login some.account@whatever.com
snap install nikola


That should leave you with a woring "nikola" command, which is functional with the
following caveats:

* Locales are broken: https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1576411
* It needs to run in devmode (unconfined). I am not sure it makes much sense to
try to use it otherwise, and in any case it doesn't work for a variety of bugs.
* The -b option in nikola serve and nikola auto will not work
* Probaby other things I have not noticed yet.
@@ -0,0 +1,23 @@
#!/bin/sh

export HOME=$SNAP_APP_USER_DATA
export HACKDIR=$SNAP_APP_USER_DATA
export NETHACKOPTIONS=$SNAP_APP_USER_DATA/.nethackrc

export I18NPATH=$SNAP_APP_PATH/usr/share/i18n
export LOCPATH=$SNAP_APP_USER_DATA

APPLANG=en_US
APPENC=UTF-8
APPLOC="$APPLANG.$APPENC"

# generate a locale so we get properly working charsets and graphics
if [ ! -e $SNAP_APP_USER_DATA/$APPLOC ]; then
localedef --prefix=$SNAP_APP_USER_DATA -f $APPENC -i $APPLANG $SNAP_APP_USER_DATA/$APPLOC
fi

export LC_ALL=$APPLOC
export LANG=$APPLOC
export LANGUAGE=${APPLANG%_*}

$SNAP/usr/bin/nikola "$@"
@@ -0,0 +1,31 @@
name: nikola
version: 7.7.9
summary: A static website generator
description: A static website generator
confinement: devmode

apps:
nikola:
command: nikola.sh

parts:
nikola:
plugin: copy
files:
nikola.sh: nikola.sh
nikola-source:
plugin: python3
source: git://github.com/getnikola/nikola.git
source-tag: v7.7.9
requirements: parts/nikola-source/src/requirements-extras.txt
stage-packages:
- locales
- libc-bin
build-packages:
- zlib1g-dev
- libjpeg-turbo8-dev
- libpng12-dev
- libxslt1-dev
- libxml2-dev
- gcc

0 comments on commit 421694d

Please sign in to comment.
You can’t perform that action at this time.