1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-24 09:25:01 +00:00

graphics/leptonica: Update to 1.82.0

If graphics/tesseract is installed and then graphics/opencv is to be
installed, OpenCV uses TesseractConfig.cmake to check for the presence
of Leptonica and wants to use FindLeptonica.cmake for that. Therefore
the new version adds a file cmake/FindLeptonica.cmake.

After switching from autotools to cmake, the libraries are named as
libleptonica.so instead of liblept.so. Upstream it is not yet decided
which naming will be used in the future [1]. As a workaround, the port
links the new naming to the previous one, since several dependent ports
still use the old names of the libraries.

[1] https://github.com/DanBloomberg/leptonica/issues/253

Changelog: https://github.com/DanBloomberg/leptonica/compare/1.76.0...1.82.0

PR:		260079

Co-authored-by: Daniel Engberg <diizzy@FreeBSD.org>
This commit is contained in:
John Hein 2022-02-13 15:04:54 +01:00 committed by Rainer Hurling
parent dbced39a6b
commit 91c8d5f580
5 changed files with 103 additions and 51 deletions

View File

@ -1,9 +1,13 @@
# Created by: Hiroto Kagotani <hiroto.kagotani@gmail.com>
PORTNAME= leptonica
PORTVERSION= 1.76.0
PORTREVISION= 1
DISTVERSION= 1.82.0
CATEGORIES= graphics
MASTER_SITES= https://github.com/DanBloomberg/${PORTNAME}/releases/download/${DISTVERSION}/ \
http://www.${PORTNAME}.org/source/
PATCH_SITES= https://github.com/DanBloomberg/leptonica/commit/
PATCHFILES= b282ed9482e335439ccc429d4cd1dba517ba0c4d.patch:-p1
MAINTAINER= hiroto.kagotani@gmail.com
COMMENT= C library for efficient image processing and image analysis operations
@ -11,52 +15,42 @@ COMMENT= C library for efficient image processing and image analysis operations
LICENSE= BSD2CLAUSE
LICENSE_FILE= ${WRKSRC}/leptonica-license.txt
USES= cmake cpe localbase pkgconfig
USE_LDCONFIG= yes
CONFLICTS= leptonlib
USES= autoreconf cpe libtool localbase:ldflags pathfix pkgconfig
CMAKE_ON= BUILD_SHARED_LIBS
USE_GITHUB= yes
GH_ACCOUNT= DanBloomberg
GNU_CONFIGURE= yes
USE_LDCONFIG= yes
INSTALL_TARGET= install-strip
OPTIONS_DEFINE= BIN GIF JPEG JPEG2000 PNG TIFF WEBP ZLIB
OPTIONS_DEFAULT= BIN GIF JPEG PNG TIFF WEBP ZLIB
OPTIONS_DEFINE= BIN GIF JPEG JPEG2000 PNG TIFF WEBP
OPTIONS_DEFAULT= BIN GIF JPEG PNG TIFF WEBP
OPTIONS_SUB= yes
BIN_DESC= Build additional programs
BIN_CONFIGURE_ENABLE= programs
BIN_CMAKE_BOOL= BUILD_PROG
GIF_LIB_DEPENDS= libgif.so:graphics/giflib
GIF_CONFIGURE_WITH= giflib
JPEG_USES= jpeg
JPEG_CONFIGURE_WITH= jpeg
GIF_CMAKE_OFF= CMAKE_DISABLE_FIND_PACKAGE_GIF:BOOL=True
JPEG2000_LIB_DEPENDS= libopenjp2.so:graphics/openjpeg
JPEG2000_CONFIGURE_WITH=libopenjpeg
JPEG2000_CMAKE_BOOL= OPENJPEG_SUPPORT
JPEG_USES= jpeg
JPEG_CMAKE_OFF= CMAKE_DISABLE_FIND_PACKAGE_JPEG:BOOL=True
PNG_LIB_DEPENDS= libpng.so:graphics/png
PNG_CONFIGURE_WITH= libpng
PNG_CMAKE_OFF= CMAKE_DISABLE_FIND_PACKAGE_PNG:BOOL=True
TIFF_LIB_DEPENDS= libtiff.so:graphics/tiff
TIFF_CONFIGURE_WITH= libtiff
TIFF_CMAKE_OFF= CMAKE_DISABLE_FIND_PACKAGE_TIFF
WEBP_LIB_DEPENDS= libwebp.so:graphics/webp
WEBP_CONFIGURE_WITH= libwebp
ZLIB_CONFIGURE_WITH= zlib
WEBP_CMAKE_BOOL= LIBWEBP_SUPPORT
TESTS?= generate compare
.if defined(MAINTAINER_MODE) || defined(PACKAGE_BUILDING)
BUILD_DEPENDS+= ${LOCALBASE}/bin/gnuplot:math/gnuplot
.endif
#the display portion of the regression tests is interactive,
#and requires the use of xv, xli or xzgv as an image viewer
.if defined(MAINTAINER_MODE) && !defined(BATCH)
TESTS+= display
.endif
do-test:
.for c in ${TESTS}
@cd ${WRKSRC}/prog; ${SETENV} \
LD_LIBRARY_PATH="${WRKSRC}/src/.libs:${LOCALBASE}/lib" \
${WRKSRC}/prog/alltests_reg ${c}
.endfor
post-install:
${RLN} ${STAGEDIR}${PREFIX}/lib/libleptonica.so.5.4.0 \
${STAGEDIR}${PREFIX}/lib/liblept.so
${RLN} ${STAGEDIR}${PREFIX}/lib/libleptonica.so.5.4.0 \
${STAGEDIR}${PREFIX}/lib/liblept.so.5
${RLN} ${STAGEDIR}${PREFIX}/lib/libleptonica.so.5.4.0 \
${STAGEDIR}${PREFIX}/lib/liblept.so.5.4.0
${MKDIR} ${STAGEDIR}${PREFIX}/share/cmake/Modules
${INSTALL_DATA} ${WRKSRC}/cmake/FindLeptonica.cmake \
${STAGEDIR}${PREFIX}/share/cmake/Modules/
.include <bsd.port.mk>

