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 [2019/06/07 05:01]
ionic [Overview of third-party components] Add x3270fonts section.
wiki:development:build-howto-mswin:x2goclient [2023/05/08 22:20] (current)
orion [Copying the nxproxy binaries] Use nxproxy\src\.libs\nxproxy.exe
Line 16: Line 16:
  
  
-  * [[wiki:development:build-howto-mswin:x2goclient/#build_add_nxproxy_with_libraries|nxproxy]]+  * [[wiki:development:build-howto-mswin:x2goclient/#building_nxproxy_openssh_optional|nxproxy]]
  
-  * [[wiki:development:build-howto-mswin:x2goclient/#open_ssh_server|OpenSSH Server]] for file sharing (optional)+  * [[wiki:development:build-howto-mswin:x2goclient/#openssh_server|OpenSSH Server]] for file sharing (optional)
  
   * [[wiki:development:build-howto-mswin:x2goclient/#pulseaudio|PulseAudio]] for sound support (optional)   * [[wiki:development:build-howto-mswin:x2goclient/#pulseaudio|PulseAudio]] for sound support (optional)
  
-  * [[wiki:development:build-howto-mswin:x2goclient/#vcxsrv|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 239: Line 322:
  
 <code> <code>
-$ setup-x86.exe -P "autoconf,automake,gcc-core,gcc-g++,git,libX11-devel,libjpeg-devel,libpng-devel,libmpfr4,make,zlib-devel,wget,libedit-devel,libncurses-devel,openssl-devel,patch,bashdb,bash-completion,chere,colorgcc,colordiff,diffutils,dos2unix,cygcheck-dep,cygutils-extra,indent,mc,renameutils,vim,git-completion,patchutils,openssh,xz,unzip,nano,bzip2,time"+$ setup-x86.exe -P "autoconf,automake,gcc-core,gcc-g++,git,libX11-devel,libjpeg-devel,libpng-devel,libmpfr4,make,zlib-devel,wget,libedit-devel,libncurses-devel,openssl-devel,patch,bashdb,bash-completion,chere,colorgcc,colordiff,diffutils,dos2unix,cygcheck-dep,cygutils-extra,indent,mc,renameutils,vim,git-completion,patchutils,openssh,xz,unzip,nano,bzip2,time,mkfontdir,mkfontscale"
 </code> </code>
  
Line 292: Line 375:
   * ''bzip2''   * ''bzip2''
   * ''time''   * ''time''
 +  * ''mkfontdir''
 +  * ''mkfontscale''
  
 If you are doing official builds, install these **source** packages for both nxproxy and openssh: If you are doing official builds, install these **source** packages for both nxproxy and openssh:
Line 431: 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 440: 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 599: 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 665: 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 698: Line 778:
   * ''COPYING.txt''   * ''COPYING.txt''
  
 +=== x3270-fonts ====
 +
 +For IBM x3270 compatibility, a special set of fonts is necessary. Official builds use the version shipped in the ''x3270-fonts'' subdirectory of x2goclient-contrib.
 +
 +Note that versions prior to 3.6 are classified non-free by major distributions due to their custom, restrictive license. Do **not** use and (re-)distribute older versions than 3.6 with X2Go Client.
 +
 +==== Updating x3270 Fonts Package ====
 +
 +  * Check the current licensing situation. Do **not** update the package if it becomes non-free again.
 +  * Build the x3270 package, download a complete precompiled one or just fetch a binary fonts package. Debian conveniently offers one named [[https://packages.debian.org/sid/xfonts-x3270-misc|xfonts-x3270-misc]].
 +  * Create a new versioned subdirectory in the ''x3270-fonts'' directory.
 +  * Extract the binary fonts.
 +  * Make sure that all binary font files are located in one single directory called ''misc''.
 +  * Get copyright and licensing information and place them into a file called ''copyright-x3270-fonts''. Debian's copyright file is very well suited for this, but please remove content that is not relevant to the fonts themselves.
 +  * Use Debian's ''strip-nondeterminism'' script:
 +<code>
 +$ find misc -iname '*.gz' -exec strip-nondeterminism '{}' ';'
 +</code>
 +  * For official builds, create timestamps script:
 +<code>
 +$ cd ..
 +$ ../generate-timestamps-on-folder.sh <new-versions-directory>
 +</code>
 +  * For official builds, call the timestamps script in x2goclient-contrib's top-directory script called ''current-timestamp-scripts.sh''.
 +  * For official builds, update the [[https://code.x2go.org/gitweb?p=x2goclient.git;a=blob;f=copy-deps-win32.bat;hb=HEAD|copy-deps-win32.bat in x2goclient.git]] copying step to use the new directory.
  
 === 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 707: 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 717: 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.1559883663.txt.gz · Last modified: 2019/06/07 05:01 by ionic