Code Execution that produces the Required Artifacts during SBUILD (TYPE: ENFORCED)
Main Fields
#Example ONLY
x_exec:
shell: "bash" #Invokes /usr/bin/env ${SHELL}, bash in this case
pkgver: |
${RAW SHELL CMDS TO FETCH VERSION}
run: |
${RAW SHELL CMDS TO BUILD|DOWNLOAD|FETCH PACKAGE}
While, yes any shell is possible, Try using sh or bashas these are universal on almost all Distros
This will save the version in ${SBUILD_OUTDIR}/${SBUILD_PKG}.version & also export as ENV VAR${PKG_VER}
You can reuse or overwrite it in run part, so be careful
You can just do echo 1.1.1 if you want to hardcode a particular version, though for that .pkgver exist
x_exec:
conflicts:
#These pkgs will be uninstalled & removed before proceeding to x_exec.run
- "${PKG_ID_1}" #example: github.com.ImageMagick.ImageMagick.stable
- "${PKG_ID_2}"
shell: "bash"
pkgver: |
#stuff
run: |
#stuff
depends
x_exec.dependsis a NON_ENFORCEDfield
x_exec:
depends:
#These pkgs will either be fetched from Prebuilt Cache or Built Locally & Installed before proceeding to x_exec.run
- "${PKG_ID_1}" #example: github.com.ImageMagick.ImageMagick.stable
- "${PKG_ID_2}"
shell: "bash"
pkgver: |
#stuff
run: |
#stuff
entrypoint
x_exec.entrypointis a NON_ENFORCEDfield
#Example ONLY
x_exec:
entrypoint: "${PATH TO MAIN BINARY aka $SBUILD_PKG}"
shell: "bash"
pkgver: |
#stuff
run: |
#stuff
#Another Example
x_exec:
#${SBUILD_TMPDIR} is NOT SUPPORTED for Obvious reasons
entrypoint: "${SBUILD_OUTDIR}/path/example"
#If you only use `/path/example` or `path/example`, it is assumed as: `${SBUILD_OUTDIR}/path/example`
entrypoint: "path/example" #Same as writing ${SBUILD_OUTDIR}/path/example
shell: "bash"
pkgver: |
#stuff
run: |
#stuff
#The entrypoint
entrypoint: "${SBUILD_OUTDIR}/bin/example-cli"
#The structure after a successful Build
${SBUILD_OUTDIR}
├── bin
│ ├── example-cli
│ └── example-helper
#Then, it's symlinked as
${SBUILD_OUTDIR}
├── example-cli --> ./bin/example-cli
├── bin
│ ├── example-cli
│ └── example-helper
When Installing, the ${SBUILD_OUTDIR}/${SBUILD_PKG}SYMLINK is resolved to realpath, and the symlink in SOAR_BINDIRpoints to a real file, NOT ANOTHER SYMLINK