Problems with PREFIX when building a snap

Dietmar Winkler dietmar.winkler at dwe.no
Thu Jul 28 17:36:41 UTC 2016


Thanks James,

you are right the build works now. But I hope you don't mind me asking
(since I really want to understand it) how you ended up at that
IPEPREFIX path.

The source is in:

~/tmp/snap/ipe/parts/ipe/src

For the build that gets copied over to

~/tmp/snap/ipe/parts/ipe/build

make gets executed in the subdir "src", which means now we are in

~/tmp/snap/ipe/parts/ipe/build/src

Now I try to travers 3 levels up as defined by

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

and I end up in

~/tmp/snap/ipe/parts/

but here is only the "ipe" dir the install is one level below:

~/tmp/snap/ipe/parts[master]$ tree -L 2
.
└── ipe
    ├── build
    ├── install
    ├── src
    ├── state
    └── ubuntu

So how come

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

works but

- IPEPREFIX=../../install

would not (which I would find logical)?


I'm rather puzzled.

One other question, is there somewhere a list of available "plugs". I
guessed I would need "x11" but only found this reference in some
examples. I did not manage to find any specific documentation on this.

Thanks,

On 28 July 2016 at 18:34, James Jesudason <james.jesudason at canonical.com> wrote:
> 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
>
>



-- 
/Dietmar/

Secure email communication:
https://encrypt.to/dietmar.winkler@dwe.no
Public OpenPGP key: 0x235E6689




More information about the Snapcraft mailing list