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
Next revision Both sides next revision
wiki:development:build-howto-mswin:x2goclient [2019/06/07 07:03]
ionic Add x3270-fonts instructions.
wiki:development:build-howto-mswin:x2goclient [2020/02/06 13:45]
ionic Typo, spelling and capitalization fixes in libssh section.
Line 24: Line 24:
   * [[wiki:development:build-howto-mswin:x2goclient/#vcxsrv_-_xp_compatible|X-Server]] (VcXsrv)   * [[wiki:development:build-howto-mswin:x2goclient/#vcxsrv_-_xp_compatible|X-Server]] (VcXsrv)
  
-  * [[wiki:development:build-howto-mswin:x2goclient/#x3270fonts|x3270 fonts]] (optional)+  * [[wiki:development:build-howto-mswin:x2goclient/#x3270-fonts|x3270 fonts]] (optional)
  
   * [[wiki:development:build-howto-mswin:x2goclient/#putty|PuTTY]] for Kerberos 5 (GSSAPI) authentication   * [[wiki:development:build-howto-mswin:x2goclient/#putty|PuTTY]] for Kerberos 5 (GSSAPI) authentication
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 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 728: Line 806:
 === PuTTY === === PuTTY ===
  
-You can download PuTTY for Windows from [[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html|project site]]. Building PuTTY from source is not the part of this howto.+You can download PuTTY for Windows from [[https://www.chiark.greenend.org.uk/~sgtatham/putty/download.html|project site]]. Building PuTTY from source is not the part of this howto.
  
 These are the only binaries you need from PuTTY. Copy them directly into the ''dist/'' or ''nsis/x2goclient'' folder. These are the only binaries you need from PuTTY. Copy them directly into the ''dist/'' or ''nsis/x2goclient'' folder.
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''
  
  
 ===== Creating an NSIS Installer ===== ===== Creating an NSIS Installer =====
  
-Install NSIS (currently, 3.04): https://nsis.sourceforge.io+Install NSIS (currently, 3.05): https://nsis.sourceforge.io
  
 Previously, we used NSIS Unicode, but this project is stale and NSIS 3.x nowadays supports Unicode. Previously, we used NSIS Unicode, but this project is stale and NSIS 3.x nowadays supports Unicode.
Line 744: Line 827:
 Then, edit ''nsis/x2goclient.nsi'' and replace all instances of ''X2GOCLIENT_VERSION'' with the actual version, and any string at the end. For example, if you were doing a test build of fixing bug 123 on top of 4.0.3.2, use ''4.0.3.2-bug123'' as the version string. Then, edit ''nsis/x2goclient.nsi'' and replace all instances of ''X2GOCLIENT_VERSION'' with the actual version, and any string at the end. For example, if you were doing a test build of fixing bug 123 on top of 4.0.3.2, use ''4.0.3.2-bug123'' as the version string.
  
-Then, open ''nsis\x2goclient.nsi'' with NSIS Unicode. It will build an installer (''*-setup.exe'') and put it into the same directory.+Then, open ''nsis\x2goclient.nsi'' with NSIS. It will build an installer (''*-setup.exe'') and put it into the same directory.
  
 If you wish to build via the command-line, run: If you wish to build via the command-line, run:
 <code> <code>
-$ "C:\Program Files (x86)\NSIS\Unicode\makensis.exe" x2goclient.nsi+$ "C:\Program Files (x86)\NSIS\makensis.exe" x2goclient.nsi
 </code> </code>
 (Adjust path if on 32-bit Windows.) (Adjust path if on 32-bit Windows.)
wiki/development/build-howto-mswin/x2goclient.txt · Last modified: 2023/05/08 22:20 by orion