-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathiculess-libxml2.sh
57 lines (46 loc) · 1.07 KB
/
iculess-libxml2.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/sh
set -x
ARCH="$(uname -m)"
_build_libxml2() (
rm -rf ./libxml2 || true
git clone https://gitlab.archlinux.org/archlinux/packaging/packages/libxml2.git libxml2
cd ./libxml2
# They switched to meson, so we will build the very last commit before that TODO FIX
git reset --hard 7bc1d289ed0bc1cf7c63c8b9f109b13cb3523785
# remove the line that enables icu support
sed -i '/--with-icu/d' ./PKGBUILD
case "${ARCH}" in
"x86_64")
EXT="zst"
;;
"aarch64")
EXT="xz"
sed -i "s/x86_64/${ARCH}/" ./PKGBUILD
;;
*)
echo "Unsupported Arch: '${ARCH}'"
exit 1
;;
esac
cat ./PKGBUILD
makepkg -f --skippgpcheck || return 1
ls -la
rm -f ./libxml2-docs-*.pkg.tar.* ./libxml2-debug-*-x86_64.pkg.tar.*
mv ./libxml2-*.pkg.tar.${EXT} ../libxml2-iculess-${ARCH}.pkg.tar.${EXT} || return 1
cd ..
rm -rf ./libxml2
)
COUNT=0
while [ "$COUNT" -le 5 ]; do
if ! _build_libxml2; then
COUNT=$((COUNT + 1))
echo "Failed, trying $COUNT time"
else
break
fi
done
if [ "$COUNT" -gt 5 ]; then
echo "Failed to build libxml2 5 times"
exit 1
fi
echo "All done!"