Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libgeotiff: add version 1.7.3 #24156

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions recipes/libgeotiff/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"1.7.3":
url: "https://github.com/OSGeo/libgeotiff/releases/download/1.7.3/libgeotiff-1.7.3.tar.gz"
sha256: "ba23a3a35980ed3de916e125c739251f8e3266be07540200125a307d7cf5a704"
"1.7.1":
url: "https://github.com/OSGeo/libgeotiff/releases/download/1.7.1/libgeotiff-1.7.1.tar.gz"
sha256: "05ab1347aaa471fc97347d8d4269ff0c00f30fa666d956baba37948ec87e55d6"
Expand All @@ -12,11 +15,23 @@ sources:
url: "https://github.com/OSGeo/libgeotiff/releases/download/1.5.1/libgeotiff-1.5.1.tar.gz"
sha256: "f9e99733c170d11052f562bcd2c7cb4de53ed405f7acdde4f16195cd3ead612c"
patches:
"1.7.3":
- patch_file: "patches/fix-cmake-1.7.3.patch"
patch_description: "disable fPIC, disable checking functions, disable libxtiff"
patch_type: "portability"
"1.7.1":
- patch_file: "patches/fix-cmake-1.7.1.patch"
patch_description: "fix order CMAKE_MINIMUM_REQUIRED and PROJECT, disable fPIC, disable checking functions, disable libxtiff"
patch_type: "portability"
"1.7.0":
- patch_file: "patches/fix-cmake-1.6.0.patch"
patch_description: "fix order CMAKE_MINIMUM_REQUIRED and PROJECT, disable fPIC, disable checking functions, disable libxtiff"
patch_type: "portability"
"1.6.0":
- patch_file: "patches/fix-cmake-1.6.0.patch"
patch_description: "fix order CMAKE_MINIMUM_REQUIRED and PROJECT, disable fPIC, disable checking functions, disable libxtiff"
patch_type: "portability"
"1.5.1":
- patch_file: "patches/fix-cmake-1.5.1.patch"
patch_description: "fix order CMAKE_MINIMUM_REQUIRED and PROJECT, disable fPIC, disable checking functions, disable libxtiff"
patch_type: "portability"
30 changes: 24 additions & 6 deletions recipes/libgeotiff/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,26 @@ class LibgeotiffConan(ConanFile):
description = "Libgeotiff is an open source library normally hosted on top " \
"of libtiff for reading, and writing GeoTIFF information tags."
license = ["MIT", "BSD-3-Clause"]
topics = ("geotiff", "tiff")
homepage = "https://github.com/OSGeo/libgeotiff"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/OSGeo/libgeotiff"
topics = ("geotiff", "tiff")
package_type = "library"
settings = "os", "arch", "compiler", "build_type"
options = {
"shared": [True, False],
"fPIC": [True, False],
"with_tiff": [True, False],
"with_zlib": [True, False],
"with_jpeg": [True, False],
"with_towgs84": [True, False],
}
default_options = {
"shared": False,
"fPIC": True,
"with_tiff": True,
"with_zlib": False,
"with_jpeg": False,
"with_towgs84": True,
}

def export_sources(self):
Expand All @@ -43,19 +51,28 @@ def layout(self):
cmake_layout(self, src_folder="src")

def requirements(self):
# libgeotiff/include/xtiffio.h includes libtiff/include/tiffio.h
self.requires("libtiff/4.6.0", transitive_headers=True, transitive_libs=True)
self.requires("proj/9.3.1")
# libgeotiff/include/xtiffio.h includes libtiff/include/tiffio.h
if self.options.with_tiff:
self.requires("libtiff/4.6.0", transitive_headers=True, transitive_libs=True)
if self.options.with_zlib:
self.requires("zlib/[>=1.2.11 <2]")
if self.options.with_jpeg:
self.requires("libjpeg/9e")

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)

def generate(self):
tc = CMakeToolchain(self)
tc.variables["WITH_UTILITIES"] = False
tc.variables["WITH_TOWGS84"] = True
tc.cache_variables["WITH_UTILITIES"] = False
tc.cache_variables["WITH_TIFF"] = self.options.with_tiff
tc.cache_variables["WITH_ZLIB"] = self.options.with_zlib
tc.cache_variables["WITH_JPEG"] = self.options.with_jpeg
tc.cache_variables["WITH_TOWGS84"] = self.options.with_towgs84
tc.generate()
deps = CMakeDeps(self)
deps.set_property("proj", "cmake_file_name", "PROJ")
deps.generate()

