fix ttf-ms-win11-auto

This commit is contained in:
bgme 2023-05-20 14:19:33 +08:00
parent 5b5b3b44d4
commit 760f988efa
2 changed files with 35 additions and 2 deletions

View file

@ -0,0 +1,35 @@
from lilaclib import *
import subprocess
def apply_patch(filename, patch):
patch_proc = subprocess.Popen(["patch", "-p1", filename], stdin=subprocess.PIPE, text=True)
patch_proc.communicate(patch)
def pre_build():
aur_pre_build()
apply_patch('PKGBUILD', PATCH)
PATCH=r"""
diff --git a/PKGBUILD b/PKGBUILD
index 7c63329..457ba24 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -401,13 +401,11 @@ prepare() {
echo "- Fonts are missing"
echo -ne "- Mount filesystems as a non-privileged user: "
touch test.mount
- _unprivilegedMountAllowed=false
- _testLoopDev=$(udisksctl loop-setup -r -f test.mount --no-user-interaction | awk '{print $NF}') && _unprivilegedMountAllowed=true
- _testLoopDev=${_testLoopDev::-1}
- udisksctl loop-delete -b "$_testLoopDev" --no-user-interaction
+ _mount=
+ udisksctl loop-setup -r -f test.mount --no-user-interaction >/dev/null 2>&1 && _mount=true
rm test.mount
- if [ $_unprivilegedMountAllowed ]; then
+ if [ $_mount ]; then
echo "allowed"
echo "- Downloading fonts directly"
mkdir -p mnt/http
"""

View file

@ -7,8 +7,6 @@ repo_depends:
build_prefix: extra-x86_64
pre_build: aur_pre_build
post_build: aur_post_build
update_on: