Is there a German howto/documentation for snapcraft?

Oliver Grawert ogra at ubuntu.com
Tue Jul 12 11:00:57 UTC 2016


hi,
Am Dienstag, den 12.07.2016, 02:56 +0200 schrieb Ralf Mardorf:
> Hi,
> 
> I don't understand how to build a snap.
> 
> Is there a German howto/documentation for snapcraft?
> 
> Here is what I tried [1].
> 
> I guess I confused stage-packages [1] with build-packages, anyway, were
> do I need to add the build-packages?
> 
> Perhaps like that:
> 
> parts:
>   qjackctl:
>     source: qjackctl-0.4.2-r13-g5a8f67fc
>     build-packages:
>       [libasound2-dev, libjack-dev, libfoo-dev, libbar-dev]
>     configflags:
>       CFLAGS = -Wall -g
>       export QTDIR=/usr/share/qt5
>       export QT_SELECT=qt5
> [snip]
you did not define a "plugin:" parameter ... 
looking at the qjackctl source it seems that uses autotools, so you
could pick that plugin

to get more info about possible parameters:
snapcraft help autotools

you could also use the "make" plugin and have your Makefile do the
necessary steps 
https://github.com/ogra1/upnp-server
is an example where i use two subdirs with makefiles and the make plugin
for git clone, configure and friends (you could even have it run the
steps you do in your shell script (apart from the snapcraft.yaml
creation indeed)) ...

> 
> Is there a way to depend on JACK1 or JACK2 outside of the snap? IOW to
> use the snap with JACK of the regular Ubuntu install?
> 
as mark mentioned, you would need a jack interface. 
for dependencies: your snap needs to be self contained, so if there are
runtime library dependencies you need to include them in stage-packages
(likewise for build time dependencies and build-packages). 

> As you can see a script generates my snapcraft.yaml. Is it possible to
> clone and get the version number within the snapcraft.yaml?
> 

i dont think that is possible yet but i remember someone filed a bug
about the other way around: 
https://bugs.launchpad.net/snapcraft/+bug/1588336

while you currently work top down starting from a shellscript and then
going to snapcraft, try to think the other way around, snapcraft (and
snapcraft.yaml) are the toplevel authoritative command and config. you
can call shellscripts from the make command to generate and patch things
then.

when i re-work your snapcraft.yaml a little like below and add a
Makefile for the build and cloning (even further below) i get a proper
build ... (the snapcraft.yaml still has some boilerplate summary and
description from "snapcraft init" ... ) 

root at anubis:/qjackctl# cat snapcraft.yaml 
name: qjackctl
version: 0.1
summary: This is my-snap's summary  # 79 char long summary
description: This is my-snap's description  # a longer description for
the snap
confinement: devmode  # use "strict" to enforce system access only via
declared interfaces

parts:
  qjctlbuild:
    source: ./
    plugin: make
    build-packages:
      - autoconf
      - automake
      - autopoint
      - autotools-dev
      - gcc
      - gettext
      - git
      - libasound2-dev
      - libjack-dev
      - qt5-default
      - qt5-qmake
      - qtbase5-dev
      - qttools5-dev-tools
      - libqt5x11extras5-dev
      - libx11-dev
    stage-packages:
      - jackd2
      - libasound2
      - libc6
      - libgcc1
      - libjack-jackd2-0
      - libqt5core5a
      - libqt5dbus5
      - libqt5gui5
      - libqt5widgets5
      - libqt5x11extras5
      - libqt5xml5
      - libstdc++6
      - libx11-6
    after: [desktop/qt5]

root at anubis:/qjackctl# cat Makefile 
CFLAGS = -Wall -g

all:
	git clone git://git.code.sf.net/p/qjackctl/code qjackctl
	(cd qjackctl; ./autogen.sh; ./configure; make)
install:
	echo "foo"

root at anubis:/qjackctl#

have fun :)

ciao
	oli
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/snapcraft/attachments/20160712/4f3ff3c4/attachment.sig>


More information about the Snapcraft mailing list