This commit is contained in:
MedzikUser 2022-06-20 12:09:17 +02:00
parent 782c84b35d
commit ebec184a25
No known key found for this signature in database
GPG Key ID: A5FAC1E185C112DB
2 changed files with 55 additions and 37 deletions

View File

@ -7,7 +7,9 @@ OUT_DIR="/mnt/out"
TMP_DIR="$(mktemp -d -t medzik-aur-XXXX)"
SCRIPT_DIR="$(realpath "$(dirname "$0")"/scripts)"
# load lib
source "${SCRIPT_DIR}/lib/parse-conf.sh"
source "${SCRIPT_DIR}/lib/build/patches.sh"
# change owner of the directories in /mnt to the current user
sudo chown -R $(id -u) /mnt/*
@ -30,39 +32,9 @@ mkdir -p "${PACKAGES_TO_BUILD_DIR}"
# check which packages to build
while IFS= read -r pkg
do
touch "${PACKAGES_TO_BUILD_DIR}/${pkg}"
built "${pkg}"
done < "${SRC_DIR}/built_packages.txt"
patches() {
pkgname="${1}"
if [ "${BUILD_ARCH}" = "x86-64-v3" ]
then
case "${pkgname}" in
"proton"* | "dxvk-mingw" | "vkd3d-proton-mingw" | "wine-ge-custom")
echo "[i] march patch"
sed -i 's|-march=nocona -mtune=core-avx2|-march=x86-64-v3|g' PKGBUILD
;;
"linux-xanmod"*)
export _microarchitecture=93
;;
esac
else
case "${pkgname}" in
"linux-xanmod"*)
export _microarchitecture=0
;;
esac
fi
case "${pkgname}" in
"winesync")
export _provide_nondkms=false
sed -i 's|_provide_nondkms=true|_provide_nondkms=false|g' PKGBUILD
;;
esac
}
built() {
pkgname="${1}"
pkgdir="${SRC_DIR}/packages/${pkgname}"
@ -94,7 +66,7 @@ built() {
# run custom patches
echo "[i] Running custom patches..."
patches "${pkgname}"
patches
echo "[i] Installing dependencies..."
for (( i=0; i<15; i++ ))
@ -127,11 +99,6 @@ built() {
echo "::endgroup::"
}
for file in "${PACKAGES_TO_BUILD_DIR}"/*
do
built "$(basename ${file})"
done
if [ -f "${SRC_DIR}/fail_built.txt" ]
then
printf "\n\nFailed to build:\n"

View File

@ -0,0 +1,51 @@
#!/bin/bash
function patches() {
local pkgname="${1}"
if [ "${BUILD_ARCH}" = "x86-64-v3" ]
then
patches-x86-64-v3 "${pkgname}"
else
patches-x86-64 "${pkgname}"
fi
patches-all
}
# Patches for a `x86-64-v3` arch
function patches-x86-64-v3() {
local pkgname="${1}"
case "${pkgname}" in
"proton"* | "dxvk-mingw" | "vkd3d-proton-mingw" | "wine-ge-custom")
echo "[i] march patch"
sed -i 's|-march=nocona -mtune=core-avx2|-march=x86-64-v3|g' PKGBUILD
;;
"linux-xanmod"*)
export _microarchitecture=93
;;
esac
}
# Patches for a `x86-64` arch
function patches-x86-64() {
local pkgname="${1}"
case "${pkgname}" in
"linux-xanmod"*)
export _microarchitecture=0
;;
esac
}
# Patches for all arches
function patches-all() {
local pkgname="${1}"
case "${pkgname}" in
"winesync")
export _microarchitecture=0
;;
esac
}