Conzar
November 21, 2017, 9:16am
1
I am building my first snap application osvr-nofc . Its based off of a script that I wrote to build the software. I have created a part called ‘linux-build’ which runs the script that compiles and builds the many components of the application.
In parts/linux-build/build
, I would like the dist directory to be copied into the snap. How do I do this?
linux-build :
prepare : ./prepare.bash
plugin : nil
stage :
- dist
The stage section tries to copy from parts/linux-build/install/dist
Thank you for your help!
Something like this:
linux-build:
source: .
plugin: nil
prepare: ./prepare.bash
install: |
cp dist/* $SNAPCRAFT_PART_INSTALL
Don’t forget to state source: .
as not specifying it might end up in unpredictable behavior.
Conzar
November 21, 2017, 11:37am
3
install doesn’t do anything. I don’t get any errors either. I can put rubbish in that line and I still don’t get any output. Is there a reason that install doesn’t do anything?
Conzar
November 21, 2017, 8:19pm
4
I think I may have figured out the issue … rebuilding now and will report back. I think install is the right scriptlet to use. Thank you.
Conzar
November 22, 2017, 10:02pm
5
It seems to have worked. Except now I am getting a symlink error.
package contains external symlinks: lib/libuvc.so.0
In my build scripts, I do this:
ln -s ${INSTALL_DIR}/lib/x86_64-linux-gnu/libuvc.so.0 ${INSTALL_DIR}/lib/.
Where INSTALL_DIR is set by the build script which is set by a prepare script in my snapcraft.yaml
-i $(pwd)/build-script/bash_lib
Any ideas of how to fix this? Should I not be using pwd and instead a different environment variable for snaps?
Conzar
November 23, 2017, 12:45am
6
Its weird - 2 out of 3 architctures built. Can someone explain why amd64 failed but the others passed???
Conzar:
In my build scripts, I do this:
ln -s ${INSTALL_DIR}/lib/x86_64-linux-gnu/libuvc.so.0 ${INSTALL_DIR}/lib/
you can fix that symlink by using a relative symlink rather than fully-qualified:
ln -s x86_64-linux-gnu/libuvc.so.0 ${INSTALL_DIR}/lib/
Conzar
November 23, 2017, 7:53pm
8
Thank you. Trying that now.