|
@ -101,18 +101,15 @@ function INFO_SEP() { printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' - ; |
|
|
|
|
|
|
|
|
########################################################### |
|
|
########################################################### |
|
|
|
|
|
|
|
|
# If the script is interrupted (Ctrl+C/SIGINT), do the following |
|
|
|
|
|
|
|
|
# TODO Shall we remove git folders or keep them? |
|
|
|
|
|
dxvk_wine_cleanlist=('*.patch' '*.diff' 'pkg' 'src' '*-patches' '*.tar.xz' '*.sig') |
|
|
|
|
|
|
|
|
function Arch_intCleanup() { |
|
|
|
|
|
rm -rf ${ARCH_BUILDROOT}/{0-wine-staging-git/{wine-patches,*.tar.xz,*.sig},0-dxvk-git/{dxvk-git,*.tar.xz,*.sig}} |
|
|
|
|
|
exit 0 |
|
|
|
|
|
|
|
|
function cleanUp() { |
|
|
|
|
|
rm -rf ${ARCH_BUILDROOT}/*/{$(echo "${dxvk_wine_cleanlist[@]}" | tr ' ' ',')} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
# Allow interruption of the script at any time (Ctrl + C) |
|
|
# Allow interruption of the script at any time (Ctrl + C) |
|
|
trap "Arch_intCleanup" INT |
|
|
|
|
|
|
|
|
|
|
|
# Error event |
|
|
|
|
|
#trap "Arch_intCleanup" ERR |
|
|
|
|
|
|
|
|
trap "cleanUp" SIGINT SIGTERM SIGQUIT |
|
|
|
|
|
|
|
|
########################################################### |
|
|
########################################################### |
|
|
|
|
|
|
|
@ -130,14 +127,21 @@ function ccacheCheck() { |
|
|
|
|
|
|
|
|
function checkFiles() { |
|
|
function checkFiles() { |
|
|
|
|
|
|
|
|
local wine_files=('30-win32-aliases.conf' 'PKGBUILD') |
|
|
|
|
|
local dxvk_files=('PKGBUILD') |
|
|
|
|
|
|
|
|
local wine_files |
|
|
|
|
|
local dxvk_files |
|
|
|
|
|
|
|
|
|
|
|
wine_files=('30-win32-aliases.conf' 'PKGBUILD') |
|
|
|
|
|
dxvk_files=('PKGBUILD') |
|
|
|
|
|
|
|
|
function validatefiles() { |
|
|
function validatefiles() { |
|
|
|
|
|
|
|
|
local list=${1} |
|
|
|
|
|
local name=${2} |
|
|
|
|
|
local path=${3} |
|
|
|
|
|
|
|
|
local list |
|
|
|
|
|
local name |
|
|
|
|
|
local path |
|
|
|
|
|
|
|
|
|
|
|
list=${1} |
|
|
|
|
|
name=${2} |
|
|
|
|
|
path=${3} |
|
|
|
|
|
|
|
|
for file in ${list[@]}; do |
|
|
for file in ${list[@]}; do |
|
|
if [[ ! -f "${path}/${file}" ]]; then |
|
|
if [[ ! -f "${path}/${file}" ]]; then |
|
@ -184,44 +188,51 @@ function checkStaging() { |
|
|
# annoying situations which could occur later while the script |
|
|
# annoying situations which could occur later while the script |
|
|
# is already running. |
|
|
# is already running. |
|
|
|
|
|
|
|
|
# Just for "packages which are not found" array <=> ERRPKGS |
|
|
|
|
|
|
|
|
# Just for "packages which are not found" array <=> errpkgs |
|
|
# We need to set it outside of checkDepends function |
|
|
# We need to set it outside of checkDepends function |
|
|
# because it is a global variable for all checked packages |
|
|
# because it is a global variable for all checked packages |
|
|
l=0 |
|
|
l=0 |
|
|
|
|
|
|
|
|
function checkDepends() { |
|
|
function checkDepends() { |
|
|
|
|
|
|
|
|
# The first and the second argument |
|
|
|
|
|
local packagedir=${1} |
|
|
|
|
|
local package=${2} |
|
|
|
|
|
|
|
|
local packagedir |
|
|
|
|
|
local package |
|
|
|
|
|
local file |
|
|
|
|
|
local file_vars |
|
|
|
|
|
local field |
|
|
|
|
|
local i |
|
|
|
|
|
local pkgs |
|
|
|
|
|
|
|
|
|
|
|
packagedir=${1} |
|
|
|
|
|
package=${2} |
|
|
|
|
|
|
|
|
# We get necessary variables to check from this file |
|
|
# We get necessary variables to check from this file |
|
|
local file="./${packagedir}/PKGBUILD" |
|
|
|
|
|
|
|
|
file="./${packagedir}/PKGBUILD" |
|
|
|
|
|
|
|
|
# All but the (zero), the first and the second argument |
|
|
# All but the (zero), the first and the second argument |
|
|
# We check the value of these file variables |
|
|
# We check the value of these file variables |
|
|
local file_vars=${@:3} |
|
|
|
|
|
|
|
|
file_vars=${@:3} |
|
|
|
|
|
|
|
|
for var in ${file_vars[*]}; do |
|
|
for var in ${file_vars[*]}; do |
|
|
# Get the variable and set it as a new variable in the current shell |
|
|
# Get the variable and set it as a new variable in the current shell |
|
|
# This is applicable only to variable arrays! Do not use if the variable is not an array. |
|
|
# This is applicable only to variable arrays! Do not use if the variable is not an array. |
|
|
local field=$(awk "/^${var}/,/)/" ${file} | sed -r "s/^${var}=|[)|(|']//g") |
|
|
|
|
|
|
|
|
field=$(awk "/^${var}/,/)/" ${file} | sed -r "s/^${var}=|[)|(|']//g") |
|
|
|
|
|
|
|
|
local i=0 |
|
|
|
|
|
|
|
|
i=0 |
|
|
for parse in ${field[*]}; do |
|
|
for parse in ${field[*]}; do |
|
|
if [[ ! $parse =~ ^# ]]; then |
|
|
if [[ ! $parse =~ ^# ]]; then |
|
|
local PKGS[$i]=$(printf '%s' $parse | sed 's/[=|>|<].*$//') |
|
|
|
|
|
|
|
|
pkgs[$i]=$(printf '%s' $parse | sed 's/[=|>|<].*$//') |
|
|
let i++ |
|
|
let i++ |
|
|
fi |
|
|
fi |
|
|
done |
|
|
done |
|
|
|
|
|
|
|
|
# Sort list and delete duplicate index values |
|
|
# Sort list and delete duplicate index values |
|
|
local PKGS=($(sort -u <<< "${PKGS[*]}")) |
|
|
|
|
|
|
|
|
pkgs=($(sort -u <<< "${pkgs[*]}")) |
|
|
|
|
|
|
|
|
for pkg in ${PKGS[*]}; do |
|
|
|
|
|
|
|
|
for pkg in ${pkgs[*]}; do |
|
|
|
|
|
|
|
|
if [[ $(printf $(pacman -Q ${pkg} &>/dev/null)$?) -ne 0 ]]; then |
|
|
if [[ $(printf $(pacman -Q ${pkg} &>/dev/null)$?) -ne 0 ]]; then |
|
|
ERRPKGS[$l]=${pkg} |
|
|
|
|
|
|
|
|
errpkgs[$l]=${pkg} |
|
|
echo -e "\e[91mERROR:\e[0m Dependency '${pkg}' not found, required by '${package}' (${file} => ${var})" |
|
|
echo -e "\e[91mERROR:\e[0m Dependency '${pkg}' not found, required by '${package}' (${file} => ${var})" |
|
|
let l++ |
|
|
let l++ |
|
|
fi |
|
|
fi |
|
@ -235,9 +246,9 @@ function checkDepends() { |
|
|
|
|
|
|
|
|
function check_alldeps() { |
|
|
function check_alldeps() { |
|
|
|
|
|
|
|
|
if [[ -v ERRPKGS ]]; then |
|
|
|
|
|
|
|
|
if [[ -v errpkgs ]]; then |
|
|
echo -e "\e[1mERROR:\e[0m The following dependencies are missing:\n\e[91m\ |
|
|
echo -e "\e[1mERROR:\e[0m The following dependencies are missing:\n\e[91m\ |
|
|
$(for o in ${ERRPKGS[@]}; do printf '%s\n' ${o}; done)\ |
|
|
|
|
|
|
|
|
$(for o in ${errpkgs[@]}; do printf '%s\n' ${o}; done)\ |
|
|
\e[0m\n" |
|
|
\e[0m\n" |
|
|
|
|
|
|
|
|
echo -e "Please install them and try again.\n" |
|
|
echo -e "Please install them and try again.\n" |
|
@ -252,9 +263,21 @@ $(for o in ${ERRPKGS[@]}; do printf '%s\n' ${o}; done)\ |
|
|
|
|
|
|
|
|
function prepare_env() { |
|
|
function prepare_env() { |
|
|
|
|
|
|
|
|
# Copy Wine & DXVK patch files |
|
|
|
|
|
cp -rf ${ARCH_BUILDROOT}/../wine_custom_patches ${ARCH_BUILDROOT}/0-wine-staging-git/wine-patches |
|
|
|
|
|
cp -rf ${ARCH_BUILDROOT}/../dxvk_custom_patches ${ARCH_BUILDROOT}/0-dxvk-git/dxvk-patches |
|
|
|
|
|
|
|
|
# Remove old Wine & DXVK patch files |
|
|
|
|
|
rm -rf ${ARCH_BUILDROOT}/0-wine-staging-git/wine-patches |
|
|
|
|
|
rm -rf ${ARCH_BUILDROOT}/0-dxvk-git/dxvk-patches |
|
|
|
|
|
|
|
|
|
|
|
mkdir -p ${ARCH_BUILDROOT}/0-wine-staging-git/wine-patches |
|
|
|
|
|
mkdir -p ${ARCH_BUILDROOT}/0-dxvk-git/dxvk-patches |
|
|
|
|
|
|
|
|
|
|
|
# Copy new Wine & DXVK patch files |
|
|
|
|
|
find ${ARCH_BUILDROOT}/../wine_custom_patches \ |
|
|
|
|
|
-mindepth 1 -maxdepth 1 -type f \( -iname "*.patch" -or -iname "*.diff" \) \ |
|
|
|
|
|
-exec cp {} ${ARCH_BUILDROOT}/0-wine-staging-git/wine-patches/ \; |
|
|
|
|
|
|
|
|
|
|
|
find ${ARCH_BUILDROOT}/../dxvk_custom_patches \ |
|
|
|
|
|
-mindepth 1 -maxdepth 1 -type f \( -iname "*.patch" -or -iname "*.diff" \) \ |
|
|
|
|
|
-exec cp {} ${ARCH_BUILDROOT}/0-dxvk-git/dxvk-patches \; |
|
|
|
|
|
|
|
|
# Create identifiable directory for this build |
|
|
# Create identifiable directory for this build |
|
|
mkdir -p ${ARCH_BUILDROOT}/compiled_pkg/"${datedir}" |
|
|
mkdir -p ${ARCH_BUILDROOT}/compiled_pkg/"${datedir}" |
|
@ -280,6 +303,10 @@ function check_gitOverride_wine() { |
|
|
|
|
|
|
|
|
function form_commit_array() { |
|
|
function form_commit_array() { |
|
|
|
|
|
|
|
|
|
|
|
local array_name |
|
|
|
|
|
local commits_raw |
|
|
|
|
|
local i |
|
|
|
|
|
|
|
|
cd "${commit_dir}" |
|
|
cd "${commit_dir}" |
|
|
|
|
|
|
|
|
if [[ $? -ne 0 ]]; then |
|
|
if [[ $? -ne 0 ]]; then |
|
@ -287,10 +314,10 @@ function check_gitOverride_wine() { |
|
|
exit 1 |
|
|
exit 1 |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
local array_name=${1} |
|
|
|
|
|
local commits_raw=$(eval ${2}) |
|
|
|
|
|
|
|
|
array_name=${1} |
|
|
|
|
|
commits_raw=$(eval ${2}) |
|
|
|
|
|
|
|
|
local i=0 |
|
|
|
|
|
|
|
|
i=0 |
|
|
for commit in ${commits_raw[*]}; do |
|
|
for commit in ${commits_raw[*]}; do |
|
|
eval ${array_name}[$i]="${commit}" |
|
|
eval ${array_name}[$i]="${commit}" |
|
|
let i++ |
|
|
let i++ |
|
@ -307,13 +334,20 @@ function check_gitOverride_wine() { |
|
|
|
|
|
|
|
|
function staging_change_freeze_commit() { |
|
|
function staging_change_freeze_commit() { |
|
|
|
|
|
|
|
|
local wine_commits_raw="git log --pretty=oneline | awk '{print \$1}' | tr '\n' ' '" |
|
|
|
|
|
|
|
|
local wine_commits_raw |
|
|
|
|
|
local staging_refcommits_raw |
|
|
|
|
|
local staging_rebasecommits_raw |
|
|
|
|
|
local i |
|
|
|
|
|
local k |
|
|
|
|
|
local wine_dropcommits |
|
|
|
|
|
|
|
|
|
|
|
wine_commits_raw="git log --pretty=oneline | awk '{print \$1}' | tr '\n' ' '" |
|
|
|
|
|
|
|
|
# TODO this check may break quite easily |
|
|
# TODO this check may break quite easily |
|
|
# It depends on the exact comment syntax Wine Staging developers are using (Rebase against ...) |
|
|
# It depends on the exact comment syntax Wine Staging developers are using (Rebase against ...) |
|
|
# Length and order of these two "array" variables MUST MATCH! |
|
|
# Length and order of these two "array" variables MUST MATCH! |
|
|
local staging_refcommits_raw="git log --pretty=oneline | awk '{ if ((length(\$NF)==40 || length(\$NF)==41) && \$(NF-1)==\"against\") print \$1; }'" |
|
|
|
|
|
local staging_rebasecommits_raw="git log --pretty=oneline | awk '{ if ((length(\$NF)==40 || length(\$NF)==41) && \$(NF-1)==\"against\") print substr(\$NF,1,40); }' | tr '\n' ' '" |
|
|
|
|
|
|
|
|
staging_refcommits_raw="git log --pretty=oneline | awk '{ if ((length(\$NF)==40 || length(\$NF)==41) && \$(NF-1)==\"against\") print \$1; }'" |
|
|
|
|
|
staging_rebasecommits_raw="git log --pretty=oneline | awk '{ if ((length(\$NF)==40 || length(\$NF)==41) && \$(NF-1)==\"against\") print substr(\$NF,1,40); }' | tr '\n' ' '" |
|
|
|
|
|
|
|
|
# Syntax: <function> <array_name> <raw_commit_list> |
|
|
# Syntax: <function> <array_name> <raw_commit_list> |
|
|
commit_dir="${ARCH_BUILDROOT}/0-wine-staging-git/wine-git" |
|
|
commit_dir="${ARCH_BUILDROOT}/0-wine-staging-git/wine-git" |
|
@ -331,12 +365,12 @@ function check_gitOverride_wine() { |
|
|
# Filter all newer than defined in 'git_commithash_wine' |
|
|
# Filter all newer than defined in 'git_commithash_wine' |
|
|
# |
|
|
# |
|
|
echo -e "Determining valid Wine Staging git commit. This takes a while.\n" |
|
|
echo -e "Determining valid Wine Staging git commit. This takes a while.\n" |
|
|
local i=0 |
|
|
|
|
|
|
|
|
i=0 |
|
|
for dropcommit in ${wine_commits[@]}; do |
|
|
for dropcommit in ${wine_commits[@]}; do |
|
|
if [[ "${dropcommit}" == "${git_commithash_wine}" ]]; then |
|
|
if [[ "${dropcommit}" == "${git_commithash_wine}" ]]; then |
|
|
break |
|
|
break |
|
|
else |
|
|
else |
|
|
local wine_dropcommits[$i]="${dropcommit}" |
|
|
|
|
|
|
|
|
wine_dropcommits[$i]="${dropcommit}" |
|
|
let i++ |
|
|
let i++ |
|
|
fi |
|
|
fi |
|
|
done |
|
|
done |
|
@ -345,7 +379,7 @@ function check_gitOverride_wine() { |
|
|
# For the filtered array list, iterate through 'staging_rebasecommits' array list until |
|
|
# For the filtered array list, iterate through 'staging_rebasecommits' array list until |
|
|
# we get a match |
|
|
# we get a match |
|
|
for vanilla_commit in ${wine_commits[@]}; do |
|
|
for vanilla_commit in ${wine_commits[@]}; do |
|
|
local k=0 |
|
|
|
|
|
|
|
|
k=0 |
|
|
for rebase_commit in ${staging_rebasecommits[@]}; do |
|
|
for rebase_commit in ${staging_rebasecommits[@]}; do |
|
|
if [[ "${vanilla_commit}" == "${rebase_commit}" ]]; then |
|
|
if [[ "${vanilla_commit}" == "${rebase_commit}" ]]; then |
|
|
# This is the commit we use for vanilla Wine |
|
|
# This is the commit we use for vanilla Wine |
|
@ -370,22 +404,20 @@ function check_gitOverride_wine() { |
|
|
|
|
|
|
|
|
########################################################### |
|
|
########################################################### |
|
|
|
|
|
|
|
|
# Remove any existing pkg,src or tar.xz packages left by previous pacman commands |
|
|
|
|
|
|
|
|
|
|
|
function cleanUp() { |
|
|
|
|
|
rm -rf ${ARCH_BUILDROOT}/*/{pkg,src,*.tar.xz,*.patch,*.diff,*.sig} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
########################################################### |
|
|
|
|
|
|
|
|
|
|
|
# Build & install package |
|
|
# Build & install package |
|
|
|
|
|
|
|
|
function build_pkg() { |
|
|
function build_pkg() { |
|
|
|
|
|
|
|
|
local pkgname=${1} |
|
|
|
|
|
local pkgname_friendly=${2} |
|
|
|
|
|
local pkgdir=${3} |
|
|
|
|
|
local cleanlist=${4} |
|
|
|
|
|
|
|
|
local pkgname |
|
|
|
|
|
local pkgname_friendly |
|
|
|
|
|
local pkgdir |
|
|
|
|
|
local cleanlist |
|
|
|
|
|
local pkgbuild_file |
|
|
|
|
|
|
|
|
|
|
|
pkgname=${1} |
|
|
|
|
|
pkgname_friendly=${2} |
|
|
|
|
|
pkgdir=${3} |
|
|
|
|
|
cleanlist=${4} |
|
|
|
|
|
|
|
|
# Create package and install it to the system |
|
|
# Create package and install it to the system |
|
|
# We need to download git sources beforehand in order |
|
|
# We need to download git sources beforehand in order |
|
@ -393,7 +425,7 @@ function build_pkg() { |
|
|
cd "${ARCH_BUILDROOT}"/${pkgdir} |
|
|
cd "${ARCH_BUILDROOT}"/${pkgdir} |
|
|
bash -c "updpkgsums && makepkg -o" |
|
|
bash -c "updpkgsums && makepkg -o" |
|
|
|
|
|
|
|
|
local pkgbuild_file="${ARCH_BUILDROOT}/${pkgdir}/PKGBUILD" |
|
|
|
|
|
|
|
|
pkgbuild_file="${ARCH_BUILDROOT}/${pkgdir}/PKGBUILD" |
|
|
|
|
|
|
|
|
# Check git commit hashes |
|
|
# Check git commit hashes |
|
|
if [[ $? -eq 0 ]] && \ |
|
|
if [[ $? -eq 0 ]] && \ |
|
@ -492,13 +524,6 @@ function updatePOL() { |
|
|
|
|
|
|
|
|
########################################################## |
|
|
########################################################## |
|
|
|
|
|
|
|
|
# Clean these temporary folders & files |
|
|
|
|
|
|
|
|
|
|
|
# TODO Shall we remove git folders or keep them? |
|
|
|
|
|
dxvk_wine_cleanlist=('*.patch' '*.diff' 'pkg' 'src' '*-patches' '*.tar.xz' '*.sig') |
|
|
|
|
|
|
|
|
|
|
|
########################################################## |
|
|
|
|
|
|
|
|
|
|
|
# Validate all buildtime files |
|
|
# Validate all buildtime files |
|
|
checkFiles |
|
|
checkFiles |
|
|
|
|
|
|
|
|