4b97cd2fb4
```sh git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" | while read template; do for p in ${template%/template}/patches/*; do sed -i ' \,^[+-][+-][+-] /dev/null,b /^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b s,^[*][*][*] ,&a/, /^--- /{ s,\(^--- \)\(./\)*,\1a/, s,[.-][Oo][Rr][Ii][Gg]\([ /]\),\1, s/[.-][Oo][Rr][Ii][Gg]$// s/[.]patched[.]\([^.]\)/.\1/ h } /^+++ -/{ g s/^--- a/+++ b/ b } s,\(^+++ \)\(./\)*,\1b/, ' "$p" done sed -i '/^patch_args=/d' $template done ```
49 lines
1.4 KiB
Bash
49 lines
1.4 KiB
Bash
# Template file for 'stockfish'
|
|
pkgname=stockfish
|
|
version=13
|
|
revision=1
|
|
_net_file=nn-62ef826d1a6d.nnue
|
|
wrksrc="Stockfish-sf_${version}"
|
|
build_wrksrc=src
|
|
build_style=gnu-makefile
|
|
make_build_target=build
|
|
make_use_env=yes
|
|
hostmakedepends="tar"
|
|
short_desc="Free UCI chess engine derived from Glaurung"
|
|
maintainer="cipr3s <cipr3s@gmx.com>"
|
|
license="GPL-3.0-or-later"
|
|
homepage="http://stockfishchess.org/"
|
|
distfiles="https://github.com/official-stockfish/Stockfish/archive/sf_${version}.tar.gz
|
|
https://tests.stockfishchess.org/api/nn/${_net_file}"
|
|
checksum="15d14721b3be17c597535bdbb44fb951a1ee948312d90fbf55fa0e52b8b81d62
|
|
62ef826d1a6d11b9e814188025aa02a60815c037292e0ef9bbb9bf4f724e5e63"
|
|
skip_extraction="${_net_file}"
|
|
|
|
LDFLAGS+="-lpthread -Wl,-z,stack-size=2097152"
|
|
|
|
# We know how to optimize ourselves
|
|
make_build_args="optimize=no "
|
|
|
|
case $XBPS_TARGET_MACHINE in
|
|
x86_64*) make_build_args+="ARCH=x86-64" ;;
|
|
i686*) make_build_args+="ARCH=x86-32" ;;
|
|
aarch64*) make_build_args+="ARCH=armv8" ;;
|
|
armv[56]*) make_build_args+="ARCH=general-32";;
|
|
armv7*) make_build_args+="ARCH=armv7" ;;
|
|
ppc64*) make_build_args+="ARCH=ppc-64" ;;
|
|
ppc*) make_build_args+="ARCH=ppc-32" ;;
|
|
*) broken="not supported" ;;
|
|
esac
|
|
|
|
if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
|
|
makedepends+=" libatomic-devel"
|
|
LDFLAGS+=" -latomic"
|
|
fi
|
|
|
|
post_extract() {
|
|
cp $XBPS_SRCDISTDIR/${pkgname}-${version}/${_net_file} ./src
|
|
}
|
|
|
|
do_install() {
|
|
vbin stockfish
|
|
}
|