aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArkady Shapkin <arkady.shapkin@gmail.com>2017-08-16 18:08:15 +0300
committerArkady Shapkin <arkady.shapkin@gmail.com>2017-09-04 00:12:56 +0300
commit10f51972cb03ee07a282e44f25c665bce163590e (patch)
tree6fd1b93edc2629995022b5f37b791b7f66a3ef90
parent35a9d223bc14fb4b35d6ad876d208897c8ce590a (diff)
downloadvcpkg-10f51972cb03ee07a282e44f25c665bce163590e.tar.gz
vcpkg-10f51972cb03ee07a282e44f25c665bce163590e.zip
[leptonica] Initial port
-rw-r--r--ports/leptonica/CONTROL4
-rw-r--r--ports/leptonica/fix-cmakelists.patch34
-rw-r--r--ports/leptonica/portfile.cmake36
3 files changed, 74 insertions, 0 deletions
diff --git a/ports/leptonica/CONTROL b/ports/leptonica/CONTROL
new file mode 100644
index 000000000..d0e305c7b
--- /dev/null
+++ b/ports/leptonica/CONTROL
@@ -0,0 +1,4 @@
+Source: leptonica
+Version: 1.74.4
+Description: An open source library containing software that is broadly useful for image processing and image analysis applications
+Build-Depends: libjpeg-turbo, zlib, libpng, tiff, giflib
diff --git a/ports/leptonica/fix-cmakelists.patch b/ports/leptonica/fix-cmakelists.patch
new file mode 100644
index 000000000..18eb8cde5
--- /dev/null
+++ b/ports/leptonica/fix-cmakelists.patch
@@ -0,0 +1,34 @@
+--- a/src/CMakeLists.txt Sun Jun 11 23:04:50 2017
++++ b/src/CMakeLists.txt Wed Aug 16 17:29:56 2017
+@@ -27,24 +27,31 @@
+ endif()
+
+ if (GIF_LIBRARY)
++ target_include_directories (leptonica PUBLIC ${GIF_INCLUDE_DIR})
+ target_link_libraries (leptonica ${GIF_LIBRARY})
+ endif()
+ if (JPEG_LIBRARY)
++ target_include_directories (leptonica PUBLIC ${JPEG_INCLUDE_DIR})
+ target_link_libraries (leptonica ${JPEG_LIBRARY})
+ endif()
+ if (JP2K_FOUND)
++ target_include_directories (leptonica PUBLIC ${JP2K_INCLUDE_DIR})
+ target_link_libraries (leptonica ${JP2K_LIBRARIES})
+ endif()
+ if (PNG_LIBRARY)
++ target_include_directories (leptonica PUBLIC ${PNG_INCLUDE_DIRS})
+ target_link_libraries (leptonica ${PNG_LIBRARY})
+ endif()
+ if (TIFF_LIBRARY)
++ target_include_directories (leptonica PUBLIC ${TIFF_INCLUDE_DIR})
+ target_link_libraries (leptonica ${TIFF_LIBRARY})
+ endif()
+ if (WEBP_FOUND)
++ target_include_directories (leptonica PUBLIC ${WEBP_INCLUDE_DIR})
+ target_link_libraries (leptonica ${WEBP_LIBRARIES})
+ endif()
+ if (ZLIB_LIBRARY)
++ target_include_directories (leptonica PUBLIC ${ZLIB_INCLUDE_DIR})
+ target_link_libraries (leptonica ${ZLIB_LIBRARY})
+ endif()
+
diff --git a/ports/leptonica/portfile.cmake b/ports/leptonica/portfile.cmake
new file mode 100644
index 000000000..a5d4330fd
--- /dev/null
+++ b/ports/leptonica/portfile.cmake
@@ -0,0 +1,36 @@
+include(vcpkg_common_functions)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO DanBloomberg/leptonica
+ REF 1.74.4
+ SHA512 3b9d0be937883f733f72cbdf0b624ec245d9256a8b4622997f437d309efd7ad9695ad1cbe2224d543eb3ef8c44833567b3cc9a95e9a774ef9046b7acaf0ae744
+ HEAD_REF master
+)
+
+vcpkg_apply_patches(
+ SOURCE_PATH ${SOURCE_PATH}
+ PATCHES
+ ${CMAKE_CURRENT_LIST_DIR}/fix-cmakelists.patch
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS
+ -DCMAKE_REQUIRED_INCLUDES=${CURRENT_INSTALLED_DIR}/include # for check_include_file()
+)
+
+vcpkg_install_cmake()
+
+vcpkg_fixup_cmake_targets(CONFIG_PATH "cmake")
+
+vcpkg_copy_pdbs()
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/pkgconfig)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig)
+
+# Handle copyright
+file(COPY ${SOURCE_PATH}/leptonica-license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/leptonica)
+file(RENAME ${CURRENT_PACKAGES_DIR}/share/leptonica/leptonica-license.txt ${CURRENT_PACKAGES_DIR}/share/leptonica/copyright)