summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pcr/puzzlemoppet-git/PKGBUILD25
1 files changed, 21 insertions, 4 deletions
diff --git a/pcr/puzzlemoppet-git/PKGBUILD b/pcr/puzzlemoppet-git/PKGBUILD
index 45bbbacc8..c9f8acaec 100644
--- a/pcr/puzzlemoppet-git/PKGBUILD
+++ b/pcr/puzzlemoppet-git/PKGBUILD
@@ -10,16 +10,24 @@ arch=('i686' 'x86_64')
url=https://bitbucket.org/Knitter/puzzlemoppet/overview
license=('WTFPL')
-_latest_version() { pacman -Si $1 | awk '$1=="Version" { sub (/-.*/, "" , $3) ; print $3 }' | sort -V | tail -n 1 ; }
-_runtime_couplings=( "ode=$(_latest_version 'ode')" )
-depends=(${_runtime_couplings[@]} 'openal' 'irrlicht' 'libxrandr')
-makedepends=('make' 'cmake' 'git')
+depends=('irrlicht' 'libxrandr' 'ode' 'openal')
+makedepends=('cmake' 'git')
conflicts=('puzzle-moppet-bin')
source=(${pkgname}::git+https://bitbucket.org/Knitter/puzzlemoppet.git)
md5sums=('SKIP')
+_version_constraint() # (dep_pkgname)
+{
+ local dep_pkgname=$1
+ local version=$(pacman -S --print-format='%v' ${dep_pkgname} | tail -n 1)
+ version=${version%-*}
+ version_inc=${version%.*}.$(( ${version##*.} + 1 ))
+
+ echo -n "${dep_pkgname}>=${version}" "${dep_pkgname}<${version_inc}"
+}
+
pkgver()
{
cd "${srcdir}/${pkgname}"
@@ -27,6 +35,13 @@ pkgver()
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
+prepare()
+{
+ cd "${srcdir}/${pkgname}/puzzlemoppet"
+
+ sed -i 's|/licences/|/licenses/|' ./CMakeLists.txt
+}
+
build()
{
cd "${srcdir}/${pkgname}/puzzlemoppet"
@@ -39,5 +54,7 @@ package()
{
cd "${srcdir}/${pkgname}/puzzlemoppet"
+ depends+=( $(_version_constraint 'ode') )
+
make install DESTDIR=$pkgdir
}