Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
51 changes: 51 additions & 0 deletions ports/ptyqt/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO kafeg/ptyqt
REF 0.6.2
SHA512 75e69af5d8f3633e11ef9726f9673a628ac67bb1bda0a1dca921c64a6d22421a6fe51d08b267d3f461a6a68d27a1eadb7e8dacf07fe1b82737575c4150bfe5ed
HEAD_REF master)
Comment thread
kafeg marked this conversation as resolved.
Outdated

if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(VCPKG_CXX_FLAGS "${VCPKG_CXX_FLAGS} -lrt")
set(VCPKG_C_FLAGS "${VCPKG_C_FLAGS} -lrt")

if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
file(READ ${SOURCE_PATH}/core/CMakeLists.txt filedata)
string(REPLACE "-static-libstdc++" "-static-libstdc++ -lglib-2.0" filedata "${filedata}")
file(WRITE ${SOURCE_PATH}/core/CMakeLists.txt "${filedata}")
else()
file(READ ${SOURCE_PATH}/core/CMakeLists.txt filedata)
string(REPLACE "-static-libstdc++ -lglib-2.0" "-static-libstdc++" filedata "${filedata}")
file(WRITE ${SOURCE_PATH}/core/CMakeLists.txt "${filedata}")
endif()
endif()

set(OPTIONS "")

if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
set(BUILD_TYPE SHARED)
list(APPEND OPTIONS -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE)
else()
set(BUILD_TYPE STATIC)
endif()

vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
-DNO_BUILD_TESTS=1
-DNO_BUILD_EXAMPLES=1
-DBUILD_TYPE=${BUILD_TYPE}
${OPTIONS}
)
Comment thread
kafeg marked this conversation as resolved.
Outdated

vcpkg_cmake_install()
vcpkg_copy_pdbs()

# cleanup
Comment thread
kafeg marked this conversation as resolved.
Outdated
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
endif()
Comment thread
kafeg marked this conversation as resolved.
Outdated

#license
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/ptyqt)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/ptyqt/LICENSE ${CURRENT_PACKAGES_DIR}/share/ptyqt/copyright)
Comment thread
kafeg marked this conversation as resolved.
Outdated
21 changes: 21 additions & 0 deletions ports/ptyqt/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "ptyqt",
"version-string": "0.6.2",
Comment thread
kafeg marked this conversation as resolved.
Outdated
"port-version": 1,
"description": "PtyQt - C++ library for work with PseudoTerminals",
"dependencies": [
"qt5-base",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
{
"name": "winpty",
"platform": "windows"
}
]
}
49 changes: 49 additions & 0 deletions ports/winpty/allow-build-static.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
diff --git a/src/include/winpty.h b/src/include/winpty.h
index 2a196a5..d8a69ad 100644
--- a/src/include/winpty.h
+++ b/src/include/winpty.h
@@ -32,11 +32,14 @@
* When compiled with __declspec(dllexport), with either MinGW or MSVC, the
* winpty functions are unadorned--no underscore prefix or '@nn' suffix--so
* GetProcAddress can be used easily. */
-#ifdef COMPILING_WINPTY_DLL
-#define WINPTY_API __declspec(dllexport)
-#else
-#define WINPTY_API __declspec(dllimport)
-#endif
+//#ifdef COMPILING_WINPTY_DLL
+//#define WINPTY_API __declspec(dllexport)
+//#else
+//#define WINPTY_API __declspec(dllimport)
+//#endif
+
+//just empty definition for static lib
+#define WINPTY_API

