Skip to content

Commit

Permalink
update libssh 0.10.6
Browse files Browse the repository at this point in the history
backported build changes from master
  • Loading branch information
chcg committed Dec 19, 2023
1 parent d9b6bae commit deca299
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 21 deletions.
51 changes: 42 additions & 9 deletions .github/workflows/CI_build.yml
Expand Up @@ -13,49 +13,74 @@ jobs:
build_platform: [x64, ARM64, Win32]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: generate cmake
run: |
# avoid issue for x64 build to find false openssl by libssh
Remove-Item -Recurse -Force 'C:\Program Files\OpenSSL'
mkdir _build
cd _build
cmake -G "Visual Studio 17 2022" -A ${{ matrix.build_platform }} -T "v143" ..
- name: build cmake
run: |
cd _build
cmake --build . --config ${{ matrix.build_configuration }}
cmake --build . --config ${{ matrix.build_configuration }} --target package
- name: Archive artifacts for x64
if: matrix.build_platform == 'x64' && matrix.build_configuration == 'Release'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: plugin_dll_x64
path: _build\${{ matrix.build_configuration }}\NppFTP.dll

- name: Archive artifacts for x64 CPack
if: matrix.build_platform == 'x64' && matrix.build_configuration == 'Release'
uses: actions/upload-artifact@v4
with:
name: cpack_plugin_dll_x64
path: _build\NppFTP-0.29.13-win64.zip

- name: Archive artifacts for ARM64
if: matrix.build_platform == 'ARM64' && matrix.build_configuration == 'Release'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: plugin_dll_ARM64
path: _build\${{ matrix.build_configuration }}\NppFTP.dll

- name: Archive artifacts for ARM64 CPack
if: matrix.build_platform == 'ARM64' && matrix.build_configuration == 'Release'
uses: actions/upload-artifact@v4
with:
name: cpack_plugin_dll_ARM64
path: _build\NppFTP-0.29.13-win64.zip

- name: Archive artifacts for Win32
if: matrix.build_platform == 'Win32' && matrix.build_configuration == 'Release'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: plugin_dll_x86
path: _build\${{ matrix.build_configuration }}\NppFTP.dll

- name: Archive artifacts for Win32 CPack
if: matrix.build_platform == 'Win32' && matrix.build_configuration == 'Release'
uses: actions/upload-artifact@v4
with:
name: cpack_plugin_dll_x86
path: _build\NppFTP-0.29.13-win32.zip


build_linux:

runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
build_platform: ["64", "32"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install packages via apt
run: |
Expand All @@ -68,14 +93,14 @@ jobs:

- name: Archive artifacts for x86
if: matrix.build_platform == '32'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: NppFTP-x86.zip
path: NppFTP-x86.zip

- name: Archive artifacts for x64
if: matrix.build_platform == '64'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: NppFTP-x64.zip
path: NppFTP-x64.zip
Expand All @@ -98,12 +123,13 @@ jobs:

runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
build_configuration: [Release, Debug]
build_platform: ["Unix Makefiles"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install packages via apt
run: |
Expand All @@ -121,3 +147,10 @@ jobs:
run: |
cd _build
cmake --build . --config ${{ matrix.build_configuration }} --target package
- name: Archive artifacts for x64 CPack
if: matrix.build_configuration == 'Release'
uses: actions/upload-artifact@v4
with:
name: cpack_plugin_dll_x64_linux
path: _build/NppFTP-0.29.13-win64.zip
13 changes: 7 additions & 6 deletions CMakeLists.txt
@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.0)
cmake_minimum_required (VERSION 3.5)

set (CMAKE_SYSTEM_NAME Windows)

Expand Down Expand Up @@ -142,21 +142,22 @@ if (MINGW)
#remove the lib from the generated target lib
SET(CMAKE_SHARED_LIBRARY_PREFIX "")

target_link_libraries (NppFTP comctl32 shlwapi ssh ssl crypto crypt32 z ws2_32)
target_link_libraries (NppFTP comctl32 shlwapi ssh ssl crypto crypt32 z ws2_32 iphlpapi)
else (MINGW)
target_link_libraries (NppFTP comctl32 shlwapi ssh libeay32 ssleay32 crypt32 zlib ws2_32)
target_link_libraries (NppFTP comctl32 shlwapi ssh libeay32 ssleay32 crypt32 zlib ws2_32 iphlpapi)
endif (MINGW)

# build a CPack driven zip package
#include (InstallRequiredSystemLibraries)

set (CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR})
install(TARGETS NppFTP
DESTINATION ${CMAKE_BINARY_DIR}/zip/bin)
DESTINATION zip)