def build(self):
Expand All @@ -71,6 +88,7 @@ def package(self):
rmdir(self, os.path.join(self.package_folder, "cmake"))
rmdir(self, os.path.join(self.package_folder, "doc"))
rmdir(self, os.path.join(self.package_folder, "share"))
rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is a pkgconfig file in this new version, you should add pkg_config_name property in package_info()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SpaceIm
Thank you for your pointing.
I add set_property("cmake_target_name", "geotiff_library").

self._create_cmake_module_variables(
os.path.join(self.package_folder, self._module_vars_file)
)
Expand Down
51 changes: 13 additions & 38 deletions recipes/libgeotiff/all/patches/fix-cmake-1.5.1.patch
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c298a2e..bc0b6c1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,6 +5,7 @@
Expand Down Expand Up @@ -46,31 +48,25 @@
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMPILE_FLAGS} -std=c99")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILE_FLAGS} -std=c++98")
IF(GEOTIFF_BUILD_PEDANTIC)
@@ -120,6 +121,7 @@ INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR})
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/libxtiff)
@@ -171,7 +172,7 @@ IF(WITH_TIFF)
FIND_PACKAGE(TIFF REQUIRED)
endif ()

# TIFF support - required, default=ON
+if(0)
SET(WITH_TIFF TRUE CACHE BOOL "Choose if TIFF support should be built")

FIND_PACKAGE(PROJ NO_MODULE QUIET)
@@ -192,6 +194,7 @@ IF(WITH_TIFF)
ADD_DEFINITIONS(-DHAVE_TIFF=1)
ENDIF(TIFF_FOUND)
ENDIF(WITH_TIFF)
+endif()

# Turn off TOWGS84 support
SET(WITH_TOWGS84 TRUE CACHE BOOL "Build with TOWGS84 support")
@@ -300,7 +303,6 @@ INSTALL(FILES ${GEOTIFF_LIB_HEADERS} DESTINATION include)
- IF(TIFF_FOUND)
+ IF(0)
# Confirm required API is available
INCLUDE(CheckFunctionExists)
SET(CMAKE_REQUIRED_LIBRARIES ${TIFF_LIBRARIES})
@@ -300,7 +301,7 @@ INSTALL(FILES ${GEOTIFF_LIB_HEADERS} DESTINATION include)
###############################################################################
# Build libxtiff library

-ADD_SUBDIRECTORY(libxtiff)
+# ADD_SUBDIRECTORY(libxtiff)

###############################################################################
# Build libgeotiff library
@@ -345,7 +347,7 @@ IF(UNIX)
@@ -345,7 +346,7 @@ IF(UNIX)
VERSION ${LINK_VERSION}
SOVERSION ${LINK_SOVERSION}
CLEAN_DIRECT_OUTPUT 1 )
Expand All @@ -79,24 +75,3 @@
set_target_properties(
${GEOTIFF_LIBRARY_TARGET}
PROPERTIES
@@ -361,11 +363,15 @@ ENDIF(UNIX)
SET_TARGET_PROPERTIES(${GEOTIFF_LIBRARY_TARGET} PROPERTIES
OUTPUT_NAME ${GEOTIFF_LIB_NAME})

-TARGET_LINK_LIBRARIES(${GEOTIFF_LIBRARY_TARGET}
- ${TIFF_LIBRARIES}
- ${PROJ_LIBRARIES}
- ${ZLIB_LIBRARIES}
- ${JPEG_LIBRARIES})
+find_package(TIFF REQUIRED)
+target_link_libraries(${GEOTIFF_LIBRARY_TARGET} TIFF::TIFF)
+find_package(proj4 QUIET CONFIG)
+if(TARGET PROJ4::proj)
+ target_link_libraries(${GEOTIFF_LIBRARY_TARGET} PROJ4::proj)
+else()
+ find_package(proj REQUIRED CONFIG)
+ target_link_libraries(${GEOTIFF_LIBRARY_TARGET} PROJ::proj)
+endif()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't want to remove this. zlib & libjpeg are not direct dependencies of libgeotiff, it's old CMake style.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SpaceIm
Thanks!
I fixed.


# INSTALL(TARGETS ${GEOTIFF_ARCHIVE_TARGET} ${GEOTIFF_LIBRARY_TARGET}
# RUNTIME DESTINATION ${GEOTIFF_BIN_DIR}
78 changes: 16 additions & 62 deletions recipes/libgeotiff/all/patches/fix-cmake-1.6.0.patch
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 43113fa..f8f85f8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,6 +5,7 @@
# Author: Mateusz Loskot <mateusz@loskot.net>
#
###############################################################################
+CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
+CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0)
PROJECT(GeoTIFF)

