diff --git a/.gitignore b/.gitignore index 5137c77..b49f426 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /iv-08c48bb.tar.gz +/iv-14890c4.tar.gz diff --git a/0001-Set-soversion-for-shared-objects-on-Linux-builds.patch b/0001-Set-soversion-for-shared-objects-on-Linux-builds.patch new file mode 100644 index 0000000..9ad2420 --- /dev/null +++ b/0001-Set-soversion-for-shared-objects-on-Linux-builds.patch @@ -0,0 +1,34 @@ +From c45eaa30657ef854c5a5ff9e34e6faa0cb0fd546 Mon Sep 17 00:00:00 2001 +From: "Ankur Sinha (Ankur Sinha Gmail)" +Date: Tue, 18 Aug 2020 21:55:02 +0100 +Subject: [PATCH 1/2] Set soversion for shared objects on Linux builds + +--- + src/lib/CMakeLists.txt | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt +index d094738..71f74b7 100644 +--- a/src/lib/CMakeLists.txt ++++ b/src/lib/CMakeLists.txt +@@ -413,6 +413,9 @@ set_property(TARGET interviews PROPERTY POSITION_INDEPENDENT_CODE ON) + if(IV_WINDOWS_BUILD) + target_link_libraries(interviews gdi32 comdlg32) + endif() ++if(NOT IV_WINDOWS_BUILD) ++ set_target_properties(interviews PROPERTIES SOVERSION 0.0.0) ++endif() + + # ============================================================================= + # ivx11dynam +@@ -477,6 +480,7 @@ endif() + if(NOT IV_WINDOWS_BUILD) + if(IV_ENABLE_SHARED) + add_library(unidraw SHARED ${UNIDRAW_SOURCE_FILES}) ++ set_target_properties(unidraw PROPERTIES SOVERSION 0.0.0) + else() + add_library(unidraw STATIC ${UNIDRAW_SOURCE_FILES}) + endif() +-- +2.26.2 + diff --git a/0002-Use-LIB_INSTALL_DIR-instead-of-hardcoding-lib.patch b/0002-Use-LIB_INSTALL_DIR-instead-of-hardcoding-lib.patch new file mode 100644 index 0000000..0e96ebe --- /dev/null +++ b/0002-Use-LIB_INSTALL_DIR-instead-of-hardcoding-lib.patch @@ -0,0 +1,59 @@ +From a0ef151426aaf43068b076ab251f5e56d14bb3a2 Mon Sep 17 00:00:00 2001 +From: "Ankur Sinha (Ankur Sinha Gmail)" +Date: Tue, 18 Aug 2020 21:58:56 +0100 +Subject: [PATCH 2/2] Use LIB_INSTALL_DIR instead of hardcoding lib + +--- + CMakeLists.txt | 9 +++++++-- + src/lib/CMakeLists.txt | 4 ++-- + 2 files changed, 9 insertions(+), 4 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 315729f..1cd1f42 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -60,6 +60,11 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "CYGWIN") + set(CYGWIN 1) + endif() + ++# set up libdir ++if(NOT DEFINED LIB_INSTALL_DIR) ++ set(LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib) ++endif() ++ + # ============================================================================= + # Include cmake modules + # ============================================================================= +@@ -186,8 +191,8 @@ add_subdirectory(src/bin) + # ============================================================================= + install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/include/ DESTINATION include) + if(NOT IV_AS_SUBPROJECT) +- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cmake/iv-config.cmake DESTINATION share/cmake) +- install(EXPORT iv DESTINATION share/cmake) ++ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cmake/iv-config.cmake DESTINATION ${LIB_INSTALL_DIR}/cmake/iv) ++ install(EXPORT iv DESTINATION ${LIB_INSTALL_DIR}/cmake/iv) + endif() + + # ============================================================================= +diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt +index 71f74b7..b783083 100644 +--- a/src/lib/CMakeLists.txt ++++ b/src/lib/CMakeLists.txt +@@ -496,12 +496,12 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/app-defaults/ DESTINATION share/ap + if(NOT IV_WINDOWS_BUILD) + install(TARGETS interviews + EXPORT iv +- DESTINATION lib ++ DESTINATION ${LIB_INSTALL_DIR} + INCLUDES + DESTINATION $) + install(TARGETS unidraw + EXPORT iv +- DESTINATION lib ++ DESTINATION ${LIB_INSTALL_DIR} + INCLUDES + DESTINATION $) + else() +-- +2.26.2 + diff --git a/iv.spec b/iv.spec index f3415e1..140179b 100644 --- a/iv.spec +++ b/iv.spec @@ -3,27 +3,32 @@ # https://github.com/neuronsimulator/iv/issues/15: -Wchar-subscript -%global commit 08c48bbb85434a2fc34cdd483a47c2deae7a289a +%global commit 14890c412662cd7d0c4bce1d777473a904168647 %global shortcommit %(c=%{commit}; echo ${c:0:7}) -%global checkout_date 20191117 +%global checkout_date 20200818 Name: iv -Version: 0 -Release: 0.3.%{checkout_date}git%{shortcommit}%{?dist} +Version: 0.1 +Release: 0.1.%{checkout_date}git%{shortcommit}%{?dist} Summary: InterViews graphical library License: MIT URl: https://github.com/neuronsimulator/%{name} Source0: https://github.com/neuronsimulator/%{name}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz -BuildRequires: /usr/bin/aclocal -BuildRequires: /usr/bin/autoheader -BuildRequires: /usr/bin/autoconf +# Mark libraries and let them be installed in the correct default folder +# https://github.com/neuronsimulator/iv/pull/34 +Patch0: 0001-Set-soversion-for-shared-objects-on-Linux-builds.patch +Patch1: 0002-Use-LIB_INSTALL_DIR-instead-of-hardcoding-lib.patch + +BuildRequires: cmake BuildRequires: /usr/bin/libtoolize BuildRequires: gcc-c++ +BuildRequires: git-core BuildRequires: xorg-x11-server-devel BuildRequires: libXext-devel +BuildRequires: libXcomposite-devel # Is built against a bundled version, does not provide its libraries etc. # https://github.com/neuronsimulator/iv/issues/3 Provides: bundled(libtiff) = 3.00 @@ -45,21 +50,27 @@ developing applications that use %{name}. %prep -%autosetup -n %{name}-%{commit} +%autosetup -n %{name}-%{commit} -S git + +# Remove the rpath helper +sed -i '/RpathHelper/ d' CMakeLists.txt # Remove spurious executable permission chmod -x README Copyright +# remove scripts +find . -name "_gendefs" -delete + %build -./build.sh -export X_LIBS="-lX11 -lXext" -%configure --disable-static -%make_build +%cmake \ +-DIV_ENABLE_SHARED=ON + +%cmake_build %install -%make_install +%cmake_install find $RPM_BUILD_ROOT -name '*.la' -delete # Don't install these, we don't want anyone using them @@ -69,32 +80,50 @@ rm -vrf $RPM_BUILD_ROOT/%{_includedir}/TIFF install -pm 0755 -d $RPM_BUILD_ROOT/%{_datadir}/X11/ mv -v $RPM_BUILD_ROOT/%{_datadir}/app-defaults $RPM_BUILD_ROOT/%{_datadir}/X11/ +# remove stray makefile +rm -f $RPM_BUILD_ROOT/%{_includedir}/Makefile.in +rm -rf $RPM_BUILD_ROOT/%{_includedir}/IV-{Win,Mac} + +# correctly set up shared dirs +pushd $RPM_BUILD_ROOT/%{_libdir}/ + ln -sv ./libinterviews.so.0.0.0 libinterviews.so.0 + ln -sv ./libunidraw.so.0.0.0 libunidraw.so.0 +popd + %files %license Copyright %doc README -%{_libdir}/libIVhines.so.3.0.3 -%{_libdir}/libIVhines.so.3 -%{_libdir}/libUnidrawhines.so.3.0.3 -%{_libdir}/libUnidrawhines.so.3 +%{_libdir}/libinterviews.so.0.0.0 +%{_libdir}/libinterviews.so.0 +%{_libdir}/libunidraw.so.0.0.0 +%{_libdir}/libunidraw.so.0 +%{_datadir}/X11/app-defaults/ %{_bindir}/idemo %{_bindir}/iclass %{_bindir}/idraw -%{_datadir}/X11/app-defaults/ %files devel -%{_includedir}/ivstrm.h -%{_includedir}/ivstream.h -%{_includedir}/ivversion.h %{_includedir}/Dispatch/ -%{_includedir}/OS/ %{_includedir}/IV-2_6/ %{_includedir}/IV-X11/ %{_includedir}/IV-look/ %{_includedir}/InterViews/ -%{_libdir}/libIVhines.so -%{_libdir}/libUnidrawhines.so +%{_includedir}/OS/ +%{_includedir}/Unidraw/ +%{_includedir}/ivcarbon.h +%{_includedir}/ivmcw.h +%{_includedir}/ivstream.h +%{_includedir}/ivversion.h +%{_includedir}/macivdef.h +%{_libdir}/libinterviews.so +%{_libdir}/libunidraw.so +%{_libdir}/cmake/iv/ %changelog +* Tue Aug 18 2020 Ankur Sinha - 0.1-0.1.20200818git14890c4 +- Update to latest upstream snapshot +- move to cmake + * Tue Jul 28 2020 Fedora Release Engineering - 0-0.3.20191117git08c48bb - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild diff --git a/sources b/sources index dea5ae8..2465a07 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (iv-08c48bb.tar.gz) = e1bf504febd8a8c6880658dc6ccf5f46f4d4532aab31137cb5771355d649e12c2d715170c1e89033bd540baf0531464b7ff4ada298299375167e279aab16dafe +SHA512 (iv-14890c4.tar.gz) = 93abf22b4e0d8e0122dbb107ff0b2283ef36e63651207a81699545611e98babfaa3c6b778c15ab7dd160958d6d2e7fe0913f6a69c63517a40c763f1dcaff3315