From 2a31c13cdf10b9df326d9b7c9654e09d6a229403 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20De=C3=A1k?= Date: Fri, 24 Jul 2020 13:50:18 +1000 Subject: [PATCH] Work on documentation. --- Documentation/BuildDarwin.md | 28 ---------- Documentation/BuildLinux.md | 55 ------------------- Documentation/BuildWindows.md | 45 --------------- Documentation/BuildingOnDarwin.md | 42 ++++++++++++++ Documentation/BuildingOnLinux.md | 45 +++++++++++++++ Documentation/BuildingOnWindows.md | 49 +++++++++++++++++ .../{Cloning.md => GettingStarted.md} | 12 ++-- Scripts/clean.py | 3 +- readme.md | 14 ++--- 9 files changed, 149 insertions(+), 144 deletions(-) delete mode 100644 Documentation/BuildDarwin.md delete mode 100644 Documentation/BuildLinux.md delete mode 100644 Documentation/BuildWindows.md create mode 100644 Documentation/BuildingOnDarwin.md create mode 100644 Documentation/BuildingOnLinux.md create mode 100644 Documentation/BuildingOnWindows.md rename Documentation/{Cloning.md => GettingStarted.md} (61%) diff --git a/Documentation/BuildDarwin.md b/Documentation/BuildDarwin.md deleted file mode 100644 index 5b428d8..0000000 --- a/Documentation/BuildDarwin.md +++ /dev/null @@ -1,28 +0,0 @@ -## Building on macOS - -### Prerequisites - -1. Install the following tools and dependencies: - - * [Homebrew](http://brew.sh/) - * [XCode](https://developer.apple.com/xcode/download/) - * [Qt 5](https://www.qt.io/download), select the following components: - * Qt 5.12.9 / macOS - - - - -2. Use Homebrew to install additional tools and libraries: - - ```sh - brew install cmake libsodium openssl - ``` - -### Compiling (Easy Mode) - -Run the command script `buildMacOS.sh --all` to build all packages. For other options, run with the `--help` switch. - - \ No newline at end of file diff --git a/Documentation/BuildLinux.md b/Documentation/BuildLinux.md deleted file mode 100644 index ada5cb1..0000000 --- a/Documentation/BuildLinux.md +++ /dev/null @@ -1,55 +0,0 @@ -## Building on Linux Mint / Ubuntu - -### Prerequisites - -Install the following tools and dependencies: - -```sh -sudo apt-get install \ - cmake g++ libavahi-compat-libdnssd-dev \ - libcurl4-openssl-dev libegl1-mesa \ - libgl1-mesa-glx libqt5svg5-dev libsodium-dev \ - libssl-dev libsystemd-dev libx11-dev \ - make qtbase5-dev qtcreator qtdeclarative5-dev \ - qttools5-dev xorg-dev -``` - -For building Debian packages: - -```sh -sudo apt-get install build-essential devscripts dh-make lintian -``` - -### Compiling (Easy Mode) - -Run the shell script `buildLinux.sh --all` to build all packages. For other options, run with the `--help` switch. - -### Compiling (Hard Mode) - -Alternatively, you can opt to build the binaries only, as detailed below. We're assuming the current path is in the `Synergy-Binaries` project root. - -```sh -cd Synergy-Core -mkdir build -cd build - -cmake .. -D CMAKE_BUILD_TYPE=MINSIZEREL -D SYNERGY_ENTERPRISE=ON - -cmake --build . --parallel 8 -``` - -Optional, install the application: - -```sh -sudo cmake --install . -``` - -### Launching Automatically - -In Linux Mint we can launch `synergy` client automatically via _System Settings → Startup Applications_, then add an entry with the command: - -```sh -/usr/bin/synergyc --name ClientName --daemon #.#.#.# -``` - -Substitute the `ClientName` with the local machine name, and the Synergy server IP `#.#.#.#` with whatever appropriate for your set-up. diff --git a/Documentation/BuildWindows.md b/Documentation/BuildWindows.md deleted file mode 100644 index 0132cb4..0000000 --- a/Documentation/BuildWindows.md +++ /dev/null @@ -1,45 +0,0 @@ -## Building on Windows - -### Prerequisites - -1. Install the following tools and dependencies: - - * [Git for Windows](https://gitforwindows.org/) - * [CMake](https://cmake.org/) - * [Visual Studio 2019](https://visualstudio.microsoft.com/downloads/), select the following components: - * VS 2019 C++ x64/x86 build tools - * Windows 10 SDK - * [WiX Toolset](https://wixtoolset.org/releases/), install the following components: - * WiX Toolset Build Tools - * WiX Toolset Visual Studio 2019 Extension - * [Qt 5](https://www.qt.io/download), select the following components: - * Qt 5.12.9 / MSVC 2017 64-bit - -2. Edit the `buildWindows.cmd` script and make sure the following script variables are configured properly: - - * `libQtPath` - Path to the Qt library, Visual C++, 64-bit build. - - * `vcvarsallCommand` - Path to Visual Studio's `vcvarsall.bat` command script, which sets compiler environment variables. See [Microsoft C++ toolset documentation](https://docs.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=vs-2019) for details. - - * `cmakeGenerator` - Specifies the "generator" setting for cmake. Run `cmake --help` to choose the suitable generator for your current tool chain. - -### Compiling (Easy Mode) - -Run the command script `buildWindows.cmd --all` to build all packages. For other options, run with the `--help` switch. - -### Compiling (Hard Mode) - -Alternatively, you can opt to build the binaries only, as detailed below. We're assuming the current path is in the `Synergy-Binaries` project root. - -```bat -cd Synergy-Core -mkdir build -cd build - -call "c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 - -cmake .. -G "Visual Studio 16 2019" -D CMAKE_PREFIX_PATH="c:\Qt\Qt5.12.9\5.12.9\msvc2017_64" -D CMAKE_BUILD_TYPE=MINSIZEREL -D SYNERGY_ENTERPRISE=ON - -msbuild synergy-core.sln /p:Platform="x64" /p:Configuration=Release /m -``` -You may need to use different paths to `vcvarsall.bat` and Qt libraries, whatever is appropriate for your system. Consequently, the generator `-G` switch for `cmake` must also reflect the tool chain environment. See `cmake --help` for details. diff --git a/Documentation/BuildingOnDarwin.md b/Documentation/BuildingOnDarwin.md new file mode 100644 index 0000000..7073d82 --- /dev/null +++ b/Documentation/BuildingOnDarwin.md @@ -0,0 +1,42 @@ +## Building on macOS + +### Prerequisites + +1. Install the following tools and dependencies: + + * [Homebrew](http://brew.sh/) + * [Python 3](https://www.python.org/downloads/windows/) + * [XCode](https://developer.apple.com/xcode/download/) + * [Qt 5](https://www.qt.io/download/), select the following components: + * Qt 5.12.9 / macOS + +2. Edit the [`Scripts\config.txt`](../Scripts/config.txt) file and make sure the following variables are configured properly under the `[Darwin]` section: + + * `libQtPath` -- Full path to the Qt library, clang, 64-bit build. + +3. Run the installer script to configure additional dependencies, as noted below. If you wish to examine what packages will be installed, see package lists [`PackageListBrew.txt`](../Scripts/Install/PackageListBrew.txt) and [`PackageListPython.txt`](../Scripts/Install/PackageListPython.txt). + + * If Python is already installed: + ```sh + python.exe ./Scripts/install.py [--upgrade] + ``` + * If Python is not installed: + ```sh + ./Scripts/Install/InstallDarwin.sh [--upgrade] + ``` + + Use the `--upgrade` switch to refresh packages at a later date. + +### Building + +Build the project with the following Python script. Packages will be copied into the [`Binaries`](../Binaries) directory. + +```sh +./Scripts/build.py +``` + +Similarly, one can clean the project, which resets Git repositories to a clean state: + +```sh +./Scripts/clean.py +``` diff --git a/Documentation/BuildingOnLinux.md b/Documentation/BuildingOnLinux.md new file mode 100644 index 0000000..708f8d3 --- /dev/null +++ b/Documentation/BuildingOnLinux.md @@ -0,0 +1,45 @@ +## Building on Linux Mint / Ubuntu + +### Prerequisites + +1. Install Python 3: + ```sh + sudo apt-get install python3 python3-pip python3-setuptools + ``` + +2. Run the installer script to configure additional dependencies, as noted below. If you wish to examine what packages will be installed, see package lists [`PackageListAPT.txt`](../Scripts/Install/PackageListAPT.txt) and [`PackageListPython.txt`](../Scripts/Install/PackageListPython.txt). + + * If Python is already installed: + ```sh + python.exe ./Scripts/install.py [--upgrade] + ``` + * If Python is not installed: + ```sh + ./Scripts/Install/InstallLinux.sh [--upgrade] + ``` + + Use the `--upgrade` switch to refresh packages at a later date. + +### Building + +Build the project with the following Python script. Packages will be copied into the [`Binaries`](../Binaries) directory. + +```sh +./Scripts/build.py +``` + +Similarly, one can clean the project, which resets Git repositories to a clean state: + +```sh +./Scripts/clean.py +``` + +### Launching Automatically + +In Linux Mint we can launch `synergy` client automatically via _System Settings → Startup Applications_, then add an entry with the command: + +```sh +/usr/bin/synergyc --name ClientName --daemon #.#.#.# +``` + +Substitute the `ClientName` with the local machine name, and the Synergy server IP `#.#.#.#` with whatever appropriate for your set-up. diff --git a/Documentation/BuildingOnWindows.md b/Documentation/BuildingOnWindows.md new file mode 100644 index 0000000..9a43174 --- /dev/null +++ b/Documentation/BuildingOnWindows.md @@ -0,0 +1,49 @@ +## Building on Windows + +### Prerequisites + +1. Install the following tools and dependencies: + + * [Chocolatey](https://chocolatey.org/) + * [Python 3](https://www.python.org/downloads/windows/) + * [Visual Studio 2019](https://visualstudio.microsoft.com/downloads/), select the following components: + * VS 2019 C++ x64/x86 build tools + * Windows 10 SDK + * [WiX Toolset](https://wixtoolset.org/releases/), install the following components: + * WiX Toolset Build Tools + * WiX Toolset Visual Studio 2019 Extension + * [Qt 5](https://www.qt.io/download/), select the following components: + * Qt 5.12.9 / MSVC 2017 64-bit + +2. Edit the [`Scripts\config.txt`](../Scripts/config.txt) file and make sure the following variables are configured properly under the `[Windows]` section: + + * `libQtPath` -- Full path to the Qt library, Visual C++, 64-bit build. + * `vcvarsallPath` -- Full path to Visual Studio's `vcvarsall.bat` command script. which sets compiler environment variables. See [Microsoft C++ toolset documentation](https://docs.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=vs-2019) for details. + * `cmakeGenerator` -- Specifies the generator setting for cmake. Run `cmake --help` to choose a suitable generator that best matches the Visual Studio version installed earlier. + +3. Run the installer script to configure additional dependencies, as noted below. If you wish to examine what packages will be installed, see package lists [`PackageListChoco.config`](../Scripts/Install/PackageListChoco.config) and [`PackageListPython.txt`](../Scripts/Install/PackageListPython.txt). + + * If Python is already installed: + ```bat + python.exe Scripts\install.py [--upgrade] + ``` + * If Python is not installed: + ```bat + powershell.exe -File Scripts\Install\InstallWindows.ps1 [-upgrade] + ``` + + Use the `--upgrade` switch (or `-upgrade` switch for PowerShell) to refresh packages at a later date. + +### Building + +Build the project with the following Python script. Packages will be copied into the [`Binaries`](../Binaries) directory. + +```bat +python.exe Scripts\build.py +``` + +Similarly, one can clean the project, which resets Git repositories to a clean state: + +```bat +python.exe Scripts\clean.py +``` diff --git a/Documentation/Cloning.md b/Documentation/GettingStarted.md similarity index 61% rename from Documentation/Cloning.md rename to Documentation/GettingStarted.md index bc42b38..c9b38f4 100644 --- a/Documentation/Cloning.md +++ b/Documentation/GettingStarted.md @@ -1,6 +1,6 @@ -## Cloning the Repository +## Getting Started -### Preparation +### Cloning This Repository Before you begin building Synergy, you need to recursively clone this project and its submodules: @@ -23,10 +23,8 @@ The following files or directories should be of interest: File / Directory | Description --- | --- -[`Binaries`](./Binaries) | Output location for the build binaries. -[`Documentation`](./Documentation) | Documentation for various scripts. +[`Binaries`](./Binaries) | Output location for the build products. +[`Documentation`](./Documentation) | Contains project documentation. [`Synergy-Core`](https://github.com/symless/synergy-core/) | The official Synergy Core submodule. +[`Scripts`](./Scripts) | Collection of Python build scripts. [`Tools`](./Tools) | Temporary location for build tools. -[`buildLinux.sh`](./buildLinux.sh) | Shell script for building binaries in Linux Mint or Ubuntu. -[`buildMacOS.sh`](./buildMacOS.sh) | Shell script for building binaries in macOS. -[`buildWindows.cmd`](./buildWindows.cmd) | Command script for building binaries in Windows. diff --git a/Scripts/clean.py b/Scripts/clean.py index bd42d1e..fe0611c 100755 --- a/Scripts/clean.py +++ b/Scripts/clean.py @@ -13,4 +13,5 @@ utility.runCommand( "git clean -fdx" ) os.chdir( config.toplevelPath ) -utility.runCommand( "git clean -fdx" ) +# Clean with capital -X switch to preserve user-edited config files +utility.runCommand( "git clean -fdX" ) diff --git a/readme.md b/readme.md index a819ea5..d48650b 100644 --- a/readme.md +++ b/readme.md @@ -18,19 +18,17 @@ If you can't locate a binary package for your particular distribution, try build ## Building -The information presented here is based on the [official wiki pages](https://github.com/symless/synergy-core/wiki). Anyone attempting to build Synergy should consult the official wiki pages first, then read build instructions specific for your platform. +The build system in this project where hacked together from information presented on the official Synergy Core [wiki pages](https://github.com/symless/synergy-core/wiki/), and from the Azure Pipeline [configuration files](https://github.com/symless/synergy-core/tree/master/CI/), found in the sources. Anyone attempting to build Synergy should consult the official wiki pages first, or use Azure Pipelines to generate all packages (if appropriate). Otherwise, you can try using the build scripts in this project. 1. Official Documentation * [Compiling](https://github.com/symless/synergy-core/wiki/Compiling), and [Compiling Synergy Core](https://github.com/symless/synergy-core/wiki/Compiling-Synergy-Core) * [Building the Windows MSI Package](https://github.com/symless/synergy-core/wiki/Building-the-Windows-MSI-Package) -2. Getting Started - * [Cloning the Repository](./Documentation/Cloning.md) - -3. Building the Binaries - * [Building on Linux Mint / Ubuntu](./Documentation/BuildLinux.md) - * [Building on macOS](./Documentation/BuildDarwin.md) - * [Building on Windows](./Documentation/BuildWindows.md) +2. Building the Binaries + * [Getting Started](./Documentation/GettingStarted.md) + * [Building on Linux Mint / Ubuntu](./Documentation/BuildingOnLinux.md) + * [Building on macOS](./Documentation/BuildingOnDarwin.md) + * [Building on Windows](./Documentation/BuildingOnWindows.md) ## Disclaimers and Legal