User Tools

Site Tools


wiki:development:build-howto-mswin:x2goclient

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
wiki:development:build-howto-mswin:x2goclient [2020/01/25 18:02]
ionic Switch to HTTPS-PuTTY links.
wiki:development:build-howto-mswin:x2goclient [2023/05/08 22:20] (current)
orion [Copying the nxproxy binaries] Use nxproxy\src\.libs\nxproxy.exe
Line 122: Line 122:
 You need libssh to build X2Go Client. You need libssh to build X2Go Client.
  
-X2Go Client 4.0.4.and later use libssh 0.7.x with pageant support.+X2Go Client 4.1.2.and later use libssh 0.9.x with pageant support. 
 + 
 +=== Pre-built Binaries ===
  
 Get the **library** package built with MinGW 4.8.x (currently 4.8.2) from [[http://code.x2go.org/gitweb?p=x2goclient-contrib.git;a=tree;hb=HEAD | x2goclient-contrib.git]] Get the **library** package built with MinGW 4.8.x (currently 4.8.2) from [[http://code.x2go.org/gitweb?p=x2goclient-contrib.git;a=tree;hb=HEAD | x2goclient-contrib.git]]
Line 140: Line 142:
 x2goclient-contrib\libssh\0.6.3-762055b-pageant-support-mingw482_bin\lib\*.* -> d:\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\mingw32\i686-w64-mingw32\lib\ x2goclient-contrib\libssh\0.6.3-762055b-pageant-support-mingw482_bin\lib\*.* -> d:\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\mingw32\i686-w64-mingw32\lib\
 </code> </code>
 +
 +=== Building From Source ===
 +
 +If you want to rebuild the library (e.g., to backport fixes) or update it as part of the release process, follow these steps.
 +
 +== Preparation ==
 +
 +Download the tarball from [[https://www.libssh.org/get-it/|the libssh website]].
 +
 +Unpack it as usually. The X2Go Project keeps libssh source code at ''D:\Build\libssh\''.
 +
 +Adapt any required patches so that they apply cleanup, build and work correctly.
 +
 +We currently patch libssh to include support for PuTTY's Pageant ssh agent.
 +
 +To rebase patches, the X2Go Project uses the private git repository at ''D:\Build\libssh\libssh-git'':
 +  * update the repository: <code>git fetch origin</code>
 +  * check out new release tag (or branch or whatever you intend to build later on): <code>git checkout ... (e.g., libssh-0.9.3)</code>
 +  * create new branch based on the tag/commit/branch/...: <code>git branch ...-win32 (e.g., libssh-0.9.3-win32)</code>
 +  * cherry-pick specific X2Go-related commits from older branches, one ''cherry-pick'' command per commit to be ported: <code>git cherry-pick ...-win32 (e.g., libssh-0.7.4-win32)</code>
 +  * fix any merge conflicts, pull in other upstream code etc.
 +  * update the commit message!
 +  * when done, create patch files: <code>git format-patch HEAD~ (for one patch, use ~~ for two patches etc.)</code>
 +
 +Move the patches to the respective source directory and apply them in order.
 +
 +If needed, install or update ''cmake'' on the build machine.
 +
 +== Configuration ==
 +
 +Open a terminal window. Crucially, this must **not** be a ''Cygwin'' instance.
 +
 +Make sure that the MinGW toolchain that was used to build Qt (and will be used to build X2Go CLient later on) is part of the %PATH% variable. On the X2Go Windows Builder, a session spawned via ''cmd.exe'' typically fulfills this requirement. Additionally, use the same ''zlib'' version for building both ''Qt'' and ''libssh''.
 +
 +Go to the unpacked source directory: <code>D:; cd Build\libssh\libssh-...</code>
 +
 +Create and switch to a build subdirectory: <code>mkdir build; cd build</code>
 +
 +The pre-built libssh versions in ''x2goclient-contrib'' contain a file called ''CMake-Show-My-Changes.txt''. Use this as a reference for building.
 +
 +Call ''cmake'' to configure the project, example (adapt to your system!): <code>"C:\Program Files\CMake\bin\cmake.exe" -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX:PATH="D:/Build/libssh/libssh-staging" -DCMAKE_C_COMPILER:FILEPATH="D:/i686-4.8.2-release-posix-dwarf-rt_v3-rev3/mingw32/bin/gcc.exe" -DCMAKE_LINKER:FILEPATH="D:/i686-4.8.2-release-posix-dwarf-rt_v3-rev3/mingw32/bin/ld.exe" -DZLIB_LIBRARY_RELEASE:FILEPATH="D:/x2goclient-contrib/zlib/1.2.8_bin/zlib1.dll" -DWITH_GSSAPI:BOOL="0" -DWITH_NACL:BOOL="0" -DCMAKE_BUILD_TYPE:STRING="Release" -DCMAKE_MAKE_PROGRAM:FILEPATH="D:/i686-4.8.2-release-posix-dwarf-rt_v3-rev3/mingw32/bin/mingw32-make.exe" -DWITH_EXAMPLES:BOOL="0" -DZLIB_INCLUDE_DIR:PATH="D:/Build/zlib/zlib-1.2.8/" -DLIB_EAY:FILEPATH="D:/OpenSSL-Win32/lib/MinGW/libeay32.a" -DSSL_EAY:FILEPATH="D:/OpenSSL-Win32/lib/MinGW/ssleay32.a" -DOPENSSL_INCLUDE_DIR:PATH="D:/OpenSSL-Win32/include" ..</code>
 +
 +== Build ==
 +
 +Build the software like any other, append ''-j'' and other flags as desired:
 +
 +<code>"D:\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\mingw32\bin\mingw32-make.exe"</code>
 +
 +== Install ==
 +
 +It's recommended to make sure that the install staging area is clean (fully deleted or at least empty) before installing/staging the built software.
 +
 +This ensures that old/removed files won't linger around and that changes will not remain undetected.
 +
 +<code>rm -rf "D:\Build\libssh\libssh-staging"
 +"D:\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\mingw32\bin\mingw32-make.exe" install</code>
 +
 +Afterwards, clean and install the newly built files into the MinGW prefix:
 +
 +Header files:
 +
 +<code>
 +rm -rf "D:\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\mingw32\i686-w64-mingw32\include\libssh"
 +cp -av "D:\Build\libssh\libssh-staging\include\libssh" "D:\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\mingw32\i686-w64-mingw32\include\libssh"
 +</code>
 +
 +<note>''(dll).a'' files can be static libraries that are being used as "DLL import libraries" on Windows. They do not actually contain the library contents but a mechanism for loading the shared DLL files at run time. This differs from the UNIX concept of the linker automatically generating (unresolved) symbols and ignoring them (if an eventual symbol scanning suceeds) that are automatically resolved at run time.
 +
 +As such, it is important to keep these static DLL import libraries around on Windows, even if library is supposed to be used in a dynamically-linked fashion.</note>
 +
 +
 +Library files:
 +
 +<code>
 +for /R "D:\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\mingw32\i686-w64-mingw32\lib\" %I in (libssh*) do rm -rf "%I"
 +D:
 +cd "D:\Build\libssh\libssh-staging\lib"
 +for %I in (libssh*) do cp -av "%I" "D:\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\mingw32\i686-w64-mingw32\lib\"
 +</code>
 +
 +Afterwards, optionally bundle the new libssh source and binaries in x2goclient-contrib. Explicitly document the command line invocation in a file named ''CMake-Show-My-Changes.txt''.
  
 ===== Build X2Go Client ===== ===== Build X2Go Client =====
Line 433: Line 516:
   - nx-libs 3.5: From ''nxproxy'' directory (''D:\Build\nx-libs\nxproxy'') - ''nxproxy.exe''   - nx-libs 3.5: From ''nxproxy'' directory (''D:\Build\nx-libs\nxproxy'') - ''nxproxy.exe''
   - nx-libs 3.5: From ''nxcomp'' directory (''D:\Build\nx-libs\nxcomp'') - ''cygXcomp.dll''   - nx-libs 3.5: From ''nxcomp'' directory (''D:\Build\nx-libs\nxcomp'') - ''cygXcomp.dll''
-  - nx-libs 3.6: From ''nxproxy\src'' directory (''D:\Build\nx-libs\nxproxy\src'') - ''nxproxy.exe''+  - nx-libs 3.6: From ''nxproxy\src\.libs'' directory (''D:\Build\nx-libs\nxproxy\src\.libs'') - ''nxproxy.exe''
   - nx-libs 3.6: From ''nxcomp\src\.libs'' directory (''D:\Build\nx-libs\nxcomp\src\.libs'') - ''cygXcomp-3.dll''   - nx-libs 3.6: From ''nxcomp\src\.libs'' directory (''D:\Build\nx-libs\nxcomp\src\.libs'') - ''cygXcomp-3.dll''
  
Line 442: Line 525:
     * ''cygpng15-15.dll'' (x2goclient 4.0.3.x)     * ''cygpng15-15.dll'' (x2goclient 4.0.3.x)
     * ''cygpng16-16.dll'' (x2goclient 4.0.4.x+)     * ''cygpng16-16.dll'' (x2goclient 4.0.4.x+)
-    * ''cygstdc\+\+-6.dll''+    * ''cygstdc%%++%%-6.dll''
     * ''cygwin1.dll''     * ''cygwin1.dll''
     * ''cygz.dll''     * ''cygz.dll''
Line 601: Line 684:
   - libssh library ([[wiki:development:build-howto-mswin:x2goclient#installing_libssh|see above section for download link]])   - libssh library ([[wiki:development:build-howto-mswin:x2goclient#installing_libssh|see above section for download link]])
     * ''libssh.dll''     * ''libssh.dll''
-  - libzip library (available [[http://code.x2go.org/releases/binary-win32/3rd-party/libzip/|here on our site]]) (binaries originally from [[ftp://winkde.org/kde/ports/win32/releases/stable/latest/|the KDE Windows project]] site) 
-    * ''libzip.dll'' 
-  - zlib library for libzip (available [[http://code.x2go.org/releases/binary-win32/3rd-party/zlib/|here on our site]]) (binaries originally from [[ftp://winkde.org/kde/ports/win32/releases/stable/latest/|the KDE Windows project]] site) 
-    * ''libz.dll'' 
   - zlib library for libssh (available [[http://code.x2go.org/releases/binary-win32/3rd-party/zlib/|here on our site]]) (binaries originally from [[http://www.zlib.net/ | the zlib project]] site)   - zlib library for libssh (available [[http://code.x2go.org/releases/binary-win32/3rd-party/zlib/|here on our site]]) (binaries originally from [[http://www.zlib.net/ | the zlib project]] site)
     * ''zlib1.dll''     * ''zlib1.dll''
Line 667: Line 746:
   * ''libiconv-2.dll''   * ''libiconv-2.dll''
   * ''libgcc-s-sjlj-1.dll''   * ''libgcc-s-sjlj-1.dll''
-  * ''libiconv-2.dll'' 
   * ''libwinpthread-1.dll''   * ''libwinpthread-1.dll''
   * ''libxml2.dll''   * ''libxml2.dll''
Line 734: Line 812:
   * ''plink.exe''   * ''plink.exe''
   * ''pscp.exe''   * ''pscp.exe''
 +
 +Out of courtesy, we also ship the following additional, not strictly needed binaries:
 +
 +  * ''pageant.exe''
 +  * ''puttygen.exe''
  
  
wiki/development/build-howto-mswin/x2goclient.1579975365.txt.gz · Last modified: 2020/01/25 18:02 by ionic