From aafc387977029fca212d56597bd9e708288d4292 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Sun, 23 Nov 2025 15:07:47 +0200 Subject: [PATCH] Split package and enable documentation --- pkg.info | 10 +++++++++- source.sh | 28 ++++++++++++++++++++++++++-- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/pkg.info b/pkg.info index 8f180aa..925e473 100644 --- a/pkg.info +++ b/pkg.info @@ -1,7 +1,7 @@ name: libadwaita description: Building blocks for modern adaptive GNOME applications version: 1.8.2 -revision: 1 +revision: 2 url: https://gnome.pages.gitlab.gnome.org/libadwaita/ license: LGPL2.1-or-later architecture: any @@ -15,6 +15,7 @@ depends: - gtk4 - pango make_depends: + - gi-docgen - gobject-introspection - meson - sassc @@ -24,3 +25,10 @@ downloads: extract_to: ${BPM_SOURCE} extract_strip_components: 1 checksum: 589a6e0f4191740e8690a7d3298e16fa0d4061341b551da7abb2f030b550adb1 +split_packages: + - name: libadwaita + - name: libadwaita-demos + description: Demo applications for libadwaita + depends: + - hicolor-icon-theme + - libadwaita diff --git a/source.sh b/source.sh index 12e39ca..fd7f1c3 100644 --- a/source.sh +++ b/source.sh @@ -5,15 +5,39 @@ # The build function is executed in the source directory # This function is used to compile the source code build() { - meson setup --prefix=/usr -Dtests=false build + meson setup --prefix=/usr -Ddocumentation=true -Dtests=false build 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() { +package_libadwaita() { meson install -C build --destdir="$BPM_OUTPUT" + cd "$BPM_OUTPUT" + + # Move demo files into split package + _pick libadwaita-demos usr/bin/adwaita-1-demo + _pick libadwaita-demos usr/share/applications/org.gnome.Adwaita1.Demo.desktop + _pick libadwaita-demos usr/share/icons/hicolor/*/apps/org.gnome.Adwaita1.Demo[-.]* + _pick libadwaita-demos usr/share/metainfo/org.gnome.Adwaita1.Demo.metainfo.xml + + # Install package license + install -Dm644 "$BPM_SOURCE"/COPYING "$BPM_OUTPUT"/usr/share/licenses/libadwaita/COPYING +} + +package_libadwaita-demos() { # Install package license install -Dm644 "$BPM_SOURCE"/COPYING "$BPM_OUTPUT"/usr/share/licenses/libadwaita/COPYING }