I'm creating a Snap which contains 2 parts. The second part needs files that have been created in the first part otherwise it will not build.

I tried to use a relative path, starting in the root directory of the current part, but libtool does not accept it. If I use the absolute path it builds but now the snapcraft.yaml is not portable anymore.

This is what I have now:

build: |
  ./autogen.sh && ./configure LDFLAGS='-L/home/snapcraft/mySnap/parts/libdb4.8/install/usr/local/BerkeleyDB.4.8/lib/' CPPFLAGS='-I/home/snapcraft/mySnap/parts/libdb4.8/install/usr/local/BerkeleyDB.4.8/include/'

Is there an environmental variable that holds the absolute path of previous parts? Or is there any other way to do this?

Thanks

share|improve this question
up vote 0 down vote accepted

I was able to resolve this issue by adding the necessary files to the staging area

stage:
  - usr/local/BerkeleyDB.4.8/lib/*
  - usr/local/BerkeleyDB.4.8/include/*

and then pointing to them using the $SNAPCRAFT_STAGE environment variable.

build: |
  ./autogen.sh && ./configure LDFLAGS='-L$SNAPCRAFT_STAGE/usr/local/BerkeleyDB.4.8/lib/' CPPFLAGS='-I$SNAPCRAFT_STAGE/usr/local/BerkeleyDB.4.8/include/'
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.