[pdcurses] Revise portfile (#22092)

* Use vcpkg_build_nmake

* Update versions

* Use INSTALLDIR

* Update versions
This commit is contained in:
Kai Pastor 2021-12-22 06:03:46 +01:00 committed by GitHub
parent 2c5479aac4
commit 67e4272121
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 62 additions and 72 deletions

View File

@ -0,0 +1,21 @@
diff --git a/wincon/Makefile.vc b/wincon/Makefile.vc
index 80c4689..1bae388 100644
--- a/wincon/Makefile.vc
+++ b/wincon/Makefile.vc
@@ -118,3 +118,16 @@ tui.obj: $(demodir)\tui.c $(demodir)\tui.h
tuidemo.obj: $(demodir)\tuidemo.c
$(BUILD) -I$(demodir) $(demodir)\tuidemo.c
+
+install: all
+ -mkdir $(INSTALLDIR)\lib
+ copy pdcurses.lib $(INSTALLDIR)\lib
+!ifdef DLL
+ -mkdir $(INSTALLDIR)\bin
+ copy pdcurses.dll $(INSTALLDIR)\bin
+!endif
+!ifndef SKIP_HEADERS
+ -mkdir $(INSTALLDIR)\include
+ copy $(PDCURSES_SRCDIR)\curses.h $(INSTALLDIR)\include
+ copy $(PDCURSES_SRCDIR)\panel.h $(INSTALLDIR)\include
+!endif

View File

@ -1,73 +1,42 @@
vcpkg_check_linkage(ONLY_DYNAMIC_CRT)
find_program(NMAKE nmake)
vcpkg_from_github( vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH OUT_SOURCE_PATH SOURCE_PATH
REPO wmcbrine/PDCurses REPO wmcbrine/PDCurses
REF 6c1f95c4fa9f9f105879c2d99dd72a5bf335c046 # 3.9 REF 6c1f95c4fa9f9f105879c2d99dd72a5bf335c046 # 3.9
SHA512 2d682a3516baaa58a97854aca64d985768b7af76d998240b54afc57ddf2a44894835a1748888f8dd7c1cc8045ede77488284f8adf1b73878879b4b4d3391218d SHA512 2d682a3516baaa58a97854aca64d985768b7af76d998240b54afc57ddf2a44894835a1748888f8dd7c1cc8045ede77488284f8adf1b73878879b4b4d3391218d
HEAD_REF master HEAD_REF master
PATCHES
nmake-install.patch
) )
set(PDC_NMAKE_CMD ${NMAKE} /A -f ${SOURCE_PATH}/wincon/Makefile.vc WIDE=Y UTF8=Y) if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
cmake_path(NATIVE_PATH SOURCE_PATH PDCURSES_SRCDIR)
set(PDC_NMAKE_CWD ${SOURCE_PATH}/wincon) set(DLL_OPTION "")
set(PDC_PDCLIB ${SOURCE_PATH}/wincon/pdcurses) if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
set(DLL_OPTION DLL=Y)
if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") endif()
set(PDC_NMAKE_CMD ${PDC_NMAKE_CMD} DLL=Y) vcpkg_build_nmake(
endif() SOURCE_PATH "${SOURCE_PATH}/wincon"
PROJECT_NAME Makefile.vc
message(STATUS "Build ${TARGET_TRIPLET}-rel") ENABLE_INSTALL
vcpkg_execute_required_process( OPTIONS
COMMAND ${PDC_NMAKE_CMD} /A
WORKING_DIRECTORY ${PDC_NMAKE_CWD} "PDCURSES_SRCDIR=${PDCURSES_SRCDIR}"
LOGNAME build-${TARGET_TRIPLET}-rel WIDE=Y
) UTF8=Y
message(STATUS "Build ${TARGET_TRIPLET}-rel done") ${DLL_OPTION}
OPTIONS_RELEASE
file ( "CFLAGS=-D_CRT_SECURE_NO_WARNINGS"
COPY ${PDC_PDCLIB}.lib "LDFLAGS="
DESTINATION ${CURRENT_PACKAGES_DIR}/lib OPTIONS_DEBUG
) "CFLAGS=-D_CRT_SECURE_NO_WARNINGS -DPDCDEBUG"
if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") "LDFLAGS=-debug"
file ( DEBUG=Y
COPY ${PDC_PDCLIB}.dll SKIP_HEADERS=Y
DESTINATION ${CURRENT_PACKAGES_DIR}/bin
) )
vcpkg_copy_pdbs()
if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/curses.h" "#ifdef PDC_DLL_BUILD" "#if 1")
endif()
endif() endif()
message(STATUS "Build ${TARGET_TRIPLET}-dbg") file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
vcpkg_execute_required_process(
COMMAND ${PDC_NMAKE_CMD} DEBUG=Y
WORKING_DIRECTORY ${PDC_NMAKE_CWD}
LOGNAME build-${TARGET_TRIPLET}-dbg
)
message(STATUS "Build ${TARGET_TRIPLET}-dbg done")
file (
INSTALL ${PDC_PDCLIB}.lib
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib
)
if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file (
INSTALL ${PDC_PDCLIB}.dll
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin
)
endif()
file(
INSTALL ${SOURCE_PATH}/curses.h ${SOURCE_PATH}/panel.h
DESTINATION ${CURRENT_PACKAGES_DIR}/include
)
if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file(READ ${CURRENT_PACKAGES_DIR}/include/curses.h _contents)
string(REPLACE "#ifdef PDC_DLL_BUILD" "#if 1" _contents "${_contents}")
file(WRITE ${CURRENT_PACKAGES_DIR}/include/curses.h "${_contents}")
endif()
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/pdcurses RENAME copyright)
vcpkg_copy_pdbs()

