# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package # BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE # BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT # The build function is executed in the source directory # This function is used to compile the source code build() { meson setup build --prefix=/usr --buildtype=release -Ddocumentation=true -Dman=true meson compile -C build } _pick() { local p="$1" f d; shift for f; do [ -d "$BPM_WORKDIR"/output_"$p" ] || { echo "Split package $p not found"; exit 1; } d="$BPM_WORKDIR"/output_"$p"/"${f#$BPM_OUTPUT}" mkdir -p "$(dirname "$d")" mv "$f" "$d" rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")" done } # The package function is executed in the source directory # This function is used to move the compiled files into the output directory package_gnome-online-accounts() { meson install -C build --destdir="$BPM_OUTPUT" cd "$BPM_OUTPUT" # Move libgoa files into split package _pick libgoa usr/include/goa-1.0/goa _pick libgoa usr/lib/libgoa-1.0.so* _pick libgoa usr/lib/girepository-1.0/Goa-1.0.typelib _pick libgoa usr/lib/goa-1.0/include _pick libgoa usr/lib/pkgconfig/goa-1.0.pc _pick libgoa usr/share/gir-1.0/Goa-1.0.gir _pick libgoa usr/share/vala/vapi/goa-1.0.* _pick libgoa usr/share/doc # Install package license install -Dm644 "$BPM_SOURCE"/COPYING "$BPM_OUTPUT"/usr/share/licenses/gnome-online-accounts/COPYING } package_libgoa() { # Install package license install -Dm644 "$BPM_SOURCE"/COPYING "$BPM_OUTPUT"/usr/share/licenses/gnome-online-accounts/COPYING }