#ifdef __cplusplus
extern "C" {
diff --git a/src/shared/WinptyVersion.cc b/src/shared/WinptyVersion.cc
index 76bb8a5..33a2c23 100644
--- a/src/shared/WinptyVersion.cc
+++ b/src/shared/WinptyVersion.cc
@@ -28,15 +28,15 @@
// This header is auto-generated by either the Makefile (Unix) or
// UpdateGenVersion.bat (gyp). It is placed in a 'gen' directory, which is
// added to the search path.
-#include "GenVersion.h"
+//#include "GenVersion.h"

void dumpVersionToStdout() {
- printf("winpty version %s\n", GenVersion_Version);
- printf("commit %s\n", GenVersion_Commit);
+ printf("winpty version %s\n", PROJECT_VERSION);
+ printf("commit %s\n", "empty");
}

void dumpVersionToTrace() {
trace("winpty version %s (commit %s)",
- GenVersion_Version,
- GenVersion_Commit);
+ PROJECT_VERSION,
+ "empty");
}
172 changes: 172 additions & 0 deletions ports/winpty/build-with-cmake.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..a416e47
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,163 @@
+cmake_minimum_required(VERSION 3.12.0)
+
+set(PROJECT_VERSION "0.4.3")
+project(winpty VERSION ${PROJECT_VERSION} LANGUAGES CXX)
+
+add_definitions(-DPROJECT_VERSION="${PROJECT_VERSION}")
+add_definitions(-D_WIN32_WINNT=0x0600)
+add_definitions(-DUNICODE)
+add_definitions(-D_UNICODE)
+add_definitions(-DNOMINMAX)
+
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(WINPTY_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX}/include)
+set(WINPTY_INSTALL_BIN_DIR ${CMAKE_INSTALL_PREFIX}/bin)
+set(WINPTY_INSTALL_LIB_DIR ${CMAKE_INSTALL_PREFIX}/lib)
+
+include_directories(${WINPTY_INSTALL_INCLUDE_DIR})
+
+#winpty library
+set(WINPTYLIB_SOURCE_FILES
+ src/include/winpty.h
+ src/libwinpty/AgentLocation.cc
+ src/libwinpty/AgentLocation.h
+ src/libwinpty/winpty.cc
+ src/shared/AgentMsg.h
+ src/shared/BackgroundDesktop.h
+ src/shared/BackgroundDesktop.cc
+ src/shared/Buffer.h
+ src/shared/Buffer.cc
+ src/shared/DebugClient.h
+ src/shared/DebugClient.cc
+ src/shared/GenRandom.h
+ src/shared/GenRandom.cc
+ src/shared/OsModule.h
+ src/shared/OwnedHandle.h
+ src/shared/OwnedHandle.cc
+ src/shared/StringBuilder.h
+ src/shared/StringUtil.cc
+ src/shared/StringUtil.h
+ src/shared/WindowsSecurity.cc
+ src/shared/WindowsSecurity.h
+ src/shared/WindowsVersion.h
+ src/shared/WindowsVersion.cc
+ src/shared/WinptyAssert.h
+ src/shared/WinptyAssert.cc
+ src/shared/WinptyException.h
+ src/shared/WinptyException.cc
+ src/shared/WinptyVersion.h
+ src/shared/WinptyVersion.cc
+ src/shared/winpty_snprintf.h
+)
+
+add_library( winpty ${BUILD_TYPE} ${WINPTYLIB_SOURCE_FILES} )
+
+#winpty agent executable
+set(WINPTYAGENT_SOURCE_FILES
+ src/agent/Agent.h
+ src/agent/Agent.cc
+ src/agent/AgentCreateDesktop.h
+ src/agent/AgentCreateDesktop.cc
+ src/agent/ConsoleFont.cc
+ src/agent/ConsoleFont.h
+ src/agent/ConsoleInput.cc
+ src/agent/ConsoleInput.h
+ src/agent/ConsoleInputReencoding.cc
+ src/agent/ConsoleInputReencoding.h
+ src/agent/ConsoleLine.cc
+ src/agent/ConsoleLine.h
+ src/agent/Coord.h
+ src/agent/DebugShowInput.h
+ src/agent/DebugShowInput.cc
+ src/agent/DefaultInputMap.h
+ src/agent/DefaultInputMap.cc
+ src/agent/DsrSender.h
+ src/agent/EventLoop.h
+ src/agent/EventLoop.cc
+ src/agent/InputMap.h
+ src/agent/InputMap.cc
+ src/agent/LargeConsoleRead.h
+ src/agent/LargeConsoleRead.cc
+ src/agent/NamedPipe.h
+ src/agent/NamedPipe.cc
+ src/agent/Scraper.h
+ src/agent/Scraper.cc
+ src/agent/SimplePool.h
+ src/agent/SmallRect.h
+ src/agent/Terminal.h
+ src/agent/Terminal.cc
+ src/agent/UnicodeEncoding.h
+ src/agent/Win32Console.cc
+ src/agent/Win32Console.h
+ src/agent/Win32ConsoleBuffer.cc
+ src/agent/Win32ConsoleBuffer.h
+ src/agent/main.cc
+ src/shared/AgentMsg.h
+ src/shared/BackgroundDesktop.h
+ src/shared/BackgroundDesktop.cc
+ src/shared/Buffer.h
+ src/shared/Buffer.cc
+ src/shared/DebugClient.h
+ src/shared/DebugClient.cc
+ src/shared/GenRandom.h
+ src/shared/GenRandom.cc
+ src/shared/OsModule.h
+ src/shared/OwnedHandle.h
+ src/shared/OwnedHandle.cc
+ src/shared/StringBuilder.h
+ src/shared/StringUtil.cc
+ src/shared/StringUtil.h
+ src/shared/UnixCtrlChars.h
+ src/shared/WindowsSecurity.cc
+ src/shared/WindowsSecurity.h
+ src/shared/WindowsVersion.h
+ src/shared/WindowsVersion.cc
+ src/shared/WinptyAssert.h
+ src/shared/WinptyAssert.cc
+ src/shared/WinptyException.h
+ src/shared/WinptyException.cc
+ src/shared/WinptyVersion.h
+ src/shared/WinptyVersion.cc
+ src/shared/winpty_snprintf.h
+)
+
+add_executable(winpty-agent ${WINPTYAGENT_SOURCE_FILES})
+target_compile_definitions(winpty-agent PRIVATE -DWINPTY_AGENT_ASSERT)
+
+
+#winpty debugserver executable
+set(WINPTYAGENT_SOURCE_FILES
+ src/debugserver/DebugServer.cc
+ src/shared/DebugClient.h
+ src/shared/DebugClient.cc
+ src/shared/OwnedHandle.h
+ src/shared/OwnedHandle.cc
+ src/shared/OsModule.h
+ src/shared/StringBuilder.h
+ src/shared/StringUtil.cc
+ src/shared/StringUtil.h
+ src/shared/WindowsSecurity.h
+ src/shared/WindowsSecurity.cc
+ src/shared/WindowsVersion.h
+ src/shared/WindowsVersion.cc
+ src/shared/WinptyAssert.h
+ src/shared/WinptyAssert.cc
+ src/shared/WinptyException.h
+ src/shared/WinptyException.cc
+ src/shared/winpty_snprintf.h
+)
+
+add_executable(winpty-debugserver ${WINPTYAGENT_SOURCE_FILES})
+
+
+if("${BUILD_TYPE}" STREQUAL "STATIC")
+ install(TARGETS winpty DESTINATION ${WINPTY_INSTALL_LIB_DIR})
+else()
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/winpty.dll DESTINATION ${WINPTY_INSTALL_BIN_DIR})
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/winpty.lib DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
+endif()
+install(TARGETS winpty-agent DESTINATION ${WINPTY_INSTALL_BIN_DIR})
+install(TARGETS winpty-debugserver DESTINATION ${WINPTY_INSTALL_BIN_DIR})
+install(FILES src/include/winpty.h src/include/winpty_constants.h DESTINATION ${WINPTY_INSTALL_INCLUDE_DIR})
+
+
+
Comment thread
kafeg marked this conversation as resolved.
Outdated
54 changes: 54 additions & 0 deletions ports/winpty/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO rprichard/winpty
REF antivirus
SHA512 8f5539c1af2a1127219278446c1d028079867cecdeb03c4f208c7d8176e8802e8075ce1b6992e0ef73db34c69e58f73d3828698d865deb35cb883821ee245e4d
HEAD_REF master
PATCHES
build-with-cmake.patch
allow-build-static.patch
)
Comment thread
kafeg marked this conversation as resolved.
Outdated

