diff options
-rw-r--r-- | .SRCINFO | 19 | ||||
-rwxr-xr-x | PKGBUILD | 56 |
2 files changed, 56 insertions, 19 deletions
@@ -1,6 +1,6 @@ pkgbase = opencv-java pkgdesc = Open Source Computer Vision Library - Java bindings - pkgver = 4.0.0 + pkgver = 4.0.1 pkgrel = 1 url = http://opencv.org/ arch = i686 @@ -8,18 +8,23 @@ pkgbase = opencv-java license = BSD makedepends = cmake makedepends = python-numpy - makedepends = python2-numpy + makedepends = python-setuptools makedepends = mesa makedepends = eigen + makedepends = hdf5 + makedepends = lapacke + makedepends = gtk3 + makedepends = vtk + makedepends = glew makedepends = apache-ant makedepends = java-environment - depends = opencv>=4.0.0 + depends = opencv>=4.0.1 depends = java-runtime optdepends = opencv-samples: OpenCV samples - source = opencv-4.0.0.tar.gz::https://github.com/opencv/opencv/archive/4.0.0.tar.gz - source = opencv_contrib-4.0.0.tar.gz::https://github.com/opencv/opencv_contrib/archive/4.0.0.tar.gz - sha256sums = 3787b3cc7b21bba1441819cb00c636911a846c0392ddf6211d398040a1e4886c - sha256sums = 4fb0681414df4baedce6e3f4a01318d6f4fcde6ee14854d761fd4e397a397763 + source = opencv-4.0.1.tar.gz::https://github.com/opencv/opencv/archive/4.0.1.tar.gz + source = opencv_contrib-4.0.1.tar.gz::https://github.com/opencv/opencv_contrib/archive/4.0.1.tar.gz + sha256sums = 7b86a0ee804244e0c407321f895b15e4a7162e9c5c0d2efc85f1cadec4011af4 + sha256sums = 0d8acbad4b7074cfaafd906a7419c23629179d5e98894714402090b192ef8237 pkgname = opencv-java @@ -4,24 +4,29 @@ # Based on the official opencv PKGBUILD pkgname=opencv-java -_pkgbase=opencv -pkgver=4.0.0 +_pkgname=opencv +pkgver=4.0.1 pkgrel=1 pkgdesc="Open Source Computer Vision Library - Java bindings" arch=(i686 x86_64) license=(BSD) url="http://opencv.org/" -depends=("opencv>=$pkgver" java-runtime) +depends=("$_pkgname>=$pkgver" java-runtime) # Last two makedepends are needed for the Java binding -makedepends=(cmake python-numpy python2-numpy mesa eigen apache-ant java-environment) +makedepends=(cmake python-numpy python-setuptools mesa eigen hdf5 lapacke gtk3 vtk glew + apache-ant java-environment) optdepends=('opencv-samples: OpenCV samples') -source=("$_pkgbase-$pkgver.tar.gz::https://github.com/opencv/opencv/archive/$pkgver.tar.gz" +source=("$_pkgname-$pkgver.tar.gz::https://github.com/opencv/opencv/archive/$pkgver.tar.gz" "opencv_contrib-$pkgver.tar.gz::https://github.com/opencv/opencv_contrib/archive/$pkgver.tar.gz") -sha256sums=('3787b3cc7b21bba1441819cb00c636911a846c0392ddf6211d398040a1e4886c' - '4fb0681414df4baedce6e3f4a01318d6f4fcde6ee14854d761fd4e397a397763') +sha256sums=('7b86a0ee804244e0c407321f895b15e4a7162e9c5c0d2efc85f1cadec4011af4' + '0d8acbad4b7074cfaafd906a7419c23629179d5e98894714402090b192ef8237') # Removed all the CMake flags manipulation; # hopefully, SSE will be automagically disabled properly on i686 +# Uncomment this line to have a limited build; this would build only the basic Java bindings +# with its dependencies, ignoring all the standard needed libraries. +#_limited_build="1" + prepare() { # Setting JAVA_HOME msg2 "Setting JAVA_HOME variable" @@ -31,9 +36,18 @@ prepare() { build() { cd build + + # Have a limited build, if any + if [ -n "$_limited_build" ] + then + msg2 "Building just the Java modules ..." + _extra_cmake_flags="-DBUILD_LIST=java" + fi + # The flags are almost as the original package, just tweaked for easier and speedier builds - cmake ../$_pkgbase-$pkgver \ - -DBUILD_LIST=java \ + _pythonpath=`python -c "from sysconfig import get_path; print(get_path('platlib'))"` + cmake \ + "$_extra_cmake_flags" \ -DWITH_OPENCL=ON \ -DWITH_OPENGL=ON \ -DWITH_TBB=ON \ @@ -44,10 +58,16 @@ build() { -DBUILD_EXAMPLES=OFF \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_LIBDIR=lib \ + -DCPU_BASELINE_DISABLE=SSE3 \ + -DCPU_BASELINE_REQUIRE=SSE2 \ -DOPENCV_EXTRA_MODULES_PATH="$srcdir/opencv_contrib-$pkgver/modules" \ + -DOPENCV_SKIP_PYTHON_LOADER=ON \ + -DOPENCV_PYTHON3_INSTALL_PATH=$_pythonpath \ -DLAPACK_LIBRARIES="/usr/lib/liblapack.so;/usr/lib/libblas.so;/usr/lib/libcblas.so" \ -DLAPACK_CBLAS_H="/usr/include/cblas.h" \ - -DLAPACK_LAPACKE_H="/usr/include/lapacke.h" + -DLAPACK_LAPACKE_H="/usr/include/lapacke.h" \ + -DOPENCV_GENERATE_PKGCONFIG=ON \ + ../$_pkgname-$pkgver make } @@ -60,6 +80,13 @@ package() { mkdir -p "$srcdir/temp" make DESTDIR="$srcdir/temp" install + # Testing block! This is useful for checking which files are unique for + # this package. + #pacman -Qlq opencv | sed 's|/$||' | sort > "$srcdir/official.txt" + #find "$srcdir/temp" | sed "s|$srcdir/temp||" | sort > "$srcdir/built.txt" + #comm -3 built.txt official.txt + #exit 1 + msg2 "Adjusting stuff ..." _opencv_java="usr/share/java/opencv4" # Creating the package structure @@ -68,8 +95,13 @@ package() { cp -rv "$srcdir/temp/$_opencv_java" "$pkgdir/usr/share/java" # Create a symbolic link in /usr/share/java as Java apps written for Ubuntu may be looking there + _pkgver="${pkgver//./}" mkdir -p "$pkgdir/usr/share/java/" - ln -sv "/$_opencv_java/opencv-${pkgver//./}.jar" "$pkgdir/usr/share/java/opencv.jar" + ln -sv "/$_opencv_java/opencv-$_pkgver.jar" "$pkgdir/usr/share/java/opencv.jar" mkdir -p "$pkgdir/usr/lib/" - ln -sv "/$_opencv_java/libopencv_java${pkgver//./}.so" "$pkgdir/usr/lib/libopencv_java.so" + ln -sv "/$_opencv_java/libopencv_java$_pkgver.so" "$pkgdir/usr/lib/libopencv_java.so" + + # The license is the same of the official package, I assume + mkdir -p "$pkgdir/usr/share/licenses/" + ln -sv "/usr/share/licenses/$_pkgname" "$pkgdir/usr/share/licenses/$pkgname" } |