Add mingw subpackages
This commit is contained in:
parent
75609e47aa
commit
ffbe06730f
106
leptonica.spec
106
leptonica.spec
@ -6,29 +6,49 @@
|
||||
|
||||
Name: leptonica
|
||||
Version: 1.82.0
|
||||
Release: 2%{?dist}
|
||||
Release: 3%{?dist}
|
||||
Summary: C library for efficient image processing and image analysis operations
|
||||
|
||||
License: Leptonica
|
||||
URL: https://github.com/danbloomberg/leptonica
|
||||
Source0: https://github.com/DanBloomberg/leptonica/archive/%{version}/%{name}-%{version}.tar.gz
|
||||
# Honour LIB_SÙFFIX
|
||||
# Fix library version
|
||||
Patch0: leptonica_cmake.patch
|
||||
|
||||
BuildRequires: gcc
|
||||
BuildRequires: automake
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: libtool
|
||||
BuildRequires: cmake
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: giflib-devel
|
||||
BuildRequires: libjpeg-devel
|
||||
BuildRequires: libpng-devel
|
||||
BuildRequires: libtiff-devel
|
||||
BuildRequires: libtool
|
||||
BuildRequires: libwebp-devel
|
||||
BuildRequires: make
|
||||
BuildRequires: zlib-devel
|
||||
|
||||
# Needed for several tests
|
||||
%if %{with gnuplot}
|
||||
BuildRequires: gnuplot
|
||||
%endif
|
||||
BuildRequires: make
|
||||
|
||||
BuildRequires: mingw32-filesystem >= 95
|
||||
BuildRequires: mingw32-gcc-c++
|
||||
BuildRequires: mingw32-libjpeg-turbo
|
||||
BuildRequires: mingw32-libtiff
|
||||
BuildRequires: mingw32-libpng
|
||||
BuildRequires: mingw32-zlib
|
||||
BuildRequires: mingw32-giflib
|
||||
BuildRequires: mingw32-libwebp
|
||||
|
||||
BuildRequires: mingw64-filesystem >= 95
|
||||
BuildRequires: mingw64-gcc-c++
|
||||
BuildRequires: mingw64-libjpeg-turbo
|
||||
BuildRequires: mingw64-libtiff
|
||||
BuildRequires: mingw64-libpng
|
||||
BuildRequires: mingw64-zlib
|
||||
BuildRequires: mingw64-giflib
|
||||
BuildRequires: mingw64-libwebp
|
||||
|
||||
|
||||
%description
|
||||
@ -67,44 +87,98 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
The %{name}-tools package contains leptonica utility tools.
|
||||
|
||||
|
||||
%package -n mingw32-%{name}
|
||||
Summary: MinGW Windows Leptonica library
|
||||
Obsoletes: mingw32-%{name}-static
|
||||
|
||||
%description -n mingw32-%{name}
|
||||
MinGW Windows Leptonica library.
|
||||
|
||||
|
||||
%package -n mingw64-%{name}
|
||||
Summary: MinGW Windows Leptonica library
|
||||
Obsoletes: mingw64-%{name}-static
|
||||
|
||||
%description -n mingw64-%{name}
|
||||
MinGW Windows Leptonica library.
|
||||
|
||||
|
||||
%{?mingw_debug_package}
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -p1
|
||||
|
||||
|
||||
%build
|
||||
autoreconf -ifv
|
||||
%configure --disable-static --program-prefix=leptonica-
|
||||
%make_build
|
||||
# Native build
|
||||
%cmake -DBUILD_PROG=ON
|
||||
%cmake_build
|
||||
|
||||
# MinGW build
|
||||
%mingw_cmake -DBUILD_PROG=ON -DSW_BUILD=OFF
|
||||
%mingw_make_build
|
||||
|
||||
|
||||
%install
|
||||
%make_install
|
||||
rm -f %{buildroot}%{_libdir}/*.la
|
||||
install -Dpm 0644 lept.pc %{buildroot}/%{_libdir}/pkgconfig
|
||||
%cmake_install
|
||||
%mingw_make_install
|
||||
|
||||
# Compat symlinks
|
||||
ln -s %{_libdir}/libleptonica.so %{buildroot}%{_libdir}/liblept.so
|
||||
ln -s %{mingw32_libdir}/libleptonica.dll.a %{buildroot}%{mingw32_libdir}/liblept.dll.a
|
||||
ln -s %{mingw64_libdir}/libleptonica.dll.a %{buildroot}%{mingw64_libdir}/liblept.dll.a
|
||||
|
||||
|
||||
%mingw_debug_install_post
|
||||
|
||||
|
||||
%check
|
||||
make check VERBOSE=1
|
||||
%ctest
|
||||
|
||||
|
||||
%files
|
||||
%license leptonica-license.txt
|
||||
%doc README.html version-notes.html
|
||||
%{_libdir}/liblept.so.5*
|
||||
%{_libdir}/libleptonica.so.5*
|
||||
|
||||
%files devel
|
||||
%{_includedir}/%{name}
|
||||
%{_libdir}/liblept.so
|
||||
%{_libdir}/libleptonica.so
|
||||
%{_libdir}/pkgconfig/lept.pc
|
||||
%{_libdir}/cmake/LeptonicaConfig-version.cmake
|
||||
%{_libdir}/cmake/LeptonicaConfig.cmake
|
||||
%{_libdir}/cmake/leptonica/
|
||||
|
||||
%files tools
|
||||
%{_bindir}/*
|
||||
|
||||
%files -n mingw32-%{name}
|
||||
%license leptonica-license.txt
|
||||
%{mingw32_bindir}/*.exe
|
||||
%{mingw32_bindir}/libleptonica-5.dll
|
||||
%{mingw32_includedir}/leptonica/
|
||||
%{mingw32_libdir}/liblept.dll.a
|
||||
%{mingw32_libdir}/libleptonica.dll.a
|
||||
%{mingw32_libdir}/pkgconfig/lept.pc
|
||||
%{mingw32_libdir}/cmake/leptonica/
|
||||
|
||||
|
||||
%files -n mingw64-%{name}
|
||||
%license leptonica-license.txt
|
||||
%{mingw64_bindir}/*.exe
|
||||
%{mingw64_bindir}/libleptonica-5.dll
|
||||
%{mingw64_includedir}/leptonica/
|
||||
%{mingw64_libdir}/liblept.dll.a
|
||||
%{mingw64_libdir}/libleptonica.dll.a
|
||||
%{mingw64_libdir}/pkgconfig/lept.pc
|
||||
%{mingw64_libdir}/cmake/leptonica/
|
||||
|
||||
|
||||
%changelog
|
||||
* Sat Feb 19 2022 Sandro Mani <manisandro@gmail.com> - 1.82.0-3
|
||||
- Add mingw subpackage
|
||||
- Port to cmake
|
||||
|
||||
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.82.0-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||
|
||||
|
||||
57
leptonica_cmake.patch
Normal file
57
leptonica_cmake.patch
Normal file
@ -0,0 +1,57 @@
|
||||
diff -rupN leptonica-1.82.0/CMakeLists.txt leptonica-1.82.0-new/CMakeLists.txt
|
||||
--- leptonica-1.82.0/CMakeLists.txt 2021-09-22 23:23:41.000000000 +0200
|
||||
+++ leptonica-1.82.0-new/CMakeLists.txt 2022-02-22 23:06:47.081641319 +0100
|
||||
@@ -57,7 +57,7 @@ if(UNIX)
|
||||
option(SYM_LINK "Create symlink leptonica -> lept on UNIX" OFF)
|
||||
endif()
|
||||
|
||||
-set(leptonica_INSTALL_CMAKE_DIR "lib/cmake/leptonica"
|
||||
+set(leptonica_INSTALL_CMAKE_DIR "lib${LIB_SUFFIX}/cmake/leptonica"
|
||||
CACHE STRING "Install destination for CMake package files")
|
||||
|
||||
if(NOT SW_BUILD)
|
||||
@@ -275,7 +275,7 @@ configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/LeptonicaConfig.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/LeptonicaConfig.cmake @ONLY)
|
||||
|
||||
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lept.pc DESTINATION lib/pkgconfig)
|
||||
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lept.pc DESTINATION lib${LIB_SUFFIX}/pkgconfig)
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/LeptonicaConfig.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/LeptonicaConfig-version.cmake
|
||||
diff -rupN leptonica-1.82.0/src/CMakeLists.txt leptonica-1.82.0-new/src/CMakeLists.txt
|
||||
--- leptonica-1.82.0/src/CMakeLists.txt 2021-09-22 23:23:41.000000000 +0200
|
||||
+++ leptonica-1.82.0-new/src/CMakeLists.txt 2022-02-22 23:06:02.035449743 +0100
|
||||
@@ -17,11 +17,11 @@ endif()
|
||||
string(REPLACE "-O3" "-O2" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
|
||||
|
||||
add_library (leptonica ${src} ${hdr})
|
||||
-set_target_properties (leptonica PROPERTIES VERSION ${VERSION_PLAIN})
|
||||
+set_target_properties (leptonica PROPERTIES VERSION 5)
|
||||
set_target_properties (leptonica PROPERTIES SOVERSION 5.4.0)
|
||||
if (WIN32)
|
||||
-set_target_properties (leptonica PROPERTIES OUTPUT_NAME leptonica-${VERSION_PLAIN})
|
||||
-set_target_properties (leptonica PROPERTIES DEBUG_OUTPUT_NAME leptonica-${VERSION_PLAIN}d)
|
||||
+set_target_properties (leptonica PROPERTIES SUFFIX "-5${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
+set_target_properties (leptonica PROPERTIES SUFFIX "-5${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
else()
|
||||
set_target_properties (leptonica PROPERTIES OUTPUT_NAME leptonica)
|
||||
set_target_properties (leptonica PROPERTIES DEBUG_OUTPUT_NAME leptonica)
|
||||
@@ -70,7 +70,7 @@ if (UNIX)
|
||||
${CMAKE_COMMAND} -E create_symlink "$<TARGET_FILE:leptonica>" ${old_target}
|
||||
DEPENDS ${PROJECT_NAME}
|
||||
COMMENT "Creating lept symlink")
|
||||
- install(FILES ${CMAKE_BINARY_DIR}/src/${old_target} DESTINATION lib)
|
||||
+ install(FILES ${CMAKE_BINARY_DIR}/src/${old_target} DESTINATION lib${LIB_SUFFIX})
|
||||
endif(SYM_LINK)
|
||||
endif()
|
||||
|
||||
@@ -89,7 +89,7 @@ else()
|
||||
export(TARGETS leptonica APPEND FILE ${CMAKE_BINARY_DIR}/LeptonicaTargets.cmake)
|
||||
endif()
|
||||
|
||||
-install(TARGETS leptonica EXPORT LeptonicaTargets RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
|
||||
+install(TARGETS leptonica EXPORT LeptonicaTargets RUNTIME DESTINATION bin LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX})
|
||||
install(EXPORT LeptonicaTargets DESTINATION ${leptonica_INSTALL_CMAKE_DIR})
|
||||
install(FILES
|
||||
${hdr}
|
||||
Loading…
Reference in New Issue
Block a user