View File

@ -1,3 +1,5 @@
TIMESTAMP = 1526412216
SHA256 (DanBloomberg-leptonica-1.76.0_GH0.tar.gz) = ff98ffef6103cda0e400676f81113a8157569ac0f453c6e03a1a27b305ba25a7
SIZE (DanBloomberg-leptonica-1.76.0_GH0.tar.gz) = 11557709
TIMESTAMP = 1641427253
SHA256 (leptonica-1.82.0.tar.gz) = 155302ee914668c27b6fe3ca9ff2da63b245f6d62f3061c8f27563774b8ae2d6
SIZE (leptonica-1.82.0.tar.gz) = 14041481
SHA256 (b282ed9482e335439ccc429d4cd1dba517ba0c4d.patch) = 5a9b7afa4adf0d72338c38ff802f4b312bcee3f06bde697177b905d3c7a60a38
SIZE (b282ed9482e335439ccc429d4cd1dba517ba0c4d.patch) = 13952

View File

@ -0,0 +1,55 @@
--- cmake/FindLeptonica.cmake.orig 2021-11-28 11:06:50 UTC
+++ cmake/FindLeptonica.cmake
@@ -0,0 +1,52 @@
+#
+# Find Leptonica
+#
+# Exported variables:
+# Leptonica_FOUND
+# Leptonica_INCLUDE_DIRS
+# Leptonica_LIBRARIES
+#
+# Leptonica_VERSION
+# Leptonica_MAJOR_VERSION
+# Leptonica_MINOR_VERSION
+#
+
+find_path(Leptonica_INCLUDE_DIR leptonica/allheaders.h
+ HINTS
+ /usr/include
+ /usr/local/include
+ /opt/include
+ /opt/local/include
+ ${Leptonica_DIR}/include
+)
+if(NOT "${Leptonica_INCLUDE_DIR}" EQUAL "Leptonica_INCLUDE_DIR-NOTFOUND")
+ set(Leptonica_INCLUDE_DIRS ${Leptonica_INCLUDE_DIR}/leptonica)
+ file(STRINGS ${Leptonica_INCLUDE_DIRS}/allheaders.h Leptonica_MAJOR_VERSION REGEX "LIBLEPT_MAJOR_VERSION")
+ file(STRINGS ${Leptonica_INCLUDE_DIRS}/allheaders.h Leptonica_MINOR_VERSION REGEX "LIBLEPT_MINOR_VERSION")
+ string(REGEX MATCH "[0-9]+" Leptonica_MAJOR_VERSION ${Leptonica_MAJOR_VERSION})
+ string(REGEX MATCH "[0-9]+" Leptonica_MINOR_VERSION ${Leptonica_MINOR_VERSION})
+ set(Leptonica_VERSION ${Leptonica_MAJOR_VERSION}.${Leptonica_MINOR_VERSION})
+endif()
+
+find_library(Leptonica_LIBRARY NAMES lept liblept
+ HINTS
+ /usr/lib
+ /usr/local/lib
+ /opt/lib
+ /opt/local/lib
+ ${Leptonica_DIR}/lib
+)
+set(Leptonica_LIBRARIES ${Leptonica_LIBRARY})
+
+include(FindPackageHandleStandardArgs)
+
+find_package_handle_standard_args(Leptonica
+ REQUIRED_VARS
+ Leptonica_INCLUDE_DIRS
+ Leptonica_LIBRARIES
+ VERSION_VAR Leptonica_VERSION
+ FAIL_MESSAGE "Try to set Leptonica_DIR or Leptonica_ROOT"
+)
+
+mark_as_advanced(Leptonica_INCLUDE_DIRS Leptonica_LIBRARIES)
+