SET(GEOTIFF_LIB_NAME geotiff)
Expand All @@ -16,28 +18,7 @@

SET(CMAKE_COLOR_MAKEFILE ON)

@@ -54,7 +54,7 @@ IF(CMAKE_BUILD_TYPE MATCHES Debug)
SET(GEOTIFF_BUILD_PEDANTIC TRUE)
ENDIF()

-if (CMAKE_MAJOR_VERSION GREATER 2)
+if(0) # No ! we want CMP0042 NEW for relocatable shared lib on macOS
cmake_policy(SET CMP0022 OLD) # interface link libraries
cmake_policy(SET CMP0042 OLD) # osx rpath
endif()
@@ -80,8 +80,9 @@ SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)

IF(WIN32)
IF(MSVC)
- ADD_DEFINITIONS(-DBUILD_AS_DLL=1)
- ADD_DEFINITIONS(/DW4)
+ IF(BUILD_SHARED_LIBS)
+ ADD_DEFINITIONS(-DBUILD_AS_DLL=1)
+ ENDIF()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't remove this, there is even a comment explaining why :/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SpaceIm
Fixed.

if (NOT (MSVC_VERSION VERSION_LESS 1400))
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
@@ -92,7 +93,7 @@ IF(WIN32)
@@ -92,7 +92,7 @@ IF(WIN32)
ENDIF()

IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
Expand All @@ -46,31 +27,25 @@
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMPILE_FLAGS} -std=c99")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILE_FLAGS} -std=c++98")
IF(GEOTIFF_BUILD_PEDANTIC)
@@ -120,6 +121,7 @@ INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR})
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/libxtiff)

# TIFF support - required, default=ON
+if(0)
SET(WITH_TIFF TRUE CACHE BOOL "Choose if TIFF support should be built")

FIND_PACKAGE(PROJ NO_MODULE QUIET)
@@ -192,6 +194,7 @@ IF(WITH_TIFF)
ADD_DEFINITIONS(-DHAVE_TIFF=1)
ENDIF(TIFF_FOUND)
ENDIF(WITH_TIFF)
+endif()

# Turn off TOWGS84 support
SET(WITH_TOWGS84 TRUE CACHE BOOL "Build with TOWGS84 support")
@@ -301,7 +304,6 @@ INSTALL(FILES ${GEOTIFF_LIB_HEADERS} DESTINATION include)
@@ -171,7 +171,7 @@ IF(WITH_TIFF)
FIND_PACKAGE(TIFF REQUIRED)
endif ()

- IF(TIFF_FOUND)
+ IF(0)
# Confirm required API is available
INCLUDE(CheckFunctionExists)
SET(CMAKE_REQUIRED_LIBRARIES ${TIFF_LIBRARIES})
@@ -301,7 +301,7 @@ INSTALL(FILES ${GEOTIFF_LIB_HEADERS} DESTINATION include)
###############################################################################
# Build libxtiff library

-ADD_SUBDIRECTORY(libxtiff)
+# ADD_SUBDIRECTORY(libxtiff)

###############################################################################
# Build libgeotiff library
@@ -346,7 +348,7 @@ IF(UNIX)
@@ -346,7 +346,7 @@ IF(UNIX)
VERSION ${LINK_VERSION}
SOVERSION ${LINK_SOVERSION}
CLEAN_DIRECT_OUTPUT 1 )
Expand All @@ -79,24 +54,3 @@
set_target_properties(
${GEOTIFF_LIBRARY_TARGET}
PROPERTIES
@@ -362,11 +364,15 @@ ENDIF(UNIX)
SET_TARGET_PROPERTIES(${GEOTIFF_LIBRARY_TARGET} PROPERTIES
OUTPUT_NAME ${GEOTIFF_LIB_NAME})

-TARGET_LINK_LIBRARIES(${GEOTIFF_LIBRARY_TARGET}
- ${TIFF_LIBRARIES}
- ${PROJ_LIBRARIES}
- ${ZLIB_LIBRARIES}
- ${JPEG_LIBRARIES})
+find_package(TIFF REQUIRED)
+target_link_libraries(${GEOTIFF_LIBRARY_TARGET} TIFF::TIFF)
+find_package(proj4 QUIET CONFIG)
+if(TARGET PROJ4::proj)
+ target_link_libraries(${GEOTIFF_LIBRARY_TARGET} PROJ4::proj)
+else()
+ find_package(proj REQUIRED CONFIG)
+ target_link_libraries(${GEOTIFF_LIBRARY_TARGET} PROJ::proj)
+endif()

# INSTALL(TARGETS ${GEOTIFF_ARCHIVE_TARGET} ${GEOTIFF_LIBRARY_TARGET}
# RUNTIME DESTINATION ${GEOTIFF_BIN_DIR}
35 changes: 5 additions & 30 deletions recipes/libgeotiff/all/patches/fix-cmake-1.7.1.patch
Original file line number Diff line number Diff line change
Expand Up @@ -25,45 +25,20 @@
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMPILE_FLAGS} -std=c99")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILE_FLAGS} -std=c++98")
IF(GEOTIFF_BUILD_PEDANTIC)
@@ -115,15 +115,14 @@ INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/libxtiff)
# TIFF support - required, default=ON
SET(WITH_TIFF TRUE CACHE BOOL "Choose if TIFF support should be built")

