Files
Libation/Scripts/Bundle_Redhat.sh
William Tanksley Jr 503904e6f4 Fix Linux WebView blank window on Wayland (#2129) (#2130)
* Fix Linux WebView blank window on Wayland and improve sign-in logging (#2129)

- Set WEBKIT_DISABLE_COMPOSITING_MODE=1 and WEBKIT_DISABLE_DMABUF_RENDERER=1
  on Linux startup in Program.cs so WebKitGTK does not fail silently on
  Wayland/Xwayland when hardware acceleration or DMABUF compositing is buggy.
- Add Configuration.IsWayland and Configuration.IsWaylandSession in
  LibationFileManager to detect Wayland desktop sessions.
- In AvaloniaLoginChoiceEager, only set gtkArgs.ForceX11GdkBackend = true when
  not running in a Wayland session (!Configuration.IsWayland). On Wayland
  (e.g. Fedora KDE Plasma 6), forcing X11 forces Xwayland, causing compositor
  mismatches and blank rendering.
- Add debug/warning logging for WebView adapter creation, navigation start,
  success, and failure in AvaloniaLoginChoiceEager.
- Add unit tests for Configuration.IsWaylandSession in LibationFileManager.Tests.

* Support RPM 4.20+ isolated build directory in Bundle_Redhat.sh

RPM 4.20 introduced per-package build directory isolation (%mkbuilddir),
which runs %install in %{_builddir}/%{name}-%{version}-build rather than
%{_builddir}. This caused Bundle_Redhat.sh to fail on newer runners
(e.g. GitHub Actions Ubuntu 26.04) because files were staged in %{_builddir}.

In %install, detect if files are not present in the current working directory
and copy them from %{_builddir}.
2026-11-09 08:42:02 -07:00

139 lines
3.3 KiB
Bash

#!/bin/bash
BIN_DIR=$1; shift
VERSION=$1; shift
ARCH=$1; shift
if [ -z "$BIN_DIR" ]
then
echo "This script must be called with a the Libation Linux bins directory as an argument."
exit
fi
if [ ! -d "$BIN_DIR" ]
then
echo "The directory \"$BIN_DIR\" does not exist."
exit
fi
if [ -z "$VERSION" ]
then
echo "This script must be called with the Libation version number as an argument."
exit
fi
if [ -z "$ARCH" ]
then
echo "This script must be called with the Libation cpu architecture as an argument."
exit
fi
BASEDIR=$(pwd)
delfiles=('LinuxConfigApp' 'LinuxConfigApp.deps.json' 'LinuxConfigApp.runtimeconfig.json')
if [[ "$ARCH" == "x64" ]]
then
ARCH_RPM="x86_64"
ARCH="amd64"
else
ARCH_RPM="aarch64"
fi
notinstalled=('libcoreclrtraceptprovider.so' 'libation_glass.svg' 'Libation.desktop')
mkdir -p ~/rpmbuild/SPECS
mkdir -p ~/rpmbuild/BUILD
mkdir -p ~/rpmbuild/RPMS
echo "Name: libation
Version: ${VERSION}
Release: 1
Summary: Liberate your Audible Library
License: GPLv3+
URL: https://github.com/rmcrackan/Libation
Source0: https://github.com/rmcrackan/Libation
Requires: bash gtk3 webkit2gtk4.1
%define __os_install_post %{nil}
%description
Liberate your Audible Library
%install
mkdir -p %{buildroot}%{_libdir}/%{name}
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/scalable/apps
mkdir -p %{buildroot}%{_datadir}/applications
# RPM 4.20+ runs %install in a dedicated %{name}-%{version}-build subdirectory of ~/rpmbuild/BUILD
if [ ! -f "libation_glass.svg" ] && [ -f "../libation_glass.svg" ]; then
find .. -maxdepth 1 -type f -exec cp -t . {} +
fi
if test -f 'libcoreclrtraceptprovider.so'; then
rm 'libcoreclrtraceptprovider.so'
fi
install -m 666 libation_glass.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/libation.svg
install -m 666 Libation.desktop %{buildroot}%{_datadir}/applications/Libation.desktop
rm libation_glass.svg
rm Libation.desktop
find . -maxdepth 1 -type f -exec install -t %{buildroot}%{_libdir}/%{name}/ {} +
%post
if [ \$1 -eq 1 ] ; then
# Initial installation
ln -s %{_libdir}/%{name}/Libation %{_bindir}/libation
ln -s %{_libdir}/%{name}/Hangover %{_bindir}/hangover
ln -s %{_libdir}/%{name}/LibationCli %{_bindir}/libationcli
gtk-update-icon-cache -f %{_datadir}/icons/hicolor/
if ! grep -q 'fs.inotify.max_user_instances=524288' /etc/sysctl.conf; then
echo fs.inotify.max_user_instances=524288 | tee -a /etc/sysctl.conf && sysctl -p
fi
fi
%postun
if [ \$1 -eq 0 ] ; then
# Uninstall
rm %{_bindir}/libation
rm %{_bindir}/hangover
rm %{_bindir}/libationcli
fi
%files
%{_datadir}/icons/hicolor/scalable/apps/libation.svg
%{_datadir}/applications/Libation.desktop" >> ~/rpmbuild/SPECS/libation.spec
cd "$BIN_DIR"
for f in *; do
if [[ " ${delfiles[*]} " =~ " ${f} " ]]; then
echo "Deleting $f"
elif [[ ! " ${notinstalled[*]} " =~ " ${f} " ]]; then
echo "%{_libdir}/%{name}/${f}" >> ~/rpmbuild/SPECS/libation.spec
cp $f ~/rpmbuild/BUILD/
else
cp $f ~/rpmbuild/BUILD/
fi
done
cd ~/rpmbuild/SPECS/
rpmbuild -bb --target $ARCH_RPM libation.spec
cd $BASEDIR
RPM_FILE=$(ls ~/rpmbuild/RPMS/${ARCH_RPM})
mkdir -p bundle
mv ~/rpmbuild/RPMS/${ARCH_RPM}/$RPM_FILE "./bundle/Libation.${VERSION}-linux-chardonnay-${ARCH}.rpm"