Difference between revisions of "Oolite build system"

From Elite Wiki
Line 7: Line 7:
 
! Build Step !! Description !! Requires !! Provides
 
! Build Step !! Description !! Requires !! Provides
 
|-
 
|-
| configure system manually ||||||
+
| configure system manually || A developer will maintain his development system will all the required tools and dependencies to build Oolite. Should be supported by scripts. ||||
 
|-
 
|-
| checkout code ||||||
+
| checkout code || Clone and checkout from the Oolite git repository so it resides in the local filesystem. ||||
 
|-
 
|-
| change code ||||||
+
| change code || A developer will change code in the local filesystem to whatever extent. ||||
 
|-
 
|-
 
| meson setup ||||||
 
| meson setup ||||||
Line 17: Line 17:
 
| meson compile ||||||
 
| meson compile ||||||
 
|-
 
|-
| test/debug manually ||||||
+
| test/debug manually || A developer will test manually, focusing on the changes he/she applied. ||||
 
|-
 
|-
 
| meson test ||||||
 
| meson test ||||||
Line 27: Line 27:
 
| push changes || Push the changes back into the Oolite repository. Likely involves commit and pull request actions. || || |
 
| push changes || Push the changes back into the Oolite repository. Likely involves commit and pull request actions. || || |
 
|-
 
|-
| configure system automatically ||||||
+
| configure system automatically || Similar to the `configure system manually` step, in CI builds all this has to be scripted. ||||
 
|-
 
|-
 
| calculate version number || Generates the checked out version's semver. ||||
 
| calculate version number || Generates the checked out version's semver. ||||
Line 45: Line 45:
 
| upload artifacts || Uploads generated artifacts to a Github Release so they are available to the public. ||||
 
| upload artifacts || Uploads generated artifacts to a Github Release so they are available to the public. ||||
 
|-
 
|-
| prepare ||||||
+
| prepare || Similar to the `configure system automatically` step, this step will prepare an AUR build environment to build Oolite. ||||
 
|-
 
|-
| pkgver ||||||
+
| pkgver || Checks the version tag of the local source code and transforms it from semver to an AUR package version number. ||||
 
|-
 
|-
 
| package || Generates the AUR package. ||||
 
| package || Generates the AUR package. ||||

Revision as of 08:23, 9 July 2026

Here is the result of this forum thread: gitversion.sh / meson.build changes

Build system.png
Build Step Description Requires Provides
configure system manually A developer will maintain his development system will all the required tools and dependencies to build Oolite. Should be supported by scripts.
checkout code Clone and checkout from the Oolite git repository so it resides in the local filesystem.
change code A developer will change code in the local filesystem to whatever extent.
meson setup
meson compile
test/debug manually A developer will test manually, focusing on the changes he/she applied.
meson test
meson install
meson uninstall
push changes Push the changes back into the Oolite repository. Likely involves commit and pull request actions.
configure system automatically Similar to the `configure system manually` step, in CI builds all this has to be scripted.
calculate version number Generates the checked out version's semver.
generate tar.gz Generates an Oolite distribution as tar ball.
generate AppImage Generates a Linux AppImage.
generate Flatpak Generates a Linux Flatpak image.
generate MSIX Generates a Windows installer for Oolite using MSIX.
generate NSIS Generates a Windows installer for Oolite using NSIS.
tag source code The CI run will tag the version in the official repository so it is available to all other steps.
upload artifacts Uploads generated artifacts to a Github Release so they are available to the public.
prepare Similar to the `configure system automatically` step, this step will prepare an AUR build environment to build Oolite.
pkgver Checks the version tag of the local source code and transforms it from semver to an AUR package version number.
package Generates the AUR package.
publish on AUR Pushes the AUR package into the AUR repository.

  1. makepkg starts
    • install prerequisites like clang, meson, jq, ...
    • checkout project
  2. run prepare() function
    • calculate official version number (semver via gitversion)
  3. run build() function
    • meson setup
    • meson compile
  4. run check() function
    • meson test
  5. run package() function
    • meson install
    • Place custom icon, desktop item for use in menus, custom launcher etc at correct places
  6. create archlinux package
  7. makepkg exits
  8. runtime tests
  9. publish on AUR

  1. pre-build
    • Iniialise a clean minimal build enviornmnet

      Many issues during or after build are due to having uncessary things being present. Whether this is done through a clean chroot, docker container, VPS, github/gitlab workflow, Virtual machine etc is an implementation detail.

    • download sourcecode

      This should include oolite sourcecode as well as the code needed for external dependencies.

    • install required dependencies

      The baseline discussed at viewtopic.php?p=304440 should make this part a lot easier./p>

      It includes building external deps that are not available in the build environment. Targets that use 'modern builds' for example require gnustep objc2.

      objc2 can only be built by clang, requires gnustep base and make to be built with clang. Also no released versions of gnustep tools support latest clang release (fixes are avaiiable). Targets that use the gcc provided libobjc don't have this need.

    • changes to sourcecode to allow succesfull builds

      example : 1.92-maintenance has 2 files that screw up things at runtime for some targets. Deleting those files is the only option. Although since we updated the dependencies this example should be outdated.

    • set/update values that can not be determined before build time.

      This includes things like sourcecode url, build environment, git commit hash.

      These values shall be passed in a JSON file inside the build directory. An example build file can look like this:

   {
       "title": "Oolite core",
       "identifier": "org.oolite.oolite",
       "required_oolite_version": "1.93",
       "license": "GPL 2+ / CC-BY-NC-SA 3.0 - see LICENSE.md for details",
       "author": "Giles Williams, Jens Ayton and contributors",
       "information_url": "https://oolite.space/",
       "expansion_catalog": "https://addons.oolite.space/api/1.0/overview/"
   }

  1. build
    • setup/configure
    • compile
    • test unpackaged
    • install <-- why is this here?
  2. post-build
  3. packaging
  4. testing package