-
Notifications
You must be signed in to change notification settings - Fork 7.6k
[winpty, ptyqt] Added ptyqt and winpty ports #21440
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
62be7c5
Added ptyqt and winpty ports
kafeg 5dfe4f5
Fix part of issues
kafeg 3ba844e
Build fixes for Windows
kafeg 6615389
PR suggestions
kafeg e56a0ef
Update versions
kafeg 108e05c
Update CI Baseline
kafeg 8cae21e
Fix PR review suggestions
kafeg e224fdc
fix version
kafeg 7f6b423
Fix baseline and versions
kafeg 234d882
Adjust winpty patch
kafeg 5b385f8
Versions updated
kafeg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| vcpkg_from_github( | ||
| OUT_SOURCE_PATH SOURCE_PATH | ||
| REPO kafeg/ptyqt | ||
| REF 0.6.3 | ||
| SHA512 7a490a6d0cca500d202b0524abf8596d70872c224eea778efd941ad2a995a8a53d295e3ac000ca8fb63e02467f1191ae6bddfd8469fe5df2aca8af972d06fcff | ||
| HEAD_REF master | ||
| ) | ||
|
|
||
| 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() | ||
|
|
||
| if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) | ||
| set(BUILD_TYPE SHARED) | ||
| 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} | ||
| ) | ||
|
|
||
| vcpkg_cmake_install() | ||
| vcpkg_copy_pdbs() | ||
|
|
||
| file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) | ||
| file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| { | ||
| "name": "ptyqt", | ||
| "version": "0.6.3", | ||
| "description": "PtyQt - C++ library for work with PseudoTerminals", | ||
| "supports": "!uwp", | ||
| "dependencies": [ | ||
| "qt5-base", | ||
| { | ||
| "name": "vcpkg-cmake", | ||
| "host": true | ||
| }, | ||
| { | ||
| "name": "vcpkg-cmake-config", | ||
| "host": true | ||
| }, | ||
| { | ||
| "name": "winpty", | ||
| "platform": "windows" | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,172 @@ | ||
| 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) | ||
|
|
||
| if("${BUILD_TYPE}" STREQUAL "STATIC") | ||
| add_definitions(-DBUILD_STATIC) | ||
| else() | ||
| add_definitions(-DCOMPILING_WINPTY_DLL) | ||
| endif() | ||
|
|
||
| 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}) | ||
|
|
||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| diff --git a/src/include/winpty.h b/src/include/winpty.h | ||
| index fdfe4bc..7864d96 100644 | ||
| --- a/src/include/winpty.h | ||
| +++ b/src/include/winpty.h | ||
| @@ -32,11 +32,15 @@ | ||
| * 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. */ | ||
| +#ifndef BUILD_STATIC | ||
| #ifdef COMPILING_WINPTY_DLL | ||
| #define WINPTY_API __declspec(dllexport) | ||
| #else | ||
| #define WINPTY_API __declspec(dllimport) | ||
| #endif | ||
| +#else | ||
| +#define WINPTY_API | ||
| +#endif | ||
|
|
||
| #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"); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| vcpkg_from_github( | ||
| OUT_SOURCE_PATH SOURCE_PATH | ||
| REPO rprichard/winpty | ||
| REF antivirus | ||
| SHA512 8f5539c1af2a1127219278446c1d028079867cecdeb03c4f208c7d8176e8802e8075ce1b6992e0ef73db34c69e58f73d3828698d865deb35cb883821ee245e4d | ||
| HEAD_REF master | ||
| PATCHES | ||
| allow-build-static.patch | ||
| ) | ||
|
|
||
| file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") | ||
|
|
||
| if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) | ||
| set(BUILD_TYPE SHARED) | ||
| else() | ||
| set(BUILD_TYPE STATIC) | ||
| endif() | ||
|
|
||
| vcpkg_cmake_configure( | ||
| SOURCE_PATH ${SOURCE_PATH} | ||
| OPTIONS | ||
| -DBUILD_TYPE=${BUILD_TYPE} | ||
| ) | ||
|
|
||
| vcpkg_cmake_install() | ||
|
|
||
| file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) | ||
| file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) | ||
|
|
||
| vcpkg_copy_tools(TOOL_NAMES winpty-agent winpty-debugserver AUTO_CLEAN) | ||
|
|
||
| file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "name": "winpty", | ||
| "version": "0.4.3", | ||
| "description": "winpty is a Windows software package providing an interface similar to a Unix pty-master for communicating with Windows console programs", | ||
| "supports": "windows & !uwp", | ||
| "dependencies": [ | ||
| { | ||
| "name": "vcpkg-cmake", | ||
| "host": true | ||
| }, | ||
| { | ||
| "name": "vcpkg-cmake-config", | ||
| "host": true | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "versions": [ | ||
| { | ||
| "git-tree": "f1290a650fa42cb4cb9caf9fe04d47d2b3506248", | ||
| "version": "0.6.3", | ||
| "port-version": 0 | ||
| } | ||
| ] | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "versions": [ | ||
| { | ||
| "git-tree": "5e8c617e9c5e12b7e760808bdea82f3c3ccc6153", | ||
| "version": "0.4.3", | ||
| "port-version": 0 | ||
| } | ||
|
kafeg marked this conversation as resolved.
|
||
| ] | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.