blob: bf1b6d1a4b2b59649fa8a623ebac965b62d51611 [file] [log] [blame]
# Project name
name: webkit-sdk
# The minimum base BuildStream format
format-version: 17
# Where elements are stored
element-path: elements
fatal-warnings:
- overlaps
# Options to specify for the project, these provide
# command line switches which control the behavior of
# conditional directives in the element.bst files.
#
options:
arch:
type: arch
description: Machine architecture
variable: arch
values:
- aarch64
- x86_64
bootstrap_build_arch:
type: arch
description: Bootstrap build machine architecture
variable: bootstrap_build_arch
values:
- aarch64
- x86_64
# Source aliases.
#
# These are used in the individual element.bst files in
# place of specifying full uris.
#
# The location from where source code is downloaded can
# be changed without triggering a rebuild.
#
aliases:
ffmpeg: https://git.ffmpeg.org/
gitlab_freedesktop_org: https://gitlab.freedesktop.org/
github_com: https://github.com/
#(github_files is an alias for the same url as github, but doesn't use the same mirror)
github_files: https://github.com/
gitlab_com: https://gitlab.com/
gitlab_gnome_org: https://gitlab.gnome.org/
raw_githubusercontent_com: https://raw.githubusercontent.com/
gnome_downloads: https://download.gnome.org/sources/
gst_downloads: https://gstreamer.freedesktop.org/src/
ruby_gems: https://rubygems.org/downloads/
kde: https://invent.kde.org/qt/qt/
pypi: https://files.pythonhosted.org/packages/
vlc: https://code.videolan.org/
# Some overrides to the default sandbox execution environment
#
environment:
LC_ALL: en_US.UTF-8
LD_LIBRARY_PATH: '%{libdir}'
PATH: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig:%{libdir}/pkgconfig
(?):
- arch == "x86_64":
CFLAGS: "%{flags_x86_64}"
CXXFLAGS: "%{flags_x86_64}"
LDFLAGS: "%{ldflags_defaults}"
- arch == "aarch64":
CFLAGS: "%{flags_aarch64}"
CXXFLAGS: "%{flags_aarch64}"
LDFLAGS: "%{ldflags_defaults}"
# Some overrides to element configuration based on type
#
# Here we can set a project wide options for various build systems,
# e.g. we can add --disable-gtk-doc to every `./configure` line.
elements:
autotools:
variables:
conf-global: --disable-static --disable-Werror --host=%{triplet} --build=%{triplet}
# Temporary workaround to avoid regenerating existing
# configure scripts when building tarballs.
#
# We can remove this after addressing the upstream issue:
#
# https://gitlab.com/BuildStream/buildstream/issues/256
#
# XXX: updating config.{sub,guess} would be still useful in that case
# to fix compilation on recent architectures such as aarch64.
autogen: |
export NOCONFIGURE=1
if [ -x %{conf-cmd} ]; then cp -f /usr/share/automake*/config.{sub,guess} %{conf-aux}
elif [ -x autogen ]; then ./autogen
elif [ -x autogen.sh ]; then ./autogen.sh
elif [ -x bootstrap ]; then ./bootstrap
elif [ -x bootstrap.sh ]; then ./bootstrap.sh
else autoreconf -ivf
fi
# the directory where config.sub and config.guess are stored
conf-aux: .
cmake:
variables:
cmake-global: -DCMAKE_BUILD_TYPE=RelWithDebInfo
generator: Ninja
distutils:
variables:
prefix: /usr/local
python-install: '%{python} setup.py install --root "%{install-root}"'
fix-pyc-timestamps: ''
config:
install-commands:
(>):
# There's no way to get the setup.py to install this in the right place.
- |
if [ -d '%{install-root}/usr/lib/pkgconfig/' ]; then
mkdir -p %{install-root}/usr/%{lib}/
mv -f %{install-root}/usr/lib/pkgconfig/ %{install-root}/usr/%{lib}/
fi
meson:
variables:
meson-global: --buildtype=plain --auto-features=enabled
pip:
variables:
pip: pip3
fix-pyc-timestamps: "true"
config:
install-commands:
- |
%{pip} install --no-build-isolation --no-deps --root=%{install-root} --prefix=%{prefix} .
filter:
config:
include-orphans: true
sources:
git_tag:
config:
checkout-submodules: false
track-tags: false
split-rules:
devel:
(>):
- '%{libdir}/cmake'
- '%{libdir}/cmake/**'
- '%{libdir}/cmake/**'
- '%{datadir}/gir-1.0/**'
vm:
- '%{datadir}/dbus-1/**'
# Define some behavior for `bst shell`
#
shell:
# Default command for `bst shell`, we prefer bash, and disable
# parsing of profile and rc files so that the prompt BuildStream
# sets is not overwritten.
command: ['bash', '--noprofile', '--norc', '-i']
# Some environment variables to inherit from the host environment
environment:
LANG: '$LANG'
DISPLAY: '$DISPLAY'
DBUS_SESSION_BUS_ADDRESS: '$DBUS_SESSION_BUS_ADDRESS'
XDG_RUNTIME_DIR: '$XDG_RUNTIME_DIR'
# Inform applications which use pulseaudio of the server socket
PULSE_SERVER: 'unix:${XDG_RUNTIME_DIR}/pulse/native'
# Some things to mount into the sandbox
host-files:
# Understand user inherited uid/gid
- '/etc/passwd'
- '/etc/group'
# Allow network resolution
- '/etc/resolv.conf'
# Allow access to plausible video devices,
# declare these optional to avoid meaningless warnings
- path: '/dev/dri'
optional: true
- path: '/dev/mali'
optional: true
- path: '/dev/mali0'
optional: true
- path: '/dev/umplock'
optional: true
- path: '/dev/nvidiactl'
optional: true
- path: '/dev/nvidia0'
optional: true
- path: '/dev/nvidia-modeset'
optional: true
# Allow access to sysfs, needed for local device discovery
- '/sys'
# Allow access to the user runtime directory, this
# will include the pulseaudio socket along with some
# other things.
- '${XDG_RUNTIME_DIR}'
variables:
sdk-branch: "21.08"
gcc_arch: "%{arch}"
abi: "gnu"
gcc_triplet: "%{gcc_arch}-linux-%{abi}"
triplet: "%{arch}-unknown-linux-%{abi}"
lib: "lib/%{gcc_triplet}"
sbindir: "%{bindir}"
sysconfdir: "/etc"
localstatedir: "/var"
indep-libdir: "%{prefix}/lib"
debugdir: "%{indep-libdir}/debug"
common_flags: "-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions\
\ -fstack-protector-strong -grecord-gcc-switches"
flags_x86_64: "-march=x86-64 -mtune=generic %{common_flags} -fasynchronous-unwind-tables\
\ -fstack-clash-protection -fcf-protection"
flags_aarch64: "%{common_flags} -fasynchronous-unwind-tables -fstack-clash-protection"
ldflags_defaults: "-Wl,-z,relro,-z,now -Wl,--as-needed -L%{libdir}"
# This should eventually done with buildstream includes
strip-binaries: |
touch source-files
find "%{install-root}" -type f \
'(' -perm -111 -o -name '*.so*' \
-o -name '*.cmxs' -o -name '*.node' ')' \
-print0 | while read -r -d $'\0' file; do
read -n4 hdr <"${file}" || continue # check for elf header
if [ "$hdr" != "$(printf \\x7fELF)" ]; then
continue
fi
if objdump -j .gnu_debuglink -s "${file}" &>/dev/null; then
continue
fi
case "${file}" in
"%{install-root}%{debugdir}/"*)
continue
;;
*)
;;
esac
realpath="$(realpath -s --relative-to="%{install-root}" "${file}")"
debugfile="%{install-root}%{debugdir}/${realpath}.debug"
mkdir -p "$(dirname "$debugfile")"
debugedit -i --list-file=source-files.part --base-dir="%{build-root}" --dest-dir="%{debugdir}/source/%{element-name}" "${file}"
cat source-files.part >>source-files
objcopy %{objcopy-extract-args} "${file}" "$debugfile"
chmod 644 "$debugfile"
mode="$(stat -c 0%a "${file}")"
[ -w "${file}" ] || chmod +w "${file}"
strip %{strip-args} "${file}"
objcopy %{objcopy-link-args} "$debugfile" "${file}"
chmod "${mode}" "${file}"
done
sort -zu <source-files | while read -r -d $'\0' source; do
dst="%{install-root}%{debugdir}/source/%{element-name}/${source}"
src="%{build-root}/${source}"
if [ -d "${src}" ]; then
install -m0755 -d "${dst}"
continue
fi
[ -f "${src}" ] || continue
install -m0644 -D "${src}" "${dst}"
done
plugins:
- origin: pip
package-name: buildstream-external
elements:
flatpak_image: 0
flatpak_repo: 0
collect_manifest: 0
sources:
cargo: 0
git_tag: 1