[lensfun] Add new port (#34783)

* [lensfun] Add new port

* version

* fix win build

* ver

* try to fix win build

* try again

* fix script tools installation

* ver

* INSTALL_HELPER_SCRIPTS -> OFF

* ver

* typo

* ver

* Apply suggestion

* ver

* Remove feature tool

* ver

---------

Co-authored-by: jyu49 <yu_jack@apple.com>
This commit is contained in:
Jack·Boos·Yu 2023-11-01 03:08:20 +08:00 committed by GitHub
parent 2d9a09dcb8
commit edd68d8a94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 116 additions and 0 deletions

View File

@ -0,0 +1,22 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 087928c..d1664ce 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -102,7 +102,7 @@ IF(BUILD_FOR_SSE2)
ENDIF()
ENDIF()
-IF(WIN32)
+IF(0)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/libs/getopt)
# base path for searching for glib on windows
IF(NOT GLIB2_BASE_DIR)
@@ -205,7 +205,7 @@ IF(BUILD_DOC)
ADD_SUBDIRECTORY(docs)
ENDIF()
-IF(WIN32 AND NOT BUILD_STATIC)
+IF(0)
FIND_FILE(GLIB2_DLL
NAMES glib-2.0-0.dll glib-2.dll glib-2-vs9.dll
PATHS "${GLIB2_BASE_DIR}/bin"

View File

@ -0,0 +1,54 @@
#vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO lensfun/lensfun
REF "v${VERSION}"
SHA512 4db9a08d51ba50c7c2ff528d380bb28e34698b2bb5c40e5f3deeaa5544c888ac7e0f638bbc3f33a4f75dbb67e0425ca36ce6d8cd1d8c043a4173a2df47de08c6
HEAD_REF master
PATCHES fix_build.patch
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" LENSFUN_STATIC_LIB)
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" LENSFUN_STATIC_CRT)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
sse BUILD_FOR_SSE
sse2 BUILD_FOR_SSE2
)
set(LENSFUN_EXTRA_OPTS "")
if (VCPKG_TARGET_IS_WINDOWS)
list(APPEND LENSFUN_EXTRA_OPTS -DPLATFORM_WINDOWS=ON)
endif()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
${LENSFUN_EXTRA_OPTS}
-DBUILD_STATIC=${LENSFUN_STATIC_LIB}
-DBUILD_WITH_MSVC_STATIC_RUNTIME=${LENSFUN_STATIC_CRT}
-DBUILD_TESTS=OFF
-DBUILD_DOC=OFF
-DINSTALL_PYTHON_MODULE=ON
-DINSTALL_HELPER_SCRIPTS=OFF
-DBUILD_LENSTOOL=OFF
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_fixup_pkgconfig()
if (LENSFUN_STATIC_LIB)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/docs/gpl-3.0.txt" "${SOURCE_PATH}/docs/lgpl-3.0.txt")

27
ports/lensfun/vcpkg.json Normal file
View File

@ -0,0 +1,27 @@
{
"name": "lensfun",
"version": "0.3.4",
"description": "Provide a open source database of photographic lenses and their characteristics",
"homepage": "https://scnlib.dev/",
"license": "LGPL-3.0 OR GPL-3.0",
"supports": "!arm",
"dependencies": [
"glib",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"sse": {
"description": "Build with support for SSE"
},
"sse2": {
"description": "Build with support for SSE2"
}
}
}

View File

@ -3952,6 +3952,10 @@
"baseline": "3.39.3",
"port-version": 0
},
"lensfun": {
"baseline": "0.3.4",
"port-version": 0
},
"leptonica": {
"baseline": "1.83.1",
"port-version": 0

9
versions/l-/lensfun.json Normal file
View File

@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "1dd927cfac7033fe1aa1031d588ebe8295f7765c",
"version": "0.3.4",
"port-version": 0
}
]
}