-
-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make PKGBUILD much less flaky and ideompotent #161
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -71,9 +88,8 @@ install -D $srcdir/PKGBUILD-z-qubes-session.sh $pkgdir/etc/X11/xinit/xinitrc.d/z | |||
package_qubes-vm-pulseaudio() { | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should stay (but maybe let it use $pa_ver
if that's allowed?) - otherwise pulseaudio update will silently break sound.
|
||
build() { | ||
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rm -f
instead of || true
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ rm -f /no-such-file; echo $?
0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
|
||
rm -f pulse/pulsecore | ||
rm -rf pulse/pulsecore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 -s
insidearchlinux/
and you are good to go. No moregit clean
needed.May break build system.
The newly produced packages are located in
archlinux/
besidePKGBUILD
, not at git repo root.