Skip to content

Allow sources to access their element's variables

Summary

Sometimes, it can be useful to define a 'version' or another variable that both source(s) and the element need, in order to not repeat oneself.

An example of that could be if trying to build openjdk:

kind: make

variables: version: 232 build: 05

sources:

  • kind: tar url: openjdk:jdk8u/jdk8u/archive/jdk8u232-b05.tar.bz2 ref: ed87467e24c623396eae0bb2057bc2a8b8fd0ed30843e9413e578c7b3e5c689f
  • kind: tar url: openjdk:jdk8u/jdk8u/langtools/archive/jdk8u232-b05.tar.bz2 ref: 812c70931157f5ba41e178b6e394a8552f15f53d0171d2f1b66537c9a76d5cc9 directory: langtools
  • kind: tar url: openjdk:jdk8u/jdk8u/hotspot/archive/jdk8u232-b05.tar.bz2 directory: hotspot ref: 820da1b5dcfece8f249395b45983984c6c82886d78cbd1183faa98ad5497e8b8

config: configure-commands:

  • | bash %{build-root}/configure
    --with-freetype-include=/usr/include/freetype2
    --with-freetype-lib=/usr/lib/x86_64-linux-gnu
    --with-update-version=%{version}
    --with-build-number=%{build}

Notice how the '232' and the '05' are duplicated in each source, in addition to being needed in the element.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information