-FIND_PACKAGE(PROJ NO_MODULE QUIET)
-if (NOT PROJ_FOUND)
+FIND_PACKAGE(proj NO_MODULE QUIET)
+if (0)
FIND_PACKAGE(PROJ)
endif ()

IF(PROJ_FOUND)
INCLUDE_DIRECTORIES(${PROJ_INCLUDE_DIR})
ELSE()
- MESSAGE(FATAL_ERROR "Failed to detect PROJ >= 6")
ENDIF()

# Zlib support - optional, default=OFF
@@ -164,6 +163,7 @@ IF(WITH_TIFF)
@@ -164,6 +164,6 @@ IF(WITH_TIFF)
FIND_PACKAGE(TIFF REQUIRED)
endif ()

+ if(0)
IF(TIFF_FOUND)
- IF(TIFF_FOUND)
+ IF(0)
# Confirm required API is available
INCLUDE(CheckFunctionExists)
@@ -184,6 +184,7 @@ IF(WITH_TIFF)
INCLUDE_DIRECTORIES(${TIFF_INCLUDE_DIR})
ADD_DEFINITIONS(-DHAVE_TIFF=1)
ENDIF(TIFF_FOUND)
+ endif()
ENDIF(WITH_TIFF)

# Turn off TOWGS84 support
@@ -275,7 +276,6 @@ INSTALL(FILES ${GEOTIFF_LIB_HEADERS} DESTINATION ${GEOTIFF_INCLUDE_DIR})
@@ -275,7 +275,7 @@ INSTALL(FILES ${GEOTIFF_LIB_HEADERS} DESTINATION ${GEOTIFF_INCLUDE_DIR})
###############################################################################
# Build libxtiff library

-ADD_SUBDIRECTORY(libxtiff)
+# ADD_SUBDIRECTORY(libxtiff)

###############################################################################
# Build libgeotiff library
Expand Down
40 changes: 40 additions & 0 deletions recipes/libgeotiff/all/patches/fix-cmake-1.7.3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4862f86..0fbc867 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -92,7 +92,7 @@ IF(WIN32)
ENDIF()

IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
- SET(COMPILE_FLAGS "-fPIC -Wall -Wno-long-long")
+ SET(COMPILE_FLAGS "-Wall -Wno-long-long")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMPILE_FLAGS} -std=c99")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILE_FLAGS} -std=c++98")
IF(GEOTIFF_BUILD_PEDANTIC)
@@ -168,7 +168,7 @@ IF(WITH_TIFF)
FIND_PACKAGE(TIFF REQUIRED)
endif ()

- IF(TIFF_FOUND)
+ IF(0)
# Confirm required API is available
INCLUDE(CheckFunctionExists)
SET(CMAKE_REQUIRED_LIBRARIES ${TIFF_LIBRARIES})
@@ -258,7 +258,7 @@ INSTALL(FILES ${GEOTIFF_LIB_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
###############################################################################
# Build libxtiff library

-ADD_SUBDIRECTORY(libxtiff)
+# ADD_SUBDIRECTORY(libxtiff)

###############################################################################
# Build libgeotiff library
@@ -302,7 +302,7 @@ if(UNIX)
VERSION ${LINK_VERSION}
SOVERSION ${LINK_SOVERSION}
CLEAN_DIRECT_OUTPUT 1 )
- if (APPLE)
+ if (0) # no custom install_name, we want @rpath
set_target_properties(
${GEOTIFF_LIBRARY_TARGET}
PROPERTIES
2 changes: 2 additions & 0 deletions recipes/libgeotiff/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"1.7.3":
folder: "all"
"1.7.1":
folder: "all"
"1.7.0":
Expand Down
Loading