Newer
Older
{{- $apt_debug := or .apt_debug "" -}}
{{- $architecture := or .architecture "amd64" -}}
{{- $suite := or .suite "stretch" -}}
{{- $flatpak_arch := or .flatpak_arch $architecture -}}
{{- $packages := or .packages "" -}}
{{- $post_script := or .post_script "" -}}
{{- $sdk := or .sdk "" -}}
{{- $sdk_packages := or .sdk_packages "" -}}
{{- $sdk_post_script := or .sdk_post_script "" -}}
{{- $platform_post_script := or .platform_post_script "" -}}
{{- $strip_source_version_suffix := or .strip_source_version_suffix "" -}}
{{- $build_id := or .build_id "" -}}
{{- $ospack := or .ospack (printf "base-%s-%s.tar.gz" $suite $architecture) -}}
{{- $runtime := .runtime -}}
{{- $runtime_branch := or .runtime_branch "master" -}}
{{- $artifact_prefix := or .artifact_prefix (printf "%s-%s-%s" $runtime $flatpak_arch $runtime_branch) -}}
{{- $sysroot_prefix := or .sysroot_prefix (printf "%s-sysroot" $artifact_prefix) -}}
{{- $sysroot_tarball := or .sysroot_tarball "" -}}
{{- $ostree_prefix := or .ostree_prefix (printf "%s-runtime" $artifact_prefix) -}}
{{- $ostree_tarball := or .ostree_tarball (printf "%s.tar.gz" $ostree_prefix) -}}
{{- $sources_prefix := or .sources_prefix (printf "%s-sources" $artifact_prefix) -}}
{{- $sources_tarball := or .sources_tarball (printf "%s.tar.gz" $sources_prefix) -}}
{{- $debug_prefix := or .debug_prefix (printf "%s-debug" $artifact_prefix) -}}
{{- $debug_tarball := or .debug_tarball (printf "%s.tar.gz" $debug_prefix) -}}
architecture: {{ $architecture }}
actions:
- action: unpack
compression: gz
file: {{ $ospack }}
# TODO: This duplicates what we should have done in debos-base.yaml
- action: run
chroot: false
command: '"$RECIPEDIR/disable-services" "$ROOTDIR"'
# TODO: This duplicates what we should have done in debos-base.yaml
- action: run
chroot: false
command: '"$RECIPEDIR/clean-up-base" "$ROOTDIR"'
- action: run
chroot: false
command: '"$RECIPEDIR/prepare-runtime" "$ROOTDIR"'
{{ if $packages }}
{{ if $apt_debug }}
- action: run
chroot: false
command: $RECIPEDIR/apt-install "$ROOTDIR" "$RECIPEDIR/runtimes/{{ $runtime }}/packages.yaml"
{{ else }}
- action: apt
recommends: false
packages: {{ $packages }}
{{ end }}
# TODO: Everything before this step is common to the Platform and SDK
# We do this as a separate step in case it involves removing any
# of the common packages
{{ if and $sdk $sdk_packages }}
{{ if $apt_debug }}
- action: run
chroot: false
command: $RECIPEDIR/apt-install "$ROOTDIR" "$RECIPEDIR/runtimes/{{ $runtime }}/sdk_packages.yaml"
{{ else }}
- action: apt
recommends: false
packages: {{ $sdk_packages }}
{{ end }}
chroot: false
command: '"$RECIPEDIR/platformize" "$ROOTDIR"'
{{ end }}
chroot: false
command: '"$RECIPEDIR/purge-conffiles" "$ROOTDIR"'
chroot: true
script: '{{ $post_script }}'
{{ end }}
{{ if $sdk }}
{{ if $sdk_post_script }}
- action: run
chroot: true
script: '{{ $sdk_post_script }}'
{{ end }}
{{ else }}
{{ if $platform_post_script }}
- action: run
chroot: true
script: '{{ $platform_post_script }}'
{{ end }}
{{ end }}
chroot: false
command: '"$RECIPEDIR/purge-conffiles" "$ROOTDIR"'
command: |
"$RECIPEDIR/write-manifest" "$ROOTDIR"
cp "$ROOTDIR/usr/manifest.dpkg" "$ARTIFACTDIR/{{ $artifact_prefix }}.manifest.dpkg"
cp "$ROOTDIR/usr/manifest.dpkg.built-using" "$ARTIFACTDIR/{{ $artifact_prefix }}.manifest.dpkg.built-using"
cp "$ROOTDIR/usr/manifest.deb822.gz" "$ARTIFACTDIR/{{ $artifact_prefix }}.manifest.deb822.gz"
if test -e "$ROOTDIR/usr/lib/os-release" && test -n "{{ $build_id }}"; then
sed -n -i -e '/^BUILD_ID=/!p' "$ROOTDIR/usr/lib/os-release"
echo 'BUILD_ID="{{ $build_id }}"' >> "$ROOTDIR/usr/lib/os-release"
cp "$ROOTDIR/usr/lib/os-release" "$ARTIFACTDIR/{{ $artifact_prefix }}.os-release.txt"
fi
chroot: false
command: 'cp "$RECIPEDIR/manifest.dpkg.platform" "$ROOTDIR/usr"'
- action: run
chroot: false
command: 'cp "$RECIPEDIR/manifest.dpkg.built-using.platform" "$ROOTDIR/usr"'
chroot: false
command: 'cp "$RECIPEDIR/manifest.platform.deb822.gz" "$ROOTDIR/usr"'
chroot: false
command: '"$RECIPEDIR/collect-source-code" --strip-source-version-suffix="{{ $strip_source_version_suffix }}" "$ROOTDIR"'
{{ else }}
- action: run
chroot: false
command: 'cp "$ROOTDIR/usr/manifest.dpkg" "$RECIPEDIR/manifest.dpkg.platform"'
- action: run
chroot: false
command: 'cp "$ROOTDIR/usr/manifest.dpkg.built-using" "$RECIPEDIR/manifest.dpkg.built-using.platform"'
chroot: false
command: 'mv "$ROOTDIR/usr/manifest.deb822.gz" "$RECIPEDIR/manifest.platform.deb822.gz"'
chroot: true
command: 'dpkg --purge --force-remove-essential --force-depends dpkg'
{{ end }}
- action: run
chroot: false
command: '"$RECIPEDIR/usrmerge" "$ROOTDIR"'
- action: overlay
source: runtimes/{{ $runtime }}/overlay
chroot: true
script: put-ldconfig-in-path
- action: run
label: clean-up-before-pack
chroot: false
command: '"$RECIPEDIR/clean-up-before-pack" "$ROOTDIR"'
{{ if $sysroot_tarball }}
- action: run
label: pack sysroot tarball
chroot: false
command: >
echo;
tar -zcf "$ARTIFACTDIR/{{ $sysroot_tarball }}"
--numeric-owner
--sort=name
-C "$ROOTDIR"
--exclude="./script"
--exclude="./src"
--exclude="./usr/lib/debug"
--transform="s,^./,,"
.
{{ end }}
- action: run
label: symlink-alternatives
chroot: true
script: symlink-alternatives
chroot: false
command: '"$RECIPEDIR/make-flatpak-friendly" --sdk "$ROOTDIR"'
{{ else }}
- action: run
chroot: false
command: '"$RECIPEDIR/make-flatpak-friendly" "$ROOTDIR"'
{{ end }}
# TODO: Move zoneinfo, locales into extensions
# TODO: Hook point for GL, instead of just Mesa
# TODO: GStreamer extension
# TODO: Icon theme, Gtk theme extension
# TODO: VAAPI extension
# TODO: SDK extension
# TODO: ca-certificates extension to get newer certs?
- action: run
command: >
echo;
tar -zcf "$ARTIFACTDIR/{{ $ostree_tarball }}"
--numeric-owner
--sort=name
-C "$ROOTDIR"
files metadata
command: >
echo;
tar -zcf "$ARTIFACTDIR/{{ $sources_tarball }}"
--numeric-owner
--sort=name
--transform="s,^./,,"
-C "$ROOTDIR/src"
.
- action: run
label: pack debug symbols
chroot: false
command: >
echo;
tar -zcf "$ARTIFACTDIR/{{ $debug_tarball }}"
--numeric-owner
--sort=name
--transform="s,^./,,"
-C "$ROOTDIR/debug"
.
- action: run
label: list of missing source code
chroot: false
command: >
test ! -e "$ROOTDIR/src/MISSING.txt" ||
cp -v "$ROOTDIR/src/MISSING.txt"
"$ARTIFACTDIR/{{ $sources_prefix }}.MISSING.txt"