From 4d9d9e074cc737f4e9cc4da6ab029ff1e7ee90ff Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Dec 25 2017 13:17:47 +0000 Subject: Use BUILD_STATIC_LIBS=OFF instead of deleting the static library after build --- diff --git a/openjpeg2.spec b/openjpeg2.spec index d1e79b7..250c686 100644 --- a/openjpeg2.spec +++ b/openjpeg2.spec @@ -5,7 +5,7 @@ Name: openjpeg2 Version: 2.3.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: C-Library for JPEG 2000 # windirent.h is MIT, the rest is BSD @@ -19,6 +19,8 @@ Source1: data.tar.xz # Remove bundled libraries Patch0: openjpeg2_remove-thirdparty.patch +# Fix shared libraries not getting installed if static libraries are disabled +Patch1: openjpeg2_install.patch BuildRequires: cmake BuildRequires: zlib-devel @@ -207,6 +209,8 @@ pushd %{_target_platform} %cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOPENJPEG_INSTALL_LIB_DIR=%{_lib} \ %{?optional_components:-DBUILD_MJ2=ON -DBUILD_JPWL=ON -DBUILD_JPIP=ON -DBUILD_JP3D=ON} \ -DBUILD_DOC=ON \ + -DBUILD_STATIC_LIBS=OFF \ + -DBUILD_SHARED_LIBS=ON \ %{?runcheck:-DBUILD_TESTING:BOOL=ON -DOPJ_DATA_ROOT=$PWD/../data} \ .. popd @@ -217,9 +221,6 @@ popd %install %make_install -C %{_target_platform} -# Remove static library -rm -f %{buildroot}%{_libdir}/libopenjp2.a - # Rename to avoid conflicts with openjpeg-1.x for file in %{buildroot}%{_bindir}/opj_*; do mv $file ${file/opj_/opj2_} @@ -326,6 +327,9 @@ make test -C %{_target_platform} %changelog +* Mon Dec 25 2017 Sandro Mani - 2.3.0-2 +- Use BUILD_STATIC_LIBS=OFF instead of deleting the static library after build + * Thu Oct 05 2017 Sandro Mani - 2.3.0-1 - Update to 2.3.0 diff --git a/openjpeg2_install.patch b/openjpeg2_install.patch new file mode 100644 index 0000000..9e06fd2 --- /dev/null +++ b/openjpeg2_install.patch @@ -0,0 +1,11 @@ +diff -rupN openjpeg-2.3.0/src/lib/openjp2/CMakeLists.txt openjpeg-2.3.0-new/src/lib/openjp2/CMakeLists.txt +--- openjpeg-2.3.0/src/lib/openjp2/CMakeLists.txt 2017-10-05 00:23:14.000000000 +0200 ++++ openjpeg-2.3.0-new/src/lib/openjp2/CMakeLists.txt 2017-12-25 13:53:07.000000000 +0100 +@@ -99,6 +99,7 @@ else() + set(INSTALL_LIBS ${OPENJPEG_LIBRARY_NAME} openjp2_static) + else() + add_library(${OPENJPEG_LIBRARY_NAME} ${OPENJPEG_SRCS}) ++ set(INSTALL_LIBS ${OPENJPEG_LIBRARY_NAME}) + endif() + endif() +