set(OPTIONS "")
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
set(BUILD_TYPE SHARED)
list(APPEND OPTIONS -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE)
Comment thread
kafeg marked this conversation as resolved.
Outdated
else()
set(BUILD_TYPE STATIC)
endif()

vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
-DBUILD_TYPE=${BUILD_TYPE}
${OPTIONS}
)

vcpkg_cmake_install()

# cleanup
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)

# license
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/winpty)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/winpty/LICENSE ${CURRENT_PACKAGES_DIR}/share/winpty/copyright)
Comment thread
kafeg marked this conversation as resolved.
Outdated

#copy tools
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
file(GLOB BINARY_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*")
list(FILTER BINARY_TOOLS EXCLUDE REGEX "\\.dll\$")
file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/winpty)
file(REMOVE ${BINARY_TOOLS})
endif()

if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(GLOB BINARY_TOOLS "${CURRENT_PACKAGES_DIR}/debug/bin/*")
list(FILTER BINARY_TOOLS EXCLUDE REGEX "\\.dll\$")
file(REMOVE ${BINARY_TOOLS})
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/tools")
endif()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)

vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/winpty)
Comment thread
kafeg marked this conversation as resolved.
Outdated
17 changes: 17 additions & 0 deletions ports/winpty/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "winpty",
"version-string": "0.4.3",
"port-version": 1,
"description": "winpty is a Windows software package providing an interface similar to a Unix pty-master for communicating with Windows console programs",
"supports": "windows",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
8 changes: 8 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -5416,6 +5416,10 @@
"baseline": "3.0.0",
"port-version": 10
},
"ptyqt": {
"baseline": "0.6.0",
"port-version": 1
},
"pugixml": {
"baseline": "1.11.4",
"port-version": 1
Expand Down Expand Up @@ -7152,6 +7156,10 @@
"baseline": "4.1.3",
"port-version": 5
},
"winpty": {
"baseline": "0.4.3",
"port-version": 1
},
"winreg": {
"baseline": "4.1.2",
"port-version": 0
Expand Down
Loading