summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorXenhat Hex2022-07-10 13:31:09 -0400
committerXenhat Hex2022-07-10 13:31:09 -0400
commit055a67dbe057e42cbcf1e6ccda21c2cd43188d71 (patch)
treea831fc095c8ba34e0088cf31edec878d9d6de5b9
parentf3a05d273420ab692ab6684b4c47c009488acd32 (diff)
downloadaur-055a67dbe057e42cbcf1e6ccda21c2cd43188d71.tar.gz
split build script to its own file
-rwxr-xr-xPKGBUILD45
-rwxr-xr-xbuild_linux64.bash41
2 files changed, 44 insertions, 42 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 7e94da7c1859..63cb8879ed20 100755
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
# Maintainer: Xenhat Hex (aur@xenh.at)
# shellcheck disable=2034,3030,2154
pkgname=alchemy-next-viewer-git
-pkgver=6.5.5.48683.68d6e8c86e
+pkgver=6.5.5.48674.47add7dd82
pkgrel=1
pkgdesc="This is the next generation of Alchemy Viewer! - Git Source build"
arch=('x86_64')
@@ -50,47 +50,8 @@ prepare() {
build() {
cd "${pkgname}" || exit 1
- virtualenv ".venv" -p python3
- source ".venv/bin/activate"
- pip install --upgrade certifi
- if command -v autobuild; then
- abver="$(autobuild --version)"
- echo "Found ${abver}"
- if [ "${abver}" = "autobuild 2.1.0" ]; then
- echo "Reinstalling autobuild to work around some bugs"
- pip3 uninstall --yes autobuild
- pip3 install autobuild -i https://git.alchemyviewer.org/api/v4/projects/54/packages/pypi/simple --extra-index-url https://pypi.org/simple
- fi
- else
- pip3 install autobuild -i https://git.alchemyviewer.org/api/v4/projects/54/packages/pypi/simple --extra-index-url https://pypi.org/simple
- fi
- # we have a lot of files, relax ulimit to help performance
- ulimit -n 20000
- # shellcheck disable=SC2153
- autobuild configure -A 64 -c ReleaseOS -- -DLL_TESTS:BOOL=OFF -DDISABLE_FATAL_WARNINGS=ON -DUSE_LTO:BOOL="$(grep -cq '[^!]lto' <<< "${OPTIONS}" && echo 'ON' || echo 'OFF')" -DVIEWER_CHANNEL="Alchemy Test"
- cd "build-linux-64" || exit 1
- jobcount=$(nproc)
- if [[ ${jobcount} -gt 1 ]]; then
- # The viewer requires an average of 4GB of memory per CPU core to sucessfully link
- mempercorekb=$((4 * 1048576))
- requiredmemorykb=$(($(nproc) * mempercorekb))
- availablememorykb=$(grep MemTotal /proc/meminfo | tr -s ' ' | cut -d ' ' -f 2)
- freememkb="$(grep MemFree /proc/meminfo | tr -s ' ' | cut -d ' ' -f 2)"
- if [[ ${requiredmemorykb} -gt ${availablememorykb} ]]; then
- jobs=0
- until [[ $(((jobs + 1) * mempercorekb)) -gt ${availablememorykb} ]]; do
- jobs=$((jobs+1))
- done
- #((jobs--))
- jobcount=${jobs}
- elif [[ ${jobcount} -le 8 ]]; then
- jobcount=$((jobcount - 1))
- else
- jobcount=$((jobcount - 2))
- fi
- fi
- echo "Building with ${jobcount} jobs (adjusted)"
- time ninja -l"$(nproc)" -j${jobcount}
+ pwd
+ ../../build_linux64.bash "${OPTIONS}"
}
package() {
diff --git a/build_linux64.bash b/build_linux64.bash
new file mode 100755
index 000000000000..c79232616e00
--- /dev/null
+++ b/build_linux64.bash
@@ -0,0 +1,41 @@
+ virtualenv ".venv" -p python3
+ source ".venv/bin/activate"
+ pip install --upgrade certifi
+ if command -v autobuild; then
+ abver="$(autobuild --version)"
+ echo "Found ${abver}"
+ if [ "${abver}" = "autobuild 2.1.0" ]; then
+ echo "Reinstalling autobuild to work around some bugs"
+ pip3 uninstall --yes autobuild
+ pip3 install autobuild -i https://git.alchemyviewer.org/api/v4/projects/54/packages/pypi/simple --extra-index-url https://pypi.org/simple
+ fi
+ else
+ pip3 install autobuild -i https://git.alchemyviewer.org/api/v4/projects/54/packages/pypi/simple --extra-index-url https://pypi.org/simple
+ fi
+ # we have a lot of files, relax ulimit to help performance
+ ulimit -n 20000
+ # shellcheck disable=SC2153
+ autobuild configure -A 64 -c ReleaseOS -- -DLL_TESTS:BOOL=OFF -DDISABLE_FATAL_WARNINGS=ON -DUSE_LTO:BOOL="$(grep -cq '[^!]lto' <<< "${1}" && echo 'ON' || echo 'OFF')" -DVIEWER_CHANNEL="Alchemy Test"
+ cd "build-linux-64" || exit 1
+ jobcount=$(nproc)
+ if [[ ${jobcount} -gt 1 ]]; then
+ # The viewer requires an average of 4GB of memory per CPU core to sucessfully link
+ mempercorekb=$((4 * 1048576))
+ requiredmemorykb=$(($(nproc) * mempercorekb))
+ availablememorykb=$(grep MemTotal /proc/meminfo | tr -s ' ' | cut -d ' ' -f 2)
+ freememkb="$(grep MemFree /proc/meminfo | tr -s ' ' | cut -d ' ' -f 2)"
+ if [[ ${requiredmemorykb} -gt ${availablememorykb} ]]; then
+ jobs=0
+ until [[ $(((jobs + 1) * mempercorekb)) -gt ${availablememorykb} ]]; do
+ jobs=$((jobs+1))
+ done
+ #((jobs--))
+ jobcount=${jobs}
+ elif [[ ${jobcount} -le 8 ]]; then
+ jobcount=$((jobcount - 1))
+ else
+ jobcount=$((jobcount - 2))
+ fi
+ fi
+ echo "Building with ${jobcount} jobs (adjusted)"
+ time ninja -l"$(nproc)" -j${jobcount}