From 05271e9cb0e8ba29d4af32d29f5f52790b830c04 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Thu, 17 Jul 2025 13:33:15 +0300 Subject: [PATCH] Split package --- check-version.sh | 21 +++++++++++++++++++++ pkg.info | 10 ++++++++-- source.sh | 38 ++++++++++++++++++++++++++++++++++---- 3 files changed, 63 insertions(+), 6 deletions(-) create mode 100644 check-version.sh diff --git a/check-version.sh b/check-version.sh new file mode 100644 index 0000000..39dd920 --- /dev/null +++ b/check-version.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Gitlab repository +REPO="pulseaudio/pulseaudio" + +# Replace slash with URL encoded representation +REPO=$(echo "$REPO" | sed 's|/|%2F|g') + +# Get tag name using Gitlab Rest API +TAG_NAME=$(curl -s -L https://gitlab.freedesktop.org/api/v4/projects/"$REPO"/repository/tags | jq -r '.[0].name') + +# Trim '-gitlab' suffix +TAG_NAME=$(echo "$TAG_NAME" | sed 's/-gitlab//g') + +# Get version number from tag name +VERSION=$(echo "$TAG_NAME" | rev | cut -d'-' -f1 | rev) + +# Trim 'v' character in VERSION variable +VERSION=$(echo "$VERSION" | tr -d 'v') + +echo "$VERSION" diff --git a/pkg.info b/pkg.info index 5701103..7e6bb7b 100644 --- a/pkg.info +++ b/pkg.info @@ -1,9 +1,15 @@ name: pulseaudio description: Sound server for POSIX OSes including Linux version: 17.0 +revision: 2 url: https://www.freedesktop.org/wiki/Software/PulseAudio/ license: LGPL2.1-or-later architecture: any -depends: ["alsa-lib","dbus","elogind","fftw","gcc","glib","glibc","libcap","libice","libsm","libsndfile","libtool","libxtst","speexdsp"] -make_depends: ["attr","check","gtk3","meson","openssl","perl-xml-parser","valgrind"] +make_depends: ["alsa-lib","dbus","elogind","fftw","gcc","glib","glibc","libcap","libice","libsm","libsndfile","libtool","libxtst","speexdsp","attr","check","gtk3","meson","openssl","perl-xml-parser","valgrind"] type: source +split_packages: + - name: pulseaudio + depends: ["alsa-lib","dbus","elogind","fftw","gcc","glib","glibc","libcap","libice","libpulse","libsm","libsndfile","libtool","libxtst","speexdsp"] + - name: libpulse + description: Pulseaudio shared libraries + depends: ["dbus","glib","glibc","libsndfile","libxcb"] diff --git a/source.sh b/source.sh index 84e081a..7c491ea 100644 --- a/source.sh +++ b/source.sh @@ -37,11 +37,41 @@ check() { ninja test } -# The package function is executed in the source directory -# This function is used to move the compiled files into the output directory -package() { +package_libpulse() { cd build - DESTDIR="$BPM_OUTPUT" ninja install + # Replace 'output' directory with 'output-libpulse' + rmdir "$BPM_OUTPUT" + mv "$BPM_SOURCE"/output-libpulse "$BPM_OUTPUT" + + # Install package license + install -Dm644 "$BPM_SOURCE"/LICENSE "$BPM_OUTPUT"/usr/share/licenses/pulseaudio/LICENSE +} + +package_pulseaudio() { + cd build + + DESTDIR="$BPM_OUTPUT" ninja install + + # Move libraries to temporary directory for libpulse package + mkdir "$BPM_SOURCE"/output-libpulse + install -d "$BPM_SOURCE"/output-libpulse/usr/bin + install -d "$BPM_SOURCE"/output-libpulse/usr/lib + install -d "$BPM_SOURCE"/output-libpulse/usr/share/{,man/man1,man/man5,bash-completion/completions} + mv "$BPM_OUTPUT"/usr/bin/pa{cat,ctl,dsp,mon,play,rec,record} -t "$BPM_SOURCE"/output-libpulse/usr/bin/ + mv "$BPM_OUTPUT"/usr/lib/*.so* -t "$BPM_SOURCE"/output-libpulse/usr/lib/ + mv "$BPM_OUTPUT"/usr/lib/pulseaudio -t "$BPM_SOURCE"/output-libpulse/usr/lib/ + mv "$BPM_OUTPUT"/usr/lib/{cmake,pkgconfig} -t "$BPM_SOURCE"/output-libpulse/usr/lib/ + mv "$BPM_OUTPUT"/usr/include -t "$BPM_SOURCE"/output-libpulse/usr/ + mv "$BPM_OUTPUT"/usr/share/vala -t "$BPM_SOURCE"/output-libpulse/usr/share + mv "$BPM_OUTPUT"/usr/share/bash-completion/completions/{pulseaudio,pacat,pactl,padsp,paplay,parec,parecord} -t "$BPM_SOURCE"/output-libpulse/usr/share/bash-completion/completions/ + mv "$BPM_OUTPUT"/usr/share/zsh -t "$BPM_SOURCE"/output-libpulse/usr/share + mv "$BPM_OUTPUT"/usr/share/man/man1/{pacat,pactl,padsp,paplay,parec,parecord}.1 -t "$BPM_SOURCE"/output-libpulse/usr/share/man/man1/ + mv "$BPM_OUTPUT"/usr/share/man/man5/pulse-client.conf.5 -t "$BPM_SOURCE"/output-libpulse/usr/share/man/man5/ + + # Remove system-wide dbus service + rm "$BPM_OUTPUT"/usr/share/dbus-1/system.d/pulseaudio-system.conf + + # Install package license install -Dm644 "$BPM_SOURCE"/LICENSE "$BPM_OUTPUT"/usr/share/licenses/pulseaudio/LICENSE }