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

[vcpkg baseline][lensfun] Fix and cleanup #36342

Merged
merged 4 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
44 changes: 30 additions & 14 deletions ports/lensfun/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#vcpkg_check_linkage(ONLY_STATIC_LIBRARY)

Copy link
Contributor

Choose a reason for hiding this comment

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

I missed this during my review 🤦‍♂️

Thanks @dg0yt !

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO lensfun/lensfun
Expand All @@ -12,12 +10,31 @@ vcpkg_from_github(
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" LENSFUN_STATIC_LIB)
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" LENSFUN_STATIC_CRT)


set(LENSFUN_EXTRA_OPTS "")
if (VCPKG_TARGET_IS_WINDOWS)
if("python" IN_LIST FEATURES)
find_file(INITIAL_PYTHON3
NAMES "python3${VCPKG_HOST_EXECUTABLE_SUFFIX}" "python${VCPKG_HOST_EXECUTABLE_SUFFIX}"
PATHS "${CURRENT_HOST_INSTALLED_DIR}/tools/python3"
NO_DEFAULT_PATH
REQUIRED
)
x_vcpkg_get_python_packages(OUT_PYTHON_VAR PYTHON3
PYTHON_EXECUTABLE "${INITIAL_PYTHON3}"
PYTHON_VERSION "3"
PACKAGES setuptools
)
else()
set(PYTHON3 "false")
endif()

if(VCPKG_TARGET_IS_WINDOWS)
list(APPEND LENSFUN_EXTRA_OPTS -DPLATFORM_WINDOWS=ON)
endif()

if(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
list(APPEND LENSFUN_EXTRA_OPTS -DBUILD_FOR_SSE=OFF -DBUILD_FOR_SSE2=OFF)
endif()

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
Expand All @@ -26,25 +43,24 @@ vcpkg_cmake_configure(
-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
-DBUILD_FOR_SSE=OFF
-DBUILD_FOR_SSE2=OFF
-DINSTALL_HELPER_SCRIPTS=OFF
"-DPYTHON=${PYTHON3}"
)

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")
file(READ "${SOURCE_PATH}/README.md" license_comment)
string(REGEX REPLACE "^.*\n(LICENSE\n)---+\n(.*)" "\\1\\2" license_comment "${license_comment}")
string(REGEX REPLACE "[^\n]+\n---+.*\$" "" license_comment "${license_comment}")
vcpkg_install_copyright(
COMMENT "${license_comment}"
FILE_LIST "${SOURCE_PATH}/docs/gpl-3.0.txt" "${SOURCE_PATH}/docs/lgpl-3.0.txt"
)
18 changes: 14 additions & 4 deletions ports/lensfun/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "lensfun",
"version": "0.3.4",
"port-version": 1,
"port-version": 2,
"description": "Provide a open source database of photographic lenses and their characteristics",
"homepage": "https://scnlib.dev/",
"license": "LGPL-3.0 OR GPL-3.0",
"homepage": "https://lensfun.github.io/",
"license": null,
"supports": "!arm",
"dependencies": [
"glib",
Expand All @@ -16,5 +16,15 @@
"name": "vcpkg-cmake-config",
"host": true
}
]
],
"features": {
"python": {
"description": "Build python module",
"supports": "native & !windows",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Windows didn't build the python module, according to the previous CI file list, so this is not a regression. And now not possible due to #36354 (comment).

"dependencies": [
"python3",
"vcpkg-get-python-packages"
]
}
}
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4046,7 +4046,7 @@
},
"lensfun": {
"baseline": "0.3.4",
"port-version": 1
"port-version": 2
},
"leptonica": {
"baseline": "1.83.1",
Expand Down
5 changes: 5 additions & 0 deletions versions/l-/lensfun.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "84eb6a4d2a0d8d670e0f54ec70bb4ad36cb004df",
"version": "0.3.4",
"port-version": 2
},
{
"git-tree": "a085269b70f184d8dbf07c595e37ce336bd79906",
"version": "0.3.4",
Expand Down
Loading