aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/ncurses
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/ncurses
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/ncurses')
-rw-r--r--vcpkg/ports/ncurses/portfile.cmake89
-rw-r--r--vcpkg/ports/ncurses/usage7
-rw-r--r--vcpkg/ports/ncurses/vcpkg.json23
3 files changed, 119 insertions, 0 deletions
diff --git a/vcpkg/ports/ncurses/portfile.cmake b/vcpkg/ports/ncurses/portfile.cmake
new file mode 100644
index 0000000..8d35bff
--- /dev/null
+++ b/vcpkg/ports/ncurses/portfile.cmake
@@ -0,0 +1,89 @@
+vcpkg_download_distfile(
+ ARCHIVE_PATH
+ URLS
+ "https://invisible-mirror.net/archives/ncurses/ncurses-${VERSION}.tar.gz"
+ "ftp://ftp.invisible-island.net/ncurses/ncurses-${VERSION}.tar.gz"
+ "https://ftp.gnu.org/gnu/ncurses/ncurses-${VERSION}.tar.gz"
+ FILENAME "ncurses-${VERSION}.tgz"
+ SHA512 fc5a13409d2a530a1325776dcce3a99127ddc2c03999cfeb0065d0eee2d68456274fb1c7b3cc99c1937bc657d0e7fca97016e147f93c7821b5a4a6837db821e8
+)
+
+vcpkg_extract_source_archive(
+ SOURCE_PATH
+ ARCHIVE "${ARCHIVE_PATH}"
+)
+
+vcpkg_list(SET OPTIONS)
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
+ list(APPEND OPTIONS
+ --with-cxx-shared
+ --with-shared # "lib model"
+ --without-normal # "lib model"
+ )
+endif()
+
+if(NOT VCPKG_TARGET_IS_MINGW)
+ list(APPEND OPTIONS
+ --enable-mixed-case
+ )
+endif()
+
+if(VCPKG_TARGET_IS_MINGW)
+ list(APPEND OPTIONS
+ --disable-home-terminfo
+ --enable-term-driver
+ --disable-termcap
+ )
+endif()
+
+if("check-size" IN_LIST FEATURES)
+ list(APPEND OPTIONS
+ --enable-check-size
+ )
+endif()
+
+vcpkg_cmake_get_vars(cmake_vars_file)
+include("${cmake_vars_file}")
+
+# There are compilation errors on gcc 15. adding `-std=c17` to CFLAGS for workaround.
+# ref: https://gitlab.archlinux.org/archlinux/packaging/packages/ncurses/-/issues/3
+if(VCPKG_DETECTED_CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND VCPKG_DETECTED_CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15)
+ set(ENV{CFLAGS} "$ENV{CFLAGS} -std=c17")
+endif()
+
+vcpkg_configure_make(
+ SOURCE_PATH "${SOURCE_PATH}"
+ CONFIGURE_ENVIRONMENT_VARIABLES CFLAGS
+ DETERMINE_BUILD_TRIPLET
+ NO_ADDITIONAL_PATHS
+ OPTIONS
+ ${OPTIONS}
+ --disable-db-install
+ --disable-pkg-ldflags
+ --disable-rpath-hack
+ --enable-pc-files
+ --without-ada
+ --without-debug # "lib model"
+ --without-manpages
+ --without-progs
+ --without-tack
+ --without-tests
+ --with-pkg-config-libdir=libdir
+)
+vcpkg_install_make()
+vcpkg_fixup_pkgconfig()
+
+# Prefer local files over search path
+file(GLOB headers "${CURRENT_PACKAGES_DIR}/include/ncursesw/*.h")
+foreach(file IN LISTS headers)
+ vcpkg_replace_string("${file}" [[#include <ncursesw/([^>]*)>]] [[#include "\1"]] REGEX IGNORE_UNCHANGED)
+endforeach()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+
+file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
diff --git a/vcpkg/ports/ncurses/usage b/vcpkg/ports/ncurses/usage
new file mode 100644
index 0000000..ff8bc2d
--- /dev/null
+++ b/vcpkg/ports/ncurses/usage
@@ -0,0 +1,7 @@
+The package ncurses is compatible with built-in CMake variables:
+
+ set(CURSES_NEED_NCURSES TRUE)
+ find_package(Curses REQUIRED)
+ target_include_directories(main PRIVATE ${CURSES_INCLUDE_DIRS})
+ target_compile_options(main PRIVATE ${CURSES_CFLAGS})
+ target_link_libraries(main PRIVATE ${CURSES_LIBRARIES})
diff --git a/vcpkg/ports/ncurses/vcpkg.json b/vcpkg/ports/ncurses/vcpkg.json
new file mode 100644
index 0000000..9ec8abf
--- /dev/null
+++ b/vcpkg/ports/ncurses/vcpkg.json
@@ -0,0 +1,23 @@
+{
+ "name": "ncurses",
+ "version": "6.5",
+ "port-version": 1,
+ "description": [
+ "Free software emulation of curses in System V Release 4.0, and more.",
+ "This port installs a wide character configuration (ncursesw)."
+ ],
+ "homepage": "https://invisible-island.net/ncurses/announce.html",
+ "license": "MIT",
+ "supports": "!windows | mingw",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake-get-vars",
+ "host": true
+ }
+ ],
+ "features": {
+ "check-size": {
+ "description": "Detect screensize of serial terminals"
+ }
+ }
+}