the build scriptlet doesn't take into account the source-subdir

Bug #1676186 reported by Leo Arias on 2017-03-26
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Medium
Unassigned

Bug Description

I have a source in a subdir, and want to build and install it using scriptlets. Even if I declare the source-subdir tag, the scriptlets will run from the build dir. I think it would make more sense to run the scriptlets from the subdir instead.

Take a look at this part:

freeimage:
  source: http://golem.network/FreeImage.zip
  source-subdir: FreeImage
  plugin: nil
  build-packages: [g++]
  build: |
    cd FreeImage
    make -j$(SNAPCRAFT_PARALLEL_BUILD_COUNT)
  install: |
    mkdir -p $SNAPCRAFT_PART_INSTALL/usr/lib/
    cp FreeImage/Dist/* $SNAPCRAFT_PART_INSTALL/usr/lib/
    ln -s $SNAPCRAFT_PART_INSTALL/usr/lib/libfreeimage*.so $SNAPCRAFT_PART_INSTALL/usr/lib/libfreeimage.so

The subdir is FreeImage, and I still had to cd FreeImage during build, and during install I had to cp FreeImage/...

If we agree that the scriptlets should run from the subdir, a fix here is a little delicate because it will break the parts with subdir and scriptlets.

Leo Arias (elopio) on 2017-03-26
tags: added: sources
Leo Arias (elopio) on 2017-09-11
tags: added: scripts
removed: scriptlets
Kyle Fazzari (kyrofa) wrote :

Yes, I agree.

Changed in snapcraft:
status: New → Triaged
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers