From 6e7c3fbab5e90cfb4716583ea7a63f1a65194458 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Tue, 13 Jan 2026 07:46:28 +0100 Subject: [PATCH] [vcpkg-make,ncurses,python3] Filter default options, disables curses in python (#49187) --- ports/ncurses/portfile.cmake | 16 +++++++--- ports/ncurses/vcpkg.json | 6 +++- .../python3/0012-force-disable-modules.patch | 13 -------- ports/python3/portfile.cmake | 5 ++- ports/python3/vcpkg.json | 6 +--- ports/vcpkg-make/vcpkg.json | 2 +- ports/vcpkg-make/vcpkg_make_common.cmake | 32 ++++++++----------- ports/vcpkg-make/vcpkg_make_configure.cmake | 10 ++++-- versions/baseline.json | 6 ++-- versions/n-/ncurses.json | 5 +++ versions/p-/python3.json | 5 +++ versions/v-/vcpkg-make.json | 5 +++ 12 files changed, 61 insertions(+), 50 deletions(-) delete mode 100644 ports/python3/0012-force-disable-modules.patch diff --git a/ports/ncurses/portfile.cmake b/ports/ncurses/portfile.cmake index 8d35bff924..fc0df42c13 100644 --- a/ports/ncurses/portfile.cmake +++ b/ports/ncurses/portfile.cmake @@ -52,11 +52,9 @@ if(VCPKG_DETECTED_CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND VCPKG_DETECTED_CMAKE_ set(ENV{CFLAGS} "$ENV{CFLAGS} -std=c17") endif() -vcpkg_configure_make( +vcpkg_make_configure( SOURCE_PATH "${SOURCE_PATH}" - CONFIGURE_ENVIRONMENT_VARIABLES CFLAGS - DETERMINE_BUILD_TRIPLET - NO_ADDITIONAL_PATHS + DEFAULT_OPTIONS_EXCLUDE "^--docdir" OPTIONS ${OPTIONS} --disable-db-install @@ -71,7 +69,7 @@ vcpkg_configure_make( --without-tests --with-pkg-config-libdir=libdir ) -vcpkg_install_make() +vcpkg_make_install() vcpkg_fixup_pkgconfig() # Prefer local files over search path @@ -80,6 +78,14 @@ foreach(file IN LISTS headers) vcpkg_replace_string("${file}" [[#include ]*)>]] [[#include "\1"]] REGEX IGNORE_UNCHANGED) endforeach() +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/ncurses/bin/ncursesw6-config" "${CURRENT_INSTALLED_DIR}" "\${prefix}") +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/ncurses/bin/ncursesw6-config" "\nprefix=\"\${prefix}\"" [=[prefix=$(CDPATH= cd -- "$(dirname -- "$0")"/../../.. && pwd -P)]=]) +if(NOT VCPKG_BUILD_TYPE) + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/ncurses/debug/bin/ncursesw6-config" "${CURRENT_INSTALLED_DIR}" "\${prefix}") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/ncurses/debug/bin/ncursesw6-config" "\nprefix=\"\${prefix}/debug\"" [=[prefix=$(CDPATH= cd -- "$(dirname -- "$0")"/../../../.. && pwd -P)/debug]=]) + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/ncurses/debug/bin/ncursesw6-config" "\${prefix}/share" "\${prefix}/../share") +endif() + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") diff --git a/ports/ncurses/vcpkg.json b/ports/ncurses/vcpkg.json index 9ec8abfdcd..af36764a3b 100644 --- a/ports/ncurses/vcpkg.json +++ b/ports/ncurses/vcpkg.json @@ -1,7 +1,7 @@ { "name": "ncurses", "version": "6.5", - "port-version": 1, + "port-version": 2, "description": [ "Free software emulation of curses in System V Release 4.0, and more.", "This port installs a wide character configuration (ncursesw)." @@ -13,6 +13,10 @@ { "name": "vcpkg-cmake-get-vars", "host": true + }, + { + "name": "vcpkg-make", + "host": true } ], "features": { diff --git a/ports/python3/0012-force-disable-modules.patch b/ports/python3/0012-force-disable-modules.patch deleted file mode 100644 index f97f19e5b2..0000000000 --- a/ports/python3/0012-force-disable-modules.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/Modules/Setup b/Modules/Setup -index 87c6a152f8..7ad53f5b4f 100644 ---- a/Modules/Setup -+++ b/Modules/Setup -@@ -375,3 +375,8 @@ xxsubtype xxsubtype.c - # - # _sqlite3 _tkinter _curses pyexpat - # _codecs_jp _codecs_kr _codecs_tw unicodedata -+ -+*disabled* -+_curses -+_curses_panel -+_tkinter diff --git a/ports/python3/portfile.cmake b/ports/python3/portfile.cmake index b34fda3046..880659a94e 100644 --- a/ports/python3/portfile.cmake +++ b/ports/python3/portfile.cmake @@ -28,7 +28,6 @@ set(PATCHES 0005-dont-copy-vcruntime.patch 0008-python.pc.patch 0010-dont-skip-rpath.patch - 0012-force-disable-modules.patch 0015-dont-use-WINDOWS-def.patch 0016-undup-ffi-symbols.patch # Required for lld-link. 0018-fix-sysconfig-include.patch @@ -283,8 +282,12 @@ else() vcpkg_make_configure( SOURCE_PATH "${SOURCE_PATH}" AUTORECONF + DEFAULT_OPTIONS_EXCLUDE "^--(disable|enable)-static" OPTIONS ${OPTIONS} + py_cv_module__curses=n/a + py_cv_module__curses_panel=n/a + py_cv_module__tkinter=n/a OPTIONS_DEBUG "--with-pydebug" "vcpkg_rpath=${CURRENT_INSTALLED_DIR}/debug/lib" diff --git a/ports/python3/vcpkg.json b/ports/python3/vcpkg.json index 9e0d549999..fb3d967d92 100644 --- a/ports/python3/vcpkg.json +++ b/ports/python3/vcpkg.json @@ -1,7 +1,7 @@ { "name": "python3", "version": "3.12.9", - "port-version": 7, + "port-version": 8, "description": "The Python programming language", "homepage": "https://github.com/python/cpython", "license": "Python-2.0", @@ -74,10 +74,6 @@ "name": "liblzma", "default-features": false }, - { - "name": "ncurses", - "platform": "!windows | mingw" - }, { "name": "openssl", "default-features": false diff --git a/ports/vcpkg-make/vcpkg.json b/ports/vcpkg-make/vcpkg.json index 05be120c17..c7b2fdd25f 100644 --- a/ports/vcpkg-make/vcpkg.json +++ b/ports/vcpkg-make/vcpkg.json @@ -1,6 +1,6 @@ { "name": "vcpkg-make", - "version-date": "2025-10-26", + "version-date": "2026-01-01", "documentation": "https://learn.microsoft.com/vcpkg/maintainers/functions/vcpkg_make_configure", "license": null, "supports": "native", diff --git a/ports/vcpkg-make/vcpkg_make_common.cmake b/ports/vcpkg-make/vcpkg_make_common.cmake index 2217d3b62f..96f5b92855 100644 --- a/ports/vcpkg-make/vcpkg_make_common.cmake +++ b/ports/vcpkg-make/vcpkg_make_common.cmake @@ -180,6 +180,15 @@ function(z_vcpkg_make_prepare_compile_flags) endforeach() endif() + set(library_path_flag "${VCPKG_DETECTED_CMAKE_LIBRARY_PATH_FLAG}") + string(REPLACE " " "\\ " current_installed_dir_escaped "${CURRENT_INSTALLED_DIR}") + if(EXISTS "${CURRENT_INSTALLED_DIR}${path_suffix_${var_suffix}}/lib/manual-link") + vcpkg_list(PREPEND LDFLAGS "${library_path_flag}${current_installed_dir_escaped}${path_suffix_${var_suffix}}/lib/manual-link") + endif() + if(EXISTS "${CURRENT_INSTALLED_DIR}${path_suffix_${var_suffix}}/lib") + vcpkg_list(PREPEND LDFLAGS "${library_path_flag}${current_installed_dir_escaped}${path_suffix_${var_suffix}}/lib") + endif() + # libtool tries to filter CFLAGS passed to the link stage via a allow list. # This approach is flawed since it fails to pass flags unknown to libtool @@ -196,7 +205,6 @@ function(z_vcpkg_make_prepare_compile_flags) list(TRANSFORM CXXFLAGS PREPEND "${compiler_flag_escape};") endif() - set(library_path_flag "${VCPKG_DETECTED_CMAKE_LIBRARY_PATH_FLAG}") set(linker_flag_escape "") if(arg_COMPILER_FRONTEND STREQUAL "MSVC" AND NOT arg_NO_FLAG_ESCAPING) # Removed by libtool @@ -215,13 +223,6 @@ function(z_vcpkg_make_prepare_compile_flags) string(REPLACE " " ";" linker_flag_escape_stripped "${linker_flag_escape_stripped};") list(TRANSFORM LDFLAGS PREPEND "${linker_flag_escape_stripped}") endif() - string(REPLACE " " "\\ " current_installed_dir_escaped "${CURRENT_INSTALLED_DIR}") - if(EXISTS "${CURRENT_INSTALLED_DIR}${path_suffix_${var_suffix}}/lib/manual-link") - vcpkg_list(PREPEND LDFLAGS "${linker_flag_escape}${library_path_flag}${current_installed_dir_escaped}${path_suffix_${var_suffix}}/lib/manual-link") - endif() - if(EXISTS "${CURRENT_INSTALLED_DIR}${path_suffix_${var_suffix}}/lib") - vcpkg_list(PREPEND LDFLAGS "${linker_flag_escape}${library_path_flag}${current_installed_dir_escaped}${path_suffix_${var_suffix}}/lib") - endif() if(ARFLAGS AND NOT arg_COMPILER_FRONTEND STREQUAL "MSVC") # ARFLAGS need to know the command for creating an archive (Maybe needs user customization?) @@ -575,8 +576,8 @@ endfunction() function(z_vcpkg_make_default_path_and_configure_options out_var) cmake_parse_arguments(PARSE_ARGV 1 arg - "AUTOMAKE" - "CONFIG;EXCLUDE_FILTER;INCLUDE_FILTER" + "" + "CONFIG;EXCLUDE_FILTER" "" ) z_vcpkg_unparsed_args(FATAL_ERROR) @@ -635,24 +636,17 @@ function(z_vcpkg_make_default_path_and_configure_options out_var) "--docdir=\\\${prefix}/share/${PORT}" "--datarootdir=\\\${prefix}/share/${PORT}") endif() - # Setup common options - if(NOT arg_AUTOMAKE) - vcpkg_list(APPEND opts --disable-silent-rules --verbose) - endif() + # Setup common options if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") vcpkg_list(APPEND opts --enable-shared --disable-static) else() vcpkg_list(APPEND opts --disable-shared --enable-static) endif() - if(DEFINED arg_EXCLUDE_FILTER) + if(NOT arg_EXCLUDE_FILTER STREQUAL "") list(FILTER opts EXCLUDE REGEX "${arg_EXCLUDE_FILTER}") endif() - if(DEFINED arg_INCLUDE_FILTER) - list(FILTER opts INCLUDE REGEX "${arg_INCLUDE_FILTER}") - endif() - set("${out_var}" ${opts} PARENT_SCOPE) endfunction() diff --git a/ports/vcpkg-make/vcpkg_make_configure.cmake b/ports/vcpkg-make/vcpkg_make_configure.cmake index 4d633f35d4..5686fe145e 100644 --- a/ports/vcpkg-make/vcpkg_make_configure.cmake +++ b/ports/vcpkg-make/vcpkg_make_configure.cmake @@ -4,12 +4,16 @@ include("${CMAKE_CURRENT_LIST_DIR}/vcpkg_make.cmake") function(vcpkg_make_configure) cmake_parse_arguments(PARSE_ARGV 0 arg "AUTORECONF;COPY_SOURCE;DISABLE_MSVC_WRAPPERS;DISABLE_CPPFLAGS;DISABLE_DEFAULT_OPTIONS;DISABLE_MSVC_TRANSFORMATIONS" - "SOURCE_PATH" + "SOURCE_PATH;DEFAULT_OPTIONS_EXCLUDE" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE;PRE_CONFIGURE_CMAKE_COMMANDS;LANGUAGES" ) z_vcpkg_unparsed_args(FATAL_ERROR) + if(arg_DISABLE_DEFAULT_OPTIONS AND arg_DEFAULT_OPTIONS_EXCLUDE) + message(FATAL_ERROR "DISABLE_DEFAULT_OPTIONS cannot be used together with DEFAULT_OPTIONS_EXCLUDE.") + endif() + # Can be set in the triplet to append options for configure if(DEFINED VCPKG_MAKE_CONFIGURE_OPTIONS) list(APPEND arg_OPTIONS ${VCPKG_MAKE_CONFIGURE_OPTIONS}) @@ -97,7 +101,9 @@ function(vcpkg_make_configure) set(opts "") if(NOT arg_DISABLE_DEFAULT_OPTIONS) - z_vcpkg_make_default_path_and_configure_options(opts AUTOMAKE CONFIG "${configup}") + z_vcpkg_make_default_path_and_configure_options(opts CONFIG "${configup}" + EXCLUDE_FILTER "${arg_DEFAULT_OPTIONS_EXCLUDE}" + ) endif() set(configure_path_from_wd "./${relative_build_path}/configure") diff --git a/versions/baseline.json b/versions/baseline.json index a06f9bb092..f8071d3a29 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6766,7 +6766,7 @@ }, "ncurses": { "baseline": "6.5", - "port-version": 1 + "port-version": 2 }, "ndis-driver-library": { "baseline": "1.2.0", @@ -7882,7 +7882,7 @@ }, "python3": { "baseline": "3.12.9", - "port-version": 7 + "port-version": 8 }, "qca": { "baseline": "2.3.7", @@ -10273,7 +10273,7 @@ "port-version": 0 }, "vcpkg-make": { - "baseline": "2025-10-26", + "baseline": "2026-01-01", "port-version": 0 }, "vcpkg-msbuild": { diff --git a/versions/n-/ncurses.json b/versions/n-/ncurses.json index 1315c68bb6..ecbe75b2ac 100644 --- a/versions/n-/ncurses.json +++ b/versions/n-/ncurses.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "0394449d0ec00a5b808f2567854cf07f2190c41d", + "version": "6.5", + "port-version": 2 + }, { "git-tree": "a714211f4eb04f17c6f4f5e5b3ada6ea02484b4c", "version": "6.5", diff --git a/versions/p-/python3.json b/versions/p-/python3.json index 8ac1750823..8c4ef60581 100644 --- a/versions/p-/python3.json +++ b/versions/p-/python3.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "8d3b3ef309a4fd7c53561374aa746e6eafed6517", + "version": "3.12.9", + "port-version": 8 + }, { "git-tree": "278873ae3425fd9c3d79e37b2b918790704c491e", "version": "3.12.9", diff --git a/versions/v-/vcpkg-make.json b/versions/v-/vcpkg-make.json index 153c051e54..650b8b07cd 100644 --- a/versions/v-/vcpkg-make.json +++ b/versions/v-/vcpkg-make.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "c1c80d7a4b56ff925cb9d6691e6baa4c44f4e179", + "version-date": "2026-01-01", + "port-version": 0 + }, { "git-tree": "f5115f8cfeae1176d98357dcdc29535bfe33b9ad", "version-date": "2025-10-26",