Make PKGBUILD much less flaky and ideompotent#161
Make PKGBUILD much less flaky and ideompotent#161iacore wants to merge 3 commits intoQubesOS:masterfrom
Conversation
marmarek
left a comment
There was a problem hiding this comment.
You correctly anticipated it will break automatic builds: https://gitlab.com/QubesOS/qubes-gui-agent-linux/-/jobs/2642172318
Generally I'm fine with changing it to run makepkg from archlinux dir, but it needs to be done without breaking existing packages. Probably change something in https://github.com/QubesOS/qubes-builder-archlinux/blob/master/Makefile.archlinux#L123-L124 and make the dir conditional on some new variable in Makefile.builder in the component (gui-agent-linux here). Call it ARCH_MAKEPKG_IN_SUBDIR = 1? Any better idea for the name?
archlinux/PKGBUILD
Outdated
|
|
||
| pkgdesc="Pulseaudio support for Qubes VM" | ||
| depends=('alsa-lib' 'alsa-utils' 'pulseaudio-alsa' 'pulseaudio<=16.1') | ||
| depends=('alsa-lib' 'alsa-utils' 'pulseaudio-alsa' 'pulseaudio') |
There was a problem hiding this comment.
This should stay (but maybe let it use $pa_ver if that's allowed?) - otherwise pulseaudio update will silently break sound.
|
|
||
| for source in Makefile appvm-scripts gui-common include pulse gui-agent common xf86-input-mfndev xf86-video-dummy xf86-qubes-common window-icon-updater version; do | ||
| (ln -s $srcdir/../$source $srcdir/$source) | ||
| rm $srcdir/PKGBUILD-z-qubes-session.sh || true |
There was a problem hiding this comment.
It will still fail if the file doesn't exist. makepkg still abort if any command return non-zero.
There was a problem hiding this comment.
$ rm -f /no-such-file; echo $?
0There was a problem hiding this comment.
I removed clean(). It was for the broken build script before this patch. Now we can use makepkg -c to clean after build.
archlinux/PKGBUILD
Outdated
| pa_ver=$((pkg-config --modversion libpulse 2>/dev/null || echo 0.0) | cut -f 1 -d "-") | ||
|
|
||
| rm -f pulse/pulsecore | ||
| rm -rf pulse/pulsecore |
There was a problem hiding this comment.
-r sounds risky here - pulse/pulsecore is a symlink. If for some reason it isn't, better fail the build than remove some potentially wanted files...
There was a problem hiding this comment.
It's not symlink. Check out the git repository. It's a directory.
I made makepkg copy the files first before building, so it should be safe.
archlinux/PKGBUILD
Outdated
| pkgver=$(cat $startdir/../version) | ||
|
|
||
| clean() { | ||
| rm $srcdir/* -r || true |
There was a problem hiding this comment.
Please options before positional arguments (-r before $srcdir/*).
archlinux/PKGBUILD
Outdated
| rm $srcdir/PKGBUILD-z-qubes-session.sh || true | ||
| cp $startdir/PKGBUILD-z-qubes-session.sh $srcdir/ | ||
| for source in Makefile appvm-scripts gui-common include pulse gui-agent common xf86-input-mfndev xf86-video-dummy xf86-qubes-common window-icon-updater version; do | ||
| rm $source -r || true |
There was a problem hiding this comment.
rm -r here too. And avoid || true - if there is some specific error to ignore, prevent it from happening (I guess you meant No such file or directory here -> if [ -e "$source" ]; then rm -r "$source"; fi
archlinux/PKGBUILD
Outdated
| md5sums=() #generate with 'makepkg -g' | ||
| pa_ver=$((pkg-config --modversion libpulse 2>/dev/null || echo 0.0) | cut -f 1 -d "-") | ||
| pa_ver=16.1 #specify this manually please | ||
| # If using pkg-config, you must update libpulse first. |
There was a problem hiding this comment.
Automatic builds (via qubes-builder-archlinux) do install updates before building a package, so I'd prefer to keep it automatic (one place less to change by hand).
Now building package for archlinux is easier than before! Just run
makepkg -sinsidearchlinux/and you are good to go. No moregit cleanneeded.May break build system.
The newly produced packages are located in
archlinux/besidePKGBUILD, not at git repo root.