View File

@ -1,7 +1,8 @@
{ {
"name": "pdcurses", "name": "pdcurses",
"version-string": "3.9", "version-string": "3.9",
"port-version": 2, "port-version": 3,
"description": "Public Domain Curses - a curses library for environments that don't fit the termcap/terminfo model.", "description": "Public Domain Curses - a curses library for environments that don't fit the termcap/terminfo model.",
"homepage": "https://pdcurses.org/" "homepage": "https://pdcurses.org/",
"supports": "windows & !uwp & !mingw"
} }

View File

@ -1120,12 +1120,6 @@ pdal:x64-linux=fail
pdal:x64-osx=fail pdal:x64-osx=fail
pdal-c:x64-windows-static=fail pdal-c:x64-windows-static=fail
pdal-c:x64-windows-static-md=fail pdal-c:x64-windows-static-md=fail
pdcurses:arm-uwp=fail
pdcurses:x64-linux=fail
pdcurses:x64-osx=fail
pdcurses:x64-uwp=fail
pdcurses:x64-windows-static=fail
pdcurses:x64-windows-static-md=fail
pfring:arm64-windows=fail pfring:arm64-windows=fail
pfring:arm-uwp=fail pfring:arm-uwp=fail
pfring:x64-uwp=fail pfring:x64-uwp=fail

View File

@ -5214,7 +5214,7 @@
}, },
"pdcurses": { "pdcurses": {
"baseline": "3.9", "baseline": "3.9",
"port-version": 2 "port-version": 3
}, },
"pdqsort": { "pdqsort": {
"baseline": "2019-07-30", "baseline": "2019-07-30",

View File

@ -1,5 +1,10 @@
{ {
"versions": [ "versions": [
{
"git-tree": "e09ec910aff6b25bd1e1554b15dce08656b3f3d5",
"version-string": "3.9",
"port-version": 3
},
{ {
"git-tree": "190eafb5554bf1f484edff1aa94598bac3ff9830", "git-tree": "190eafb5554bf1f484edff1aa94598bac3ff9830",
"version-string": "3.9", "version-string": "3.9",