public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/opencv] opencv5: Enable Java Bindings (contribution of Ian Wallace)
@ 2026-08-28 13:31 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-08-28 13:31 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/opencv
Branch : opencv5
Commit : 3b82c765286394579f263ab9f9cd1374505bd499
Author : Sérgio M. Basto <sergio@serjux.com>
Date   : 2019-05-12T16:05:50+01:00
Stats  : +37/-2 in 1 file(s)
URL    : https://src.fedoraproject.org/rpms/opencv/c/3b82c765286394579f263ab9f9cd1374505bd499?branch=opencv5

Log:
Enable Java Bindings (contribution of Ian Wallace)

---
diff --git a/opencv.spec b/opencv.spec
index 4ba0729..4ef66d9 100644
--- a/opencv.spec
+++ b/opencv.spec
@@ -45,6 +45,7 @@
 %endif
 %bcond_without  clp
 %bcond_without  va
+%bcond_without  java
 
 %global srcname opencv
 %global abiver  3.4
@@ -57,7 +58,7 @@
 
 Name:           opencv
 Version:        3.4.4
-Release:        8%{?dist}
+Release:        9%{?dist}
 Summary:        Collection of algorithms for computer vision
 # This is normal three clause BSD.
 License:        BSD
@@ -156,6 +157,10 @@ BuildRequires:  lapack-devel
 %{?with_libmfx:BuildRequires:  libmfx-devel}
 %{?with_clp:BuildRequires:  coin-or-Clp-devel}
 %{?with_va:BuildRequires:   libva-devel}
+%{?with_java:
+BuildRequires:  ant
+BuildRequires:  java-devel
+}
 
 Requires:       opencv-core%{_isa} = %{version}-%{release}
 
@@ -206,6 +211,18 @@ Requires:       python3-numpy
 This package contains Python3 bindings for the OpenCV library.
 
 
+%package    java
+Summary:    Java bindings for apps which use OpenCV
+Requires:   java-headless
+Requires:   javapackages-filesystem
+Requires:   %{name}-core%{_isa} = %{version}-%{release}
+Provides:   lib%{name}_java.so%{?_isa} = %{version}-%{release}
+Obsoletes:  lib%{name}_java.so%{?_isa} < %{version}-%{release}
+
+%description java
+This package contains Java bindings for the OpenCV library.
+
+
 %package        contrib
 Summary:        OpenCV contributed functionality
 
@@ -255,7 +272,8 @@ pushd build
  -DWITH_CAROTENE=OFF \
  -DENABLE_PRECOMPILED_HEADERS=OFF \
  -DCMAKE_BUILD_TYPE=ReleaseWithDebInfo \
- -DBUILD_opencv_java=OFF \
+ %{?with_java: -DBUILD_opencv_java=ON } \
+ %{!?with_java: -DBUILD_opencv_java=OFF } \
  %{?with_tbb: -DWITH_TBB=ON } \
  %{!?with_gstreamer: -DWITH_GSTREAMER=OFF } \
  %{!?with_ffmpeg: -DWITH_FFMPEG=OFF } \
@@ -303,6 +321,13 @@ popd
 %make_install -C build
 find %{buildroot} -name '*.la' -delete
 rm -rf %{buildroot}%{_datadir}/OpenCV/licenses/
+%if %{with java}
+mv %{buildroot}/usr/share/OpenCV/java/libopencv_java344.so %{buildroot}%{_libdir}/libopencv_java.so.%{version}
+ln -s -r %{buildroot}%{_libdir}/libopencv_java.so.%{version} %{buildroot}%{_libdir}/libopencv_java.so.%{abiver}
+mkdir -p %{buildroot}%{_jnidir}
+mv %{buildroot}/usr/share/OpenCV/java/opencv-344.jar %{buildroot}%{_jnidir}/opencv.jar.%{version}
+ln -s -r %{buildroot}%{_jnidir}/opencv.jar.%{version} %{buildroot}%{_jnidir}/opencv.jar.%{abiver}
+%endif
 
 %check
 # Check fails since we don't support most video
@@ -322,6 +347,7 @@ popd
 
 %ldconfig_scriptlets contrib
 
+%ldconfig_scriptlets java
 
 %files
 %doc README.md
@@ -369,6 +395,12 @@ popd
 %{_bindir}/setup_vars_opencv3.sh
 %{python3_sitearch}/cv2.cpython-3*.so
 
+%if %{with java}
+%files java
+%{_libdir}/libopencv_java.so.%{abiver}*
+%{_jnidir}/opencv.jar.%{abiver}*
+%endif
+
 %files contrib
 %{_libdir}/libopencv_aruco.so.%{abiver}*
 %{_libdir}/libopencv_bgsegm.so.%{abiver}*
@@ -402,6 +434,9 @@ popd
 %{_libdir}/libopencv_xphoto.so.%{abiver}*
 
 %changelog
+* Sun May 12 2019 Sérgio Basto <sergio@serjux.com> - 3.4.4-9
+- Enable Java Bindings (contribution of Ian Wallace)
+
 * Wed Apr 10 2019 Richard Shaw <hobbes1069@gmail.com> - 3.4.4-8
 - Rebuild for OpenEXR 2.3.0.
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-28 13:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-28 13:31 [rpms/opencv] opencv5: Enable Java Bindings (contribution of Ian Wallace) 

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox