summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorAdrián Pérez de Castro2015-11-17 22:44:28 +0200
committerAdrián Pérez de Castro2015-11-17 22:44:28 +0200
commit16355813220ec8b73dace0f0a3d972b0afda8108 (patch)
tree0fc15ddd2f3c5c8ee53809dfea06bc7392b3c514 /PKGBUILD
downloadaur-16355813220ec8b73dace0f0a3d972b0afda8108.tar.gz
Initial import
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD55
1 files changed, 55 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..45e3824e6fda
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,55 @@
+# Maintainer: Adrián Pérez de Castro <aperez@igalia.com>
+pkgdesc='LuaJIT-based scientific computing framework'
+pkgname='torch7-git'
+pkgver=r817.91a2970
+pkgrel=1
+url='http://torch.ch'
+source=("${pkgname}::git://github.com/torch/torch7")
+depends=('luajit' 'blas' 'lapack' 'torch7-cwrap-git')
+conflicts=('torch7')
+provides=('torch7')
+makedepends=('cmake')
+arch=('x86_64' 'i686')
+sha512sums=('SKIP')
+
+pkgver () {
+ cd "${pkgname}"
+ (
+ set -o pipefail
+ git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+ )
+}
+
+build () {
+ cd "${pkgname}"
+ cmake . \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DLUADIR=/usr/share/lua/5.1 \
+ -DLIBDIR=/usr/lib/lua/5.1 \
+ -DLUA_INCDIR=/usr/include/luajit-2.0 \
+ -DLUA_LIBDIR=/usr/lib \
+ -DLUALIB=/usr/lib/libluajit-5.1.so \
+ -DLUA=/usr/bin/luajit
+ make
+}
+
+package () {
+ cd "${pkgname}"
+ make DESTDIR="${pkgdir}" install
+
+ # Ugh. CMake does a monstrosity here.
+ local base="${pkgdir}${srcdir}"
+
+ # Relocate CMake module files
+ mkdir -p "${pkgdir}/usr/share/cmake/Modules/"
+ mv "${base}/share/cmake/torch"/*.cmake \
+ "${pkgdir}/usr/share/cmake/Modules/"
+
+ # Clean up junk
+ cd "${pkgdir}"
+ for name in * ; do
+ [[ ${name} == usr ]] || rm -rf "${name}"
+ done
+}
+