chore: update build instructions (#6102)

This commit is contained in:
Yat Ho 2023-10-24 10:24:51 +08:00 committed by GitHub
parent 735639c5c7
commit 9d4ad2e330
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 57 additions and 59 deletions

View File

@ -31,15 +31,16 @@ For a more detailed description, and dependencies, visit [How to Build Transmiss
### Building a Transmission release from the command line ### Building a Transmission release from the command line
$ tar xf transmission-3.00.tar.xz ```bash
$ cd transmission-3.00 $ tar xf transmission-4.0.4.tar.xz
$ mkdir build $ cd transmission-4.0.4
$ cd build # Use -DCMAKE_BUILD_TYPE=RelWithDebInfo to build optimized binary with debug information. (preferred)
# Use -DCMAKE_BUILD_TYPE=RelWithDebInfo to build optimized binary with debug information. (preferred) # Use -DCMAKE_BUILD_TYPE=Release to build full optimized binary.
# Use -DCMAKE_BUILD_TYPE=Release to build full optimized binary. $ cmake -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo
$ cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .. $ cd build
$ make $ cmake --build .
$ sudo make install $ sudo cmake --install .
```
### Building Transmission from the nightly builds ### Building Transmission from the nightly builds
@ -49,29 +50,28 @@ If you're new to building programs from source code, this is typically easier th
### Building Transmission from Git (first time) ### Building Transmission from Git (first time)
$ git clone https://github.com/transmission/transmission Transmission ```bash
$ cd Transmission $ git clone --recurse-submodules https://github.com/transmission/transmission Transmission
$ git submodule update --init --recursive $ cd Transmission
$ mkdir build # Use -DCMAKE_BUILD_TYPE=RelWithDebInfo to build optimized binary with debug information. (preferred)
$ cd build # Use -DCMAKE_BUILD_TYPE=Release to build full optimized binary.
# Use -DCMAKE_BUILD_TYPE=RelWithDebInfo to build optimized binary with debug information. (preferred) $ cmake -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo
# Use -DCMAKE_BUILD_TYPE=Release to build full optimized binary. $ cd build
$ cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .. $ cmake --build .
$ make $ sudo cmake --install .
$ sudo make install ```
### Building Transmission from Git (updating) ### Building Transmission from Git (updating)
$ cd Transmission/build ```bash
$ make clean $ cd Transmission/build
$ git submodule foreach --recursive git clean -xfd $ cmake --build . -t clean
$ git pull --rebase --prune $ git submodule foreach --recursive git clean -xfd
$ git submodule update --init --recursive $ git pull --rebase --prune
# Use -DCMAKE_BUILD_TYPE=RelWithDebInfo to build optimized binary with debug information. (preferred) $ git submodule update --init --recursive
# Use -DCMAKE_BUILD_TYPE=Release to build full optimized binary. $ cmake --build .
$ cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .. $ sudo cmake --install .
$ make ```
$ sudo make install
## Contributing ## Contributing

View File

@ -19,20 +19,20 @@ Transmission has an Xcode project file for building in Xcode.
- Open Transmission.xcodeproj - Open Transmission.xcodeproj
- Run the Transmission scheme - Run the Transmission scheme
### Building the native app with ninja ### ### Building the native app with CMake ###
Build the app: Build the app:
```console ```console
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo
ninja -C build transmission-mac cmake --build build -t transmission-mac
open ./build/macosx/Transmission.app open ./build/macosx/Transmission.app
``` ```
### Building the GTK app with ninja ### ### Building the GTK app with CMake ###
Install GTK and build the app: Install GTK and build the app:
```console ```console
brew install gtk4 gtkmm4 brew install gtk4 gtkmm4
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_GTK=ON -DENABLE_MAC=OFF cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_GTK=ON -DENABLE_MAC=OFF
ninja -C build transmission-gtk cmake --build build -t transmission-gtk
./build/gtk/transmission-gtk ./build/gtk/transmission-gtk
``` ```
@ -43,17 +43,17 @@ ninja -C build transmission-gtk
On Debian, you can build transmission with a few dependencies on top of a base installation. On Debian, you can build transmission with a few dependencies on top of a base installation.
For building transmission-daemon you will need basic dependencies For building transmission-daemon you will need basic dependencies
```console ```bash
$ sudo apt install git build-essential cmake libcurl4-openssl-dev libssl-dev python3 $ sudo apt install git build-essential cmake libcurl4-openssl-dev libssl-dev python3
``` ```
You likely want to install transmission as a native GUI application. There are two options, GTK and QT. You likely want to install transmission as a native GUI application. There are two options, GTK and QT.
For GTK 3 client, two additional packages are required For GTK 3 client, two additional packages are required
```console ```bash
$ sudo apt install libgtkmm-3.0-dev gettext $ sudo apt install libgtkmm-3.0-dev gettext
``` ```
For QT client, one additional package is needed on top of basic dependencies For QT client, one additional package is needed on top of basic dependencies
```console ```bash
$ sudo apt install qttools5-dev $ sudo apt install qttools5-dev
``` ```
@ -62,7 +62,7 @@ Then you can begin [building.](#building-transmission-from-git-first-time)
#### Ubuntu #### #### Ubuntu ####
On Ubuntu, you can install the required development tools for GTK with this command: On Ubuntu, you can install the required development tools for GTK with this command:
```console ```bash
$ sudo apt-get install build-essential automake autoconf libtool pkg-config intltool libcurl4-openssl-dev libglib2.0-dev libevent-dev libminiupnpc-dev libgtk-3-dev libappindicator3-dev libssl-dev $ sudo apt-get install build-essential automake autoconf libtool pkg-config intltool libcurl4-openssl-dev libglib2.0-dev libevent-dev libminiupnpc-dev libgtk-3-dev libappindicator3-dev libssl-dev
``` ```
@ -80,7 +80,7 @@ The packages you need are:
* openssl-devel * openssl-devel
Or simply run the following command: Or simply run the following command:
```console ```bash
$ yum install gcc gcc-c++ m4 make automake libtool gettext openssl-devel $ yum install gcc gcc-c++ m4 make automake libtool gettext openssl-devel
``` ```
@ -90,33 +90,31 @@ However, Transmission needs other packages unavailable in `yum`:
* [intltool](https://ftp.gnome.org/pub/gnome/sources/intltool/) * [intltool](https://ftp.gnome.org/pub/gnome/sources/intltool/)
Before building Transmission, you need to set the pkgconfig environment setting: Before building Transmission, you need to set the pkgconfig environment setting:
```console ```bash
$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig $ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
``` ```
### Building Transmission from Git (first time) ### ### Building Transmission from Git (first time) ###
```console ```bash
$ git clone https://github.com/transmission/transmission Transmission $ git clone --recurse-submodules https://github.com/transmission/transmission Transmission
$ cd Transmission $ cd Transmission
$ git submodule update --init --recursive # Use -DCMAKE_BUILD_TYPE=RelWithDebInfo to build optimized binary with debug information. (preferred)
$ mkdir build # Use -DCMAKE_BUILD_TYPE=Release to build full optimized binary.
$ cmake -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo
$ cd build $ cd build
$ # Use -DCMAKE_BUILD_TYPE=RelWithDebInfo to build optimized binary. $ cmake --build .
$ cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .. $ sudo cmake --install .
$ make
$ sudo make install
``` ```
### Building Transmission from Git (updating) ### ### Building Transmission from Git (updating) ###
```console ```bash
$ cd Transmission/build $ cd Transmission/build
$ make clean $ cmake --build . -t clean
$ git submodule foreach --recursive git clean -xfd
$ git pull --rebase --prune $ git pull --rebase --prune
$ git submodule update --recursive $ git submodule update --init --recursive
$ # Use -DCMAKE_BUILD_TYPE=RelWithDebInfo to build optimized binary. $ cmake --build .
$ cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .. $ sudo cmake --install .
$ make
$ sudo make install
``` ```
## On Windows ## ## On Windows ##
@ -138,17 +136,17 @@ You need the following installed:
Vcpkg will install x86 libraries by default. To install x64 add the `--triplet=x64-windows` flag at the end of the commands below. Vcpkg will install x86 libraries by default. To install x64 add the `--triplet=x64-windows` flag at the end of the commands below.
Common dependencies: Common dependencies:
``` ```bat
vcpkg install curl zlib openssl vcpkg install curl zlib openssl
``` ```
Additional dependencies for the Qt client: Additional dependencies for the Qt client:
``` ```bat
vcpkg install qt5-tools qt5-winextras vcpkg install qt5-tools qt5-winextras
``` ```
### Get Transmission source ### Get Transmission source
``` ```bat
git clone https://github.com/transmission/transmission git clone https://github.com/transmission/transmission
cd transmission cd transmission
git submodule update --init --recursive git submodule update --init --recursive
@ -163,11 +161,11 @@ Each option can be set to `ON` or `OFF`, values shown below are the defaults.
* `-DENABLE_UTILS=ON` - build transmission-remote, transmission-create, transmission-edit and transmission-show cli tools * `-DENABLE_UTILS=ON` - build transmission-remote, transmission-create, transmission-edit and transmission-show cli tools
* `-DENABLE_CLI=OFF` - build the cli client * `-DENABLE_CLI=OFF` - build the cli client
``` ```bat
cmake -B build -DCMAKE_TOOLCHAIN_FILE="<path-to-vcpkg>\scripts\buildsystems\vcpkg.cmake" <flags-from-above> <other-cmake-configurations> cmake -B build -DCMAKE_TOOLCHAIN_FILE="<path-to-vcpkg>\scripts\buildsystems\vcpkg.cmake" <flags-from-above> <other-cmake-configurations>
``` ```
To build the project run: To build the project run:
``` ```bat
cmake --build build cmake --build build
``` ```