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

[ncurses] Add new port #17226

Merged
merged 3 commits into from
Apr 30, 2021
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
59 changes: 59 additions & 0 deletions ports/ncurses/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
vcpkg_fail_port_install(ON_TARGET "Windows" "UWP")

vcpkg_download_distfile(
ARCHIVE_PATH
URLS
"https://invisible-mirror.net/archives/ncurses/ncurses-6.2.tar.gz"
"ftp://ftp.invisible-island.net/ncurses/ncurses-6.2.tar.gz"
"ftp://ftp.gnu.org/gnu/ncurses/ncurses-6.2.tar.gz"
FILENAME "ncurses-6.2.tgz"
SHA512 4c1333dcc30e858e8a9525d4b9aefb60000cfc727bc4a1062bace06ffc4639ad9f6e54f6bdda0e3a0e5ea14de995f96b52b3327d9ec633608792c99a1e8d840d
)

vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE_PATH}
)

set(OPTIONS
--disable-db-install
--enable-pc-files
--without-manpages
--without-progs
--without-tack
--without-tests
)
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
list(APPEND OPTIONS
--with-shared
--with-cxx-shared
--without-normal
)
endif()

set(OPTIONS_DEBUG
--with-pkg-config-libdir=${CURRENT_INSTALLED_DIR}/debug/lib/pkgconfig
--with-debug
)
set(OPTIONS_RELEASE
--with-pkg-config-libdir=${CURRENT_INSTALLED_DIR}/lib/pkgconfig
--without-debug
)

vcpkg_configure_make(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS ${OPTIONS}
OPTIONS_DEBUG ${OPTIONS_DEBUG}
OPTIONS_RELEASE ${OPTIONS_RELEASE}
NO_ADDITIONAL_PATHS
)
vcpkg_install_make()

vcpkg_fixup_pkgconfig()

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 "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
6 changes: 6 additions & 0 deletions ports/ncurses/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "ncurses",
"version-string": "6.2",
"description": "free software emulation of curses in System V Release 4.0",
"supports": "!(windows | uwp)"
}
8 changes: 8 additions & 0 deletions scripts/test_ports/cmake/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ vcpkg_from_gitlab(
HEAD_REF master
)

if(NOT VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_UWP)
set(BUILD_CURSES_DIALOG ON)
endif()

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
Expand All @@ -26,6 +30,7 @@ vcpkg_configure_cmake(
-DCMAKE_USE_SYSTEM_JSONCPP=ON
-DCMAKE_USE_SYSTEM_LIBRHASH=OFF # not yet in VCPKG
-DCMAKE_USE_SYSTEM_LIBUV=ON
-DBUILD_CursesDialog=${BUILD_CURSES_DIALOG}
-DBUILD_QtDialog=ON # Just to test Qt with CMake
)

Expand All @@ -37,6 +42,9 @@ if(NOT VCPKG_TARGET_IS_OSX)
if(VCPKG_TARGET_IS_WINDOWS)
list(APPEND _tools cmcldeps)
endif()
if(BUILD_CURSES_DIALOG)
list(APPEND _tools ccmake)
endif()
vcpkg_copy_tools(TOOL_NAMES ${_tools} AUTO_CLEAN)
else()
# On OSX everything is within a CMake.app folder
Expand Down
4 changes: 4 additions & 0 deletions scripts/test_ports/cmake/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
"libarchive",
"liblzma",
"libuv",
{
"name": "ncurses",
"platform": "!(windows | uwp)"
},
"nghttp2",
"qt5-base",
{
Expand Down
6 changes: 5 additions & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4176,6 +4176,10 @@
"baseline": "2.4.6",
"port-version": 0
},
"ncurses": {
"baseline": "6.2",
"port-version": 0
},
"neargye-semver": {
"baseline": "0.2.2",
"port-version": 0
Expand Down Expand Up @@ -6613,4 +6617,4 @@
"port-version": 1
}
}
}
}
9 changes: 9 additions & 0 deletions versions/n-/ncurses.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "ab8de39c1659867da459ac0bec7e09bee5762819",
"version-string": "6.2",
"port-version": 0
}
]
}