20.x_exec

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

More Details: ENV_VARS (x_exec.run)

NEEDED_FILES


Additional Fields

arch

x_exec.arch is a NON_ENFORCED field

x_exec:
  arch:
    - "aarch64"
    - "x86_64"
  shell: "bash"
  pkgver: |
    #stuff
  run: |
   #stuff

conflicts

x_exec.conflicts is a NON_ENFORCED field

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.depends is a NON_ENFORCED field

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.entrypoint is a NON_ENFORCED field

#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_BINDIR points to a real file, NOT ANOTHER SYMLINK


os

x_exec.os is a NON_ENFORCED field

x_exec:
  os:
    - "freebsd"
    - "linux"
  shell: "bash"
  pkgver: |
    #stuff
  run: |
   #stuff

host

x_exec.host is a NON_ENFORCED field

x_exec:
  host:
    - "aarch64-freebsd"
    - "aarch64-Linux"
    - "x86_64-Linux"
  shell: "bash"
  pkgver: |
    #stuff
  run: |
   #stuff

Last updated

Was this helpful?