View File

@ -1,9 +0,0 @@
--- src/Makefile.am.orig 2018-05-02 22:12:19 UTC
+++ src/Makefile.am
@@ -1,5 +1,5 @@
AM_CFLAGS = $(DEBUG_FLAGS)
-AM_CPPFLAGS = $(ZLIB_CFLAGS) $(LIBPNG_CFLAGS) $(JPEG_CFLAGS) $(LIBTIFF_CFLAGS) $(LIBWEBP_CFLAGS) $(LIBJP2K_CFLAGS)
+AM_CPPFLAGS = $(LIBJP2K_CFLAGS) $(ZLIB_CFLAGS) $(LIBPNG_CFLAGS) $(JPEG_CFLAGS) $(LIBTIFF_CFLAGS) $(LIBWEBP_CFLAGS)
lib_LTLIBRARIES = liblept.la
liblept_la_LIBADD = $(LIBM) $(ZLIB_LIBS) $(LIBPNG_LIBS) $(JPEG_LIBS) $(GIFLIB_LIBS) $(LIBTIFF_LIBS) $(LIBWEBP_LIBS) $(LIBJP2K_LIBS) $(GDI_LIBS)

View File

@ -6,6 +6,7 @@
%%BIN%%bin/converttopdf
%%BIN%%bin/converttops
%%BIN%%bin/fileinfo
%%BIN%%bin/imagetops
%%BIN%%bin/xtractprotos
include/leptonica/allheaders.h
include/leptonica/alltypes.h
@ -17,10 +18,12 @@ include/leptonica/bmf.h
include/leptonica/bmfdata.h
include/leptonica/bmp.h
include/leptonica/ccbord.h
include/leptonica/colorfill.h
include/leptonica/dewarp.h
include/leptonica/endianness.h
include/leptonica/environ.h
include/leptonica/gplot.h
include/leptonica/hashmap.h
include/leptonica/heap.h
include/leptonica/imageio.h
include/leptonica/jbclass.h
@ -38,8 +41,15 @@ include/leptonica/stack.h
include/leptonica/stringcode.h
include/leptonica/sudoku.h
include/leptonica/watershed.h
lib/liblept.a
lib/cmake/leptonica/LeptonicaConfig-version.cmake
lib/cmake/leptonica/LeptonicaConfig.cmake
lib/cmake/leptonica/LeptonicaTargets-%%CMAKE_BUILD_TYPE%%.cmake
lib/cmake/leptonica/LeptonicaTargets.cmake
lib/liblept.so
lib/liblept.so.5
lib/liblept.so.5.0.3
lib/liblept.so.5.4.0
lib/libleptonica.so
lib/libleptonica.so.5
lib/libleptonica.so.5.4.0
libdata/pkgconfig/lept.pc
share/cmake/Modules/FindLeptonica.cmake