Proposal: Expose SNAPCRAFT_SNAP and SNAPCRAFT_PARTS environment variables

To add patches to a known location, use the dump plugin:

parts:
  patches:
    source: some/directory/in/your/source
    plugin: dump
    organize:
      patchfile.diff: some/known/directory/in/stage/patchfile.diff
    prime: [-*]

  application:
    after: [patches]
    override-pull: |
      snapcraftctl pull
      patch -Np1 < $SNAPCRAFT_STAGE/some/known/directory/in/stage/patchfile.diff
    ...
2 Likes