summaryrefslogtreecommitdiff
path: root/freeminer-git/PKGBUILD
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2023-12-28 15:52:43 +0100
committerErich Eckner <git@eckner.net>2023-12-28 15:52:43 +0100
commit47e6e460d1003736a9414b3f91c6e57f57d2c7e5 (patch)
tree39b9a23d6baf1ff5f2653e6cc6553aaad441c729 /freeminer-git/PKGBUILD
parent734a4cd6ccf400a9d6208b0d0446ab94bddd3eed (diff)
downloadarchlinuxewe-47e6e460d1003736a9414b3f91c6e57f57d2c7e5.tar.xz
freeminer-git new
Diffstat (limited to 'freeminer-git/PKGBUILD')
-rw-r--r--freeminer-git/PKGBUILD115
1 files changed, 115 insertions, 0 deletions
diff --git a/freeminer-git/PKGBUILD b/freeminer-git/PKGBUILD
new file mode 100644
index 000000000..7aaca8273
--- /dev/null
+++ b/freeminer-git/PKGBUILD
@@ -0,0 +1,115 @@
+# Maintainer: Erich Eckner <arch at eckner dot net>
+# Contributor: Olivia May <olivia.may@tuta.io>
+# Contributor: Felix Golatofski <contact@xdfr.de>
+# Contributor: Frederic Bezies <fredbezies at gmail dot com>
+# Contributor: Alfredo Ramos <alfredo dot ramos at yandex dot com>
+# Contributor: Martin C. Doege <mdoege at compuserve dot com>
+# Contributor: kusakata <shohei atmark kusakata period com>
+
+_pkgbase=freeminer
+pkgbase="${_pkgbase}-git"
+pkgname=("${_pkgbase}-git" "${_pkgbase}-server-git" "${_pkgbase}-common-git")
+pkgver=0.4.14.8.r6042.g356205cd5
+pkgrel=1
+arch=('i686' 'x86_64')
+url='https://freeminer.org/'
+license=('GPL3' 'CCPL:cc-by-sa-3.0')
+
+
+makedepends=(
+ 'leveldb' 'curl' 'git' 'hiredis' 'sqlite' 'luajit'
+ 'openal' 'libvorbis' 'hicolor-icon-theme' 'freetype2' 'cmake' 'doxygen'
+)
+
+prepare() {
+ cd "${srcdir}"
+
+ git clone --recursive "https://github.com/${_pkgbase}/${_pkgbase}"
+
+ # 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'
+ depends=(
+ "${_pkgbase}-common-git" 'leveldb' 'curl' 'hiredis' 'sqlite'
+ 'luajit' 'openal' 'libvorbis' 'hicolor-icon-theme' 'freetype2' 'doxygen'
+ )
+ 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'
+ depends=(
+ "${_pkgbase}-common-git" 'leveldb' 'curl' 'hiredis' 'sqlite'
+ 'luajit' 'doxygen'
+ )
+ 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")
+
+ # 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/
+}