# Maintainer: Erich Eckner # Contributor: Olivia May # Contributor: Felix Golatofski # Contributor: Frederic Bezies # Contributor: Alfredo Ramos # Contributor: Martin C. Doege # Contributor: kusakata _pkgbase=freeminer pkgbase="${_pkgbase}-git" pkgname=("${_pkgbase}-git" "${_pkgbase}-server-git" "${_pkgbase}-common-git") pkgver=0.4.14.8.r6773.gf66314445 pkgrel=1 arch=('x86_64') url='https://freeminer.org/' license=('GPL3' 'CCPL:cc-by-sa-3.0') source=("git+https://github.com/${_pkgbase}/${_pkgbase}" algorithm.patch) sha512sums=('SKIP' '7600b64a82b134ca9bcddb0e314edf62c15da51bada7e788cb434a9c97379b841a8d7cbee31f8c505209919216bf22c1cce0371a6d061b9a8726bbe28665c032') makedepends=( 'leveldb' 'curl' 'git' 'hiredis' 'sqlite' 'libglvnd' 'libjpeg-turbo' 'libxi' 'luajit' 'openal' 'libvorbis' 'hicolor-icon-theme' 'freetype2' 'cmake' 'doxygen' ) prepare() { cd "${srcdir}/${_pkgbase}" git submodule update --init --recursive patch -p1 -i "${srcdir}/algorithm.patch" # Create build directory mkdir -p "${srcdir}"/build-{client,server} } pkgver() { cd "${srcdir}"/${_pkgbase} git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g' } build() { # Building client cd "${srcdir}"/build-client cmake ../${_pkgbase} \ -DCMAKE_INSTALL_PREFIX=/usr \ -DBUILD_CLIENT=1 \ -DBUILD_SERVER=0 \ -DRUN_IN_PLACE=0 nice make # Building server cd "${srcdir}"/build-server cmake ../${_pkgbase} \ -DCMAKE_INSTALL_PREFIX=/usr \ -DBUILD_CLIENT=0 \ -DBUILD_SERVER=1 \ -DRUN_IN_PLACE=0 nice make } package_freeminer-git() { pkgdesc='An open source sandbox game inspired by Minecraft' _pinned_dependencies=( 'gcc-libs=14.2.1+r134+gab884fffe3fc' 'glibc>=2.38' 'gmp=6.3.0' 'hiredis=1.2.0' 'leveldb=1.23' 'libcurl.so=4' 'libfreetype.so=6' 'libGL.so=1' 'libjpeg.so=8' 'libjsoncpp.so=26' 'libncursesw.so=6' 'libopenal.so=1' 'libpng16.so=16' 'libsqlite3.so=0' 'libvorbisfile.so=3' 'libx11=1.8.10' 'libxi=1.8.2' 'libz.so=1' 'libzstd.so=1' 'luajit=2.1.1731601260' ) depends=( "${_pkgbase}-common-git" 'leveldb' 'curl' 'hiredis' 'sqlite' 'luajit' 'openal' 'libvorbis' 'hicolor-icon-theme' 'freetype2' 'doxygen' "${_pinned_dependencies[@]}" ) provides=("${_pkgbase}=${pkgver}") conflicts=("${_pkgbase}") # Installing client cd "${srcdir}"/build-client make DESTDIR="${pkgdir}" install # Translations cp -R locale "${pkgdir}"/usr/share/ # Provided by freeminer-common rm -fR "${pkgdir}"/usr/share/{${_pkgbase},doc} # Provided by freeminer-server rm -f "${pkgdir}"/usr/share/man/man6/${_pkgbase}server.6 } package_freeminer-server-git() { pkgdesc='Server of an open source sandbox game inspired by Minecraft' _pinned_dependencies=( 'gcc-libs=14.2.1+r134+gab884fffe3fc' 'glibc>=2.38' 'gmp=6.3.0' 'hiredis=1.2.0' 'leveldb=1.23' 'libcurl.so=4' 'libjsoncpp.so=26' 'libncursesw.so=6' 'libsqlite3.so=0' 'libz.so=1' 'libzstd.so=1' 'luajit=2.1.1731601260' ) depends=( "${_pkgbase}-common-git" 'leveldb' 'curl' 'hiredis' 'sqlite' 'luajit' 'doxygen' "${_pinned_dependencies[@]}" ) provides=("${_pkgbase}-server=${pkgver}") conflicts=("${_pkgbase}-server") # Installing server cd "${srcdir}"/build-server make DESTDIR="${pkgdir}" install # Provided by freeminer rm -fR "${pkgdir}"/usr/share/{metainfo,appdata,applications,icons} rm -f "${pkgdir}"/usr/share/man/man6/${_pkgbase}.6 # Provided by freeminer-common rm -fR "${pkgdir}"/usr/share/{${_pkgbase},doc} } package_freeminer-common-git() { pkgdesc="Common data files for ${_pkgbase}-git and ${_pkgbase}-server-git" arch=('any') provides=("${_pkgbase}-common=${pkgver}") conflicts=("${_pkgbase}-common") _pinned_dependencies=( ) # Install common data files cd "${srcdir}"/${_pkgbase} mkdir -p "${pkgdir}"/usr/share/${_pkgbase}/{,doc} cp -R {games,builtin,client,fonts,textures} "${pkgdir}"/usr/share/${_pkgbase}/ cp doc/*.txt "${pkgdir}"/usr/share/${_pkgbase}/doc/ }