FILE(GLOB files "${CMAKE_SOURCE_DIR}/doc/*")
INSTALL(FILES ${files} DESTINATION ${CMAKE_BINARY_DIR}/zip/doc)
INSTALL(DIRECTORY docs/ DESTINATION zip/doc)


set(CPACK_PACKAGE_VERSION "0.29.13")
set(CPACK_GENERATOR ZIP)

INCLUDE(CPack)
2 changes: 1 addition & 1 deletion Makefile.mingw
Expand Up @@ -10,7 +10,7 @@ endif

CXX = $(PREFIX)-g++
CFLAGS = -MMD -Os -O3 -Wall -Wno-unused-value -Werror -fexpensive-optimizations -DLIBSSH_STATIC -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE
LFLAGS = -static -L$(OUTDIR)/obj -L$(OUTDIR)/3rdparty/lib -lcomdlg32 -lcomctl32 -luuid -lole32 -lshlwapi -lssh -lssl -lcrypto -lcrypt32 -lz -lgdi32 -lws2_32
LFLAGS = -static -L$(OUTDIR)/obj -L$(OUTDIR)/3rdparty/lib -lcomdlg32 -lcomctl32 -luuid -lole32 -lshlwapi -lssh -lssl -lcrypto -lcrypt32 -lz -lgdi32 -lws2_32 -liphlpapi
INC = -I$(OUTDIR)/3rdparty/include -Isrc -Isrc/Windows -Itinyxml/include -IUTCP/include -I.
RES = $(OUTDIR)/obj/NppFTP.res

Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
@@ -1,4 +1,4 @@
version: 0.29.12.{build}
version: 0.29.13.{build}
image: Visual Studio 2022


Expand Down Expand Up @@ -59,7 +59,7 @@ build_script:
if ($LastExitCode -ne 0) {
throw "Exec: $ErrorMessage"
}
& cmake --build . --config $env:CONFIGURATION -- /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
& cmake --build . --config $env:CONFIGURATION --target package -- /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
if ($LastExitCode -ne 0) {
throw "Exec: $ErrorMessage"
}
Expand Down
6 changes: 3 additions & 3 deletions build_3rdparty.py
Expand Up @@ -73,8 +73,8 @@
'libssh': {
'order' : 3,
'shadow': True,
'url' : 'https://git.libssh.org/projects/libssh.git/snapshot/libssh-0.10.5.tar.xz',
'sha1' : '6c9c51aec473e409cb4086ce77d299f39bc1d533',
'url' : 'https://www.libssh.org/files/0.10/libssh-0.10.6.tar.xz',
'sha1' : 'e8fb3b4750db11d2483cac4b5f046e301c09b72f',
'target': {
'mingw-w64': {
'result': ['include/libssh/libssh.h', 'lib/libssh.a'],
Expand Down Expand Up @@ -136,7 +136,7 @@ def shell(cmd):
def rmdir(path):
if os.path.exists(path):
if platform.system() == 'Windows':
shell('attrib -R %s\* /S' % path)
shell('attrib -R %s\\* /S' % path)
shutil.rmtree(path)

def mkdir_p(*paths):
Expand Down

0 comments on commit deca299

Please sign in to comment.