summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--user/eigen/APKBUILD92
-rw-r--r--user/eigen/fix_path_FindEigen3.patch16
-rw-r--r--user/eigen/remove_piwik_crap.patch27
3 files changed, 122 insertions, 13 deletions
diff --git a/user/eigen/APKBUILD b/user/eigen/APKBUILD
index 125cf77fe..d0e15b7dd 100644
--- a/user/eigen/APKBUILD
+++ b/user/eigen/APKBUILD
@@ -1,27 +1,93 @@
# Contributor: Bradley J Chambers <brad.chambers@gmail.com>
-# Maintainer:
+# Maintainer: Dan Theisen <djt@hxx.in>
pkgname=eigen
pkgver=3.3.7
-pkgrel=0
+pkgrel=1
pkgdesc="Eigen is a C++ template library for linear algebra"
url="http://eigen.tuxfamily.org/index.php?title=Main_Page"
arch="noarch"
-options="!check" # Headers-only: no tests are possible.
-license="MPL-2.0"
+options="!check" # manual verification
+license="MPL-2.0 AND LGPL-2.1+ AND GPL-2.0+ AND GPL-3.0+ AND BSD-3-Clause AND Custom:MINPACK"
depends=""
-makedepends=""
-subpackages="$pkgname-dev"
-source="$pkgname-$pkgver.tar.gz::http://bitbucket.org/eigen/$pkgname/get/$pkgver.tar.gz"
+makedepends="cmake gfortran doxygen graphviz"
+checkdepends="fftw-dev mpfr-dev gmp-dev freeglut-dev glew-dev"
+subpackages="$pkgname-doc $pkgname-examples::all"
+source="$pkgname-$pkgver.tar.gz::http://bitbucket.org/eigen/$pkgname/get/$pkgver.tar.gz
+ remove_piwik_crap.patch
+ fix_path_FindEigen3.patch"
prepare() {
- mv "$srcdir"/eigen-eigen-* "$builddir" # directory name contains hash
- default_prepare
+ mv "$srcdir"/eigen-eigen-* "$builddir" # directory name contains hash
+ default_prepare
+}
+
+build() {
+ CXXFLAGS="-std=c++11" \
+ cmake \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_BUILD_TYPE=Debug \
+ -Bbuild
+ # TODO: documentation is missing LaTeX during build
+ make -C build doc
+}
+
+check() {
+ cd build
+ # the full testsuite is 787 tests, it is quite comprehensive and takes
+ # a LONG time to build. it has been disabled, for now because sometimes
+ # it produces false positives. it should probably be manually tested
+ # every once in a while. upstream doesn't expect these tests to pass
+ # consistently because they are randomly seeded.
+ EIGEN_MAKE_ARGS=-j$JOBS ./check.sh '.+'
}
package() {
- mkdir -p "$pkgdir"/usr/include/eigen3
- cp -r "$builddir"/Eigen "$pkgdir"/usr/include/eigen3
- cp -r "$builddir"/unsupported "$pkgdir"/usr/include/eigen3
+ make DESTDIR=$pkgdir -C build install
+
+ # Move pkgconfig to correct location and clean up afterwards
+ install -Dm644 -t $pkgdir/usr/lib/pkgconfig \
+ $pkgdir/usr/share/pkgconfig/eigen3.pc
+ rm -rf $pkgdir/usr/share/pkgconfig
+
+ # Move docs and licenses to correct locations
+ _docdir=$pkgdir/usr/share/doc/$pkgname
+ _licdir=$pkgdir/usr/share/licenses/$pkgname
+ install -Dm644 -t $_licdir $builddir/COPYING.*
+ mkdir -p $_docdir
+ mv build/doc/html $_docdir/
+ install -m644 -t $_docdir $builddir/doc/tutorial.cpp
+ _msg="More code samples are available in the $pkgname-examples package."
+ echo $_msg > $_docdir/README.EXAMPLES
+}
+
+examples() {
+ pkgdesc="Eigen C++ linear algebra template library examples"
+
+ _sharedir=$subpkgdir/usr/share/$pkgname
+ _exampledst=$_sharedir/examples
+ _spexampdst=$_sharedir/special_examples
+ _snippetdst=$_sharedir/snippets
+ _builtdocs=$builddir/build/doc
+
+ # Get objects and makefiles out of the way to make the next part easier
+ find $builddir \
+ \( -name '*.out' -o -name Makefile -o -name '*.cmake' \) -and \
+ -delete -or \( -type d -name CMakeFiles -exec rm -rf '{}' + \)
+
+ # Move example sources and binaries into place
+ install -Dm644 -t $_exampledst/src $builddir/doc/examples/*.cpp*
+ install -Dm755 -t $_exampledst/bin $_builtdocs/examples/*
+
+ # Move special example sources and binaries into place
+ install -Dm644 -t $_spexampdst/src $builddir/doc/special_examples/*.cpp*
+ install -Dm755 -t $_spexampdst/bin $_builtdocs/special_examples/*
+
+ # Move snippets sources and binaries into place
+ install -Dm644 -t $_snippetdst/src $builddir/build/doc/snippets/*.cpp*
+ find $builddir/build/doc/snippets -type f ! -name '*.cpp*' -print0 | \
+ xargs -0 install -Dm755 -t $_snippetdst/bin
}
-sha512sums="34cf600914cce719d61511577ef9cd26fbdcb7a6fad1d0ab8396f98b887fac6a5577d3967e84a8f56225cc50de38f3b91f34f447d14312028383e32b34ea1972 eigen-3.3.7.tar.gz"
+sha512sums="34cf600914cce719d61511577ef9cd26fbdcb7a6fad1d0ab8396f98b887fac6a5577d3967e84a8f56225cc50de38f3b91f34f447d14312028383e32b34ea1972 eigen-3.3.7.tar.gz
+9d14e0c7f8bff5ec1af074666bafbdd6b597aef9fefa913cfd74a3c576c2f3af21c03327020e3777a9a83f528cecb07e5752a4204e99d5b1ca6c0b5b042bedfd remove_piwik_crap.patch
+bd94034d64d79823586f3c110835e9c58e8c1028086700cf631f0b48cc91fd8efa5b1040808fc8faa7a6e241b422159d86eedc4d770f1c8620ef304a6e1fd723 fix_path_FindEigen3.patch"
diff --git a/user/eigen/fix_path_FindEigen3.patch b/user/eigen/fix_path_FindEigen3.patch
new file mode 100644
index 000000000..a5b42d5f3
--- /dev/null
+++ b/user/eigen/fix_path_FindEigen3.patch
@@ -0,0 +1,16 @@
+Description: fix installation path for cmake-files
+Author: Anton Gladky <gladk@debian.org>
+Last-Update: 2015-12-18
+Index: eigen-eigen-323c052e1731/CMakeLists.txt
+===================================================================
+--- eigen-eigen-323c052e1731.orig/CMakeLists.txt
++++ eigen-eigen-323c052e1731/CMakeLists.txt
+@@ -393,7 +393,7 @@ else()
+ )
+ endif()
+ set(CMAKEPACKAGE_INSTALL_DIR
+- "${CMAKE_INSTALL_DATADIR}/eigen3/cmake"
++ "/usr/lib/cmake/eigen3"
+ CACHE PATH "The directory relative to CMAKE_PREFIX_PATH where Eigen3Config.cmake is installed"
+ )
+ set(PKGCONFIG_INSTALL_DIR
diff --git a/user/eigen/remove_piwik_crap.patch b/user/eigen/remove_piwik_crap.patch
new file mode 100644
index 000000000..397b21397
--- /dev/null
+++ b/user/eigen/remove_piwik_crap.patch
@@ -0,0 +1,27 @@
+Description: remove piwik scripts.
+Author: Anton Gladky <gladk@debian.org>
+Last-Update: 2015-06-16
+Index: eigen-eigen-323c052e1731/doc/eigendoxy_footer.html.in
+===================================================================
+--- eigen-eigen-323c052e1731.orig/doc/eigendoxy_footer.html.in
++++ eigen-eigen-323c052e1731/doc/eigendoxy_footer.html.in
+@@ -17,19 +17,6 @@ $generatedby &#160;<a href="http://www.d
+ </small></address>
+ <!--END !GENERATE_TREEVIEW-->
+
+-<!-- Piwik -->
+-<script type="text/javascript">
+-var pkBaseURL = (("https:" == document.location.protocol) ? "https://stats.sylphide-consulting.com/piwik/" : "http://stats.sylphide-consulting.com/piwik/");
+-document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
+-</script><script type="text/javascript">
+-try {
+-var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 20);
+-piwikTracker.trackPageView();
+-piwikTracker.enableLinkTracking();
+-} catch( err ) {}
+-</script><noscript><p><img src="http://stats.sylphide-consulting.com/piwik/piwik.php?idsite=20" style="border:0" alt="" /></p></noscript>
+-<!-- End Piwik Tracking Code -->
+-
+ </body>
+ </html>
+