Problems with PREFIX when building a snap

James Jesudason james.jesudason at canonical.com
Thu Jul 28 16:34:07 UTC 2016


If you refer to http://snapcraft.io/create it mentions the different
directories and their uses:

"parts/ contains one subdirectory for each part: gnu-bash and gnu-hello.
Each part's subdirectory has a src/ directory (to where the code is
pulled), build/ where the build happens, and install/ where make install is
processed.

stage/ is where all the content from parts/<part_name>/install is copied
and consolidated in a single directory.

prime/ is the actual snap content. The stage/ directory is copied there.
Binaries are stripped, wrappers are generated by Snapcraft, and the snap
metadata files are also generated there. The final .snap file is just a
squashfs archive of this prime/ directory. You can use and debug the snap's
content from here"


So you need to get the "make" process to deliver the binaries to the
"parts/<part_name>/install"
directory. In your case, this can be done via:

 - IPEPREFIX=../../../install

(there's probably a more elegant way of getting path, but that seems to work
).

Then, you need to make sure that the command to launch the app is correct.
In your case, this looks like:

apps:
    ipe:
        command: bin/ipe

With those changes, I was able to get a ipe_7.2.5_amd64.snap file built.
You can then install it using:

 sudo snap install ipe_7.2.5_amd64.snap



On 28 July 2016 at 14:52, Dietmar Winkler <dietmar.winkler at dwe.no> wrote:

> Hi,
>
> I'm currently trying to buld my first snap. With the help of the
> #snappy irc channel I could finally create a snapp package but it
> seems to be empty and non of the binary are actually contained.
>
> Running `snapcraft` on
> https://github.com/dietmarw/snaps/blob/master/ipe/snapcraft.yaml
>
> generates this structure:
> https://gist.github.com/dietmarw/422354f1906bcb2babacd0168349ea55
>
> Doing `sudo snapcraft install`  then gives
> https://gist.github.com/dietmarw/7622ba197f64b4b89dbc79b60b86d348
>
> One thing that threw snapcraft earlier was the definition of
> "IPEPREFIX" . But that is needed by the Makefile of the project.
> Setting it to something that is writable by the user running snapcraft
> was the only way to get it working. I've ended up using
>
> IPEPREFIX=$SNAPCRAFT_STAGE
>
> (as mentioned in
>
> https://developer.ubuntu.com/en/snappy/build-apps/snapcraft-advanced-features/
> )
>
> but still don't know if this is the correct "installation" directory
> as required by the Makefile.
>
> The snap is supposed to just compile ipe just like described here:
>
> https://github.com/otfried/ipe-wiki/wiki/Downloading,%20Compiling,%20and%20Installing%20Ipe#debian-ubuntu-mint
>
> which works without problems.
>
> I'm a but at a loss of what it is I'm doing wrong. Also snapcraft is
> not really reporting any problems or what is missing :-(
>
> Anyone got an idea what is missing?
>
> --
> /Dietmar/
>
> Secure email communication:
> https://encrypt.to/dietmar.winkler@dwe.no
> Public OpenPGP key: 0x235E6689
>
> --
> Snapcraft mailing list
> Snapcraft at lists.snapcraft.io
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/snapcraft
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/snapcraft/attachments/20160728/6e0e69db/attachment.html>


More information about the Snapcraft mailing list