Surprise! We've been running on hardware provided by BuyVM for a few months and wanted to show them a little appreciation.
Running a paste site comes with unique challenges, ones that aren't always obvious and hard to control. As such, BuyVM offered us a home where we could worry less about the hosting side of things and focus on maintaining a clean and useful service! Go check them out and show them some love!
Description: PKGBUILD - stockfish
Submitted on December 31, 2023 at 08:51 PM
Expires on December 30, 2024 at 08:51 PM (7 months from now)

PKGBUILD (Bash)

pkgname=stockfish
pkgver=16
pkgrel=2
epoch=1
pkgdesc="A strong UCI chess engine"
arch=('x86_64' 'i686' 'armv7h' 'aarch64')
url="https://stockfishchess.org/"
license=('GPL3')
depends=('glibc')
source=("$pkgname-$pkgver.zip::https://github.com/official-stockfish/Stockfish/archive/sf_$pkgver.zip")
sha512sums=('4c1ee8e36a8786392409fd0fa85d3751f6595b69529df09db3011229019a3f76b410dc84a077774ec1095c8a7bcde529db4cd0766f103ce94fc59fc186e6ee89')

build() {
  cd "Stockfish-sf_${pkgver}/src"
  _make=(make 'ARCH=" "')

  "${_make[@]}" net
  printf "\nStep 1/4. Building instrumented executable ...\n"
  mkdir -p profdir
  "${_make[@]}" \
    EXTRACXXFLAGS='-fprofile-generate=profdir' \
    EXTRALDFLAGS='-lgcov' \
    all

  printf "\nStep 2/4. Running benchmark for pgo-build ...\n"
  ./stockfish bench | tee PGOBENCH.out

  printf "\nStep 3/4. Building optimized executable ...\n"

  "${_make[@]}" objclean
  "${_make[@]}" \
    EXTRACXXFLAGS='-fprofile-use=profdir -fno-peel-loops -fno-tracer' \
    EXTRALDFLAGS='-lgcov' \
    all

  printf "\nStep 4/4. Deleting profile data ...\n"
  "${_make[@]}" profileclean
}

package() {
  cd "Stockfish-sf_${pkgver}/src"
  make PREFIX="$pkgdir/usr" install
}