ENV_VARS (SBUILDER)

Environment Variables for SBUILDER

This is internal documentation meant for the SBUILDER, not for humans writing SBUILD Scripts

  • Description: If the Build Was Successful or Failed, if It Failed (SBUILD_SUCCESSFUL==false) Bail & Exit Immediately (Still Copy ${SBUILD_OUTDIR} to SOAR_CACHE) (

  • Also Copy ${SBUILD_TMPDIR}(PATH: ${SBUILD_OUTDIR}/SBUILD_TEMP) if used -k | --keep

  • Values: true | false

  • Description: The Package Name, used as Prefix for ALL NEEDED Files <ALWAYS Available>

  • Also used as default OutputDir if -o | --outputPATH was NOT Specified (ONLY IF SBUILD_SUCCESSFUL==true)

  • Description: One of appbundle|appimage|archive|dynamic|flatimage|gameimage|nixappimage|runimage|static

  • ALWAYS Re-Checked using Magic Bytes for Utmost Sanity

  • dynamic|static are binaries (cli), don't need Integration (Desktop,Icons etc)

  • UNKNOWN means, the pkg_type value was empty, Rechecked anyway

  • Description: The Root (Temporary) Working Directory x_exec.run is Run From <ALWAYS Available>

  • All NEEDED Files must exist in this Directory

  • This Directory is moved to SOAR_CACHE oafter Build Finishes (Regradless if Successful | Failed) but only depth 1 unless used -k | --keep which would move the entire directory including ${SBUILD_TMPDIR}(PATH: ${SBUILD_OUTDIR}/SBUILD_TEMP)

  • After moving to SOAR_CACHE , it is also copied to OutputDir ONLY IF SBUILD_SUCCESSFUL==truespecified using -o | --outputPATH, otherwise this is copied to ${CWD}/${SBUILD_PKG} directory.

  • if SBUILD_SUCCESSFUL==false , don't copy it to OutputDir , fetch the logs & show errors along with printing realpath to SOAR_CACHEDir

  • Description: The SBUILD_TEMP Directory inside ${SBUILD_OUTDIR} (PATH: ${SBUILD_OUTDIR}/SBUILD_TEMP), used for storing NON-NEEDED Files <ALWAYS Available>

  • This dir is cleaned (Not Copied to SOAR_CACHE) by Default unless used -k | --keep

  • If rebuilding, & this dir already exists (User used -k | --keepduring prevous build), it is cleaned/purged with --clean-build or -c | --clean

  • Description: JSON Metadata file, available at ${SBUILD_OUTDIR}/${SBUILD_PKG}.json

  • This is auto created by the SBUILDER at the end of a BUILD (SBUILD_SUCCESSFUL==true)

// This json resembles same format as: https://soarpkgs.pkgforge.dev/metadata/METADATA.json
// Replace & Fill based on the fields from SBUILD
// Values enclosed in [] indicate that they are an array
// Values that are $UPPERCASE indicate they are Variables, and their values need to be replaced
// Certain Fields like build_util, distro_pkg etc are not added in the metadata
{
//Will always exist (linter would exit if Empty)
 "_disabled": "._disabled",
//Will always exist (linter would exit if Empty)
 "pkg": ".pkg",
//Will always exist (linter would create it if Empty)
 "pkg_id": ".pkg_id",
//Empty Value, if SBUILD didn't have it
 "app_id": ".app_id",
//Will always exist (Use Magic Byte to determine if Empty)
 "pkg_type": ".pkg_type",
//Will always exist (linter would exit if Empty)
 "description": ".description",
//Empty Value, if SBUILD didn't have it
 "note": "[.note]",
//Fetch, from SBUILD_OUTDIR/$pkg.version
//if empty, create based on date as YYYYMMDD-HHMMSS (example: 20241126-062034)
 "version": "$PKG_VERSION",
//This field would be pre-populated if user uses the pkgforge-community Repo (SoarPkgs)
 "download_url": "https://soarpkgs.pkgforge.dev/packages/$FILENAME_OF_SBUILD_INPUT_FILE",
//Calculated, in KiB|MiB|GiB format: 1KB, 10MB, 100GB
 "size": "$SIZE_OF_$PKG",
//Calculated 
 "bsum": "$B3SUM_OF_$PKG",
//Calculated, needed since b3sum is not a coreutil yet 
 "shasum": "$SHA256SUM_OF_$PKG",
//Format: YYYY-MM-DDTHH:MM:SS (example: 2024-10-08T01:19:56) 
 "build_date": "$BUILD_DATE",
//Empty Value, if SBUILD didn't have it 
 "repology": "[.repology]",
//Will always exist (linter would exit if Empty) 
 "src_url": "[.src_url]",
//Will always exist (linter would create it if Empty) 
 "homepage": "[.homepage]", 
//If this was a local build, just point to local dir where the .SBUILD is stored
//The Validated SBUILD file that built it, will copy it to install dir after installation) 
 "build_script": "https://github.com/pkgforge/soarpkgs/blob/main/packages/ $VALID_PKGSRC",
//points to local dir where the $pkg.log is stored
//The log file is saved to install dir after installation or in the OutDir
 "build_log": "$PATH_TO_LOCAL_BUILD.log",
//Empty Value, if SBUILD didn't have it 
 "appstream": ".appstream",
//Will always exist (linter would create it if Empty) 
 "category": "[.category]",
//Depending on Package type, may or may not exist, handled logically 
 "desktop": "$PKG.desktop",
//Depending on Package type, may or may not exist, handled logically, using default icon as fallback 
 "icon": "$PKG.{DirIcon|png|Svg}",
//Empty Value, if SBUILD didn't have it 
 "license" : "[.license]",
//Empty Value, if SBUILD didn't have it 
 "provides": "[.provides]",
//Empty, if was first Install, Otherwise (if user used option to backup), refers to previous snapshot 
 "snapshots": "[.snapshots]",
//Empty Value, if SBUILD didn't have it 
 "tag": "[.tag]"
}

Last updated