infrastructure/pipeline/build-software-adapter.sh

23 lines
1 KiB
Bash

#!/bin/bash
# Compile the frozen adapter source against the worker's Arch GNOME headers.
set -euo pipefail
source_root=$1
tools=$2
cache=$3
output=$4
mkdir -p "$output"
systemd-nspawn --quiet --ephemeral --settings=no --register=no \
--machine="archipelago-software-build-$$" -D "$tools" \
--bind-ro="$source_root/system/integrations/gnome-software:/source" \
--bind="$cache:/var/cache/pacman/pkg" --bind="$output:/output" \
/bin/bash -euo pipefail -c '
pacman-key --init
pacman-key --populate archlinux
pacman -Syu --needed --noconfirm gcc pkgconf gnome-software json-glib sysprof
pkg-config --exact-version=51.1 gnome-software
gcc -shared -fPIC -O2 -Wall -Werror=implicit-function-declaration \
-DG_LOG_DOMAIN=\"GsPluginArchipelago\" /source/gs-plugin-archipelago.c \
-o /output/libgs_plugin_archipelago.so $(pkg-config --cflags --libs gnome-software json-glib-1.0)
sha256sum /source/gs-plugin-archipelago.c /output/libgs_plugin_archipelago.so > /output/SHA256SUMS
pacman -Q > /output/packages.txt
'