I am trying to create a snap from R-language version 4 (https://cran.r-project.org/src/base/R-4/R-4.0.2.tar.gz). The R install directory can be set during the config phase with “–prefix PATH”. The installation will hard code the given path and the program expects itself to be run from the given path. So, basically R is installed with
./configure --prefix=TARGET_PATH
make
make install
How these types of programs are snapped?
It looks like the R install needs to install directly to the final target path ($SNAP), but this does not work with snapcraft as the build seems to fail with error message: “Failed to generate snap metadata: The specified command ‘bin/R’ defined in the app ‘R’ is not executable.”
Yes, this I can do and have tried, but after that R expects itself to be run from /usr/bin/R folder, but snap seems to place files to under /snap. So, running R will end up R trying to fetch files from /usr, but it does not find them.
I suppose you’ve wrongly referenced $SNAP in the build recipe, note that the environment variable only has proper value during the runtime of the snap application.
Makes sense. I did try to modify my yaml, but got the same error message. Perhaps now my apps command is wrong, but it does not seem to allow any variables.