mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-08-28 04:46:41 -04:00
Improve Arch PKGBUILD's CPU feature detection
This commit is contained in:
+4
-4
@@ -22,11 +22,11 @@ case "$1" in
|
||||
. ./resources/release-binaries.sh
|
||||
create_release_binaries
|
||||
;;
|
||||
pkgbuild-git-stable)
|
||||
. ./resources/pkgbuild-git-stable.sh
|
||||
create_pkgbuild_git_stable
|
||||
pkgbuild-git-stable-optimized)
|
||||
. ./resources/pkgbuild-git-stable-optimized.sh
|
||||
create_pkgbuild_git_stable_optimized
|
||||
;;
|
||||
*)
|
||||
printf '\nusage: package.sh [target] <revision>\n\ntargets: release-binaries pkgbuild-git-stable\n\n'
|
||||
printf '\nusage: package.sh [target] <revision>\n\ntargets: release-binaries pkgbuild-git-stable-optimized\n\n'
|
||||
;;
|
||||
esac
|
||||
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
create_pkgbuild_git_stable() {
|
||||
create_pkgbuild_git_stable_optimized() {
|
||||
printf '\nGenerating PKGBUILD...\n'
|
||||
local source="git+https://github.com/rwinkhart/MUTN.git#tag=v\${pkgver}"
|
||||
printf "# Maintainer: Randall Winkhart <idgr at tutanota dot com>
|
||||
@@ -12,7 +12,7 @@ arch=('x86_64' 'i686' 'i486' 'pentium4' 'aarch64' 'armv7h' 'riscv64')
|
||||
url='https://github.com/rwinkhart/MUTN'
|
||||
license=('MIT')
|
||||
depends=(gnupg)
|
||||
makedepends=(go util-linux gzip)
|
||||
makedepends=(go grep gzip)
|
||||
optdepends=(
|
||||
'wl-clipboard: Wayland clipboard support'
|
||||
'xclip: X11 clipboard support'
|
||||
@@ -30,12 +30,12 @@ build() {
|
||||
# determine microarchitecture feature level
|
||||
case \$CARCH in
|
||||
'x86_64')
|
||||
lscpuOutput=\$(lscpu | grep Flags)
|
||||
if [ ! -z \"\$(echo \$lscpuOutput | grep avx512f)\" ]; then
|
||||
cpuFlags=\$(grep -E 'flags\s+:\s' /proc/cpuinfo)
|
||||
if [ ! -z \"\$(grep 'avx512f' <<< \"\$cpuFlags\")\" ]; then
|
||||
export GOAMD64=v4
|
||||
elif [ ! -z \"\$(echo \$lscpuOutput | grep avx2)\" ]; then
|
||||
elif [ ! -z \"\$(grep 'avx2' <<< \"\$cpuFlags\")\" ]; then
|
||||
export GOAMD64=v3
|
||||
elif [ ! -z \"\$(echo \$lscpuOutput | grep sse4_2)\" ]; then
|
||||
elif [ ! -z \"\$(grep 'sse4_2' <<< \"\$cpuFlags\")\" ]; then
|
||||
export GOAMD64=v2
|
||||
else
|
||||
export GOAMD64=v1
|
||||
Reference in New Issue
Block a user