Skip to content
qbittorrent-nox-static

Introduction

Latest versionv2.2.2

qbt-nox-static.bash™ was originally a simple, amateurish bash script to build a static qbittorrent-nox binary for x86_64. The script has grown and evolved since then and now it’s complicated, amateurish bash script.

qbittorrent-nox-static.sh and qbt-nox-static.bash

The former is a fork of the latter, with the following significant changes:

  • Dependency and data handling logic were heavily modified to allow more modular use of the script.
  • Breaking changes to the default behavior of the script that would affect existing setups using it.
  • Renaming the script to .bash from .sh as it is not a POSIX-compliant script.
  • Combined, these changes would have effectively made qbittorrent-nox-static.sh unavailable for use.
  • Changes were backported to qbittorrent-nox-static.sh during the transition to prevent disruption.

The transition is complete, and all these changes have been merged into qbittorrent-nox-static.sh, so they are effectively the same script with a minor difference in default configuration.

qbittorrent-nox-static.sh has qbt_legacy_mode="yes" to emulate the original behavior of the script to facilitate transition with no breaking changes.

Moving forward, the recommended script is qbt-nox-static.bash, but essentially all that matters is the setting of qbt_legacy_mode="yes" to determine default behavior.

CurrentRecommended

Default behavior: qbt_legacy_mode="no"

When the script is run with no arguments, it will only detect dependencies and offer options required to proceed toward building a binary.

qbt.bash install_test ------ installs the minimum required tools to run tests
qbt.bash install_core ------ installs the required build tools to use the script
qbt.bash bootstrap_deps ---- install_test + install_core

It will not do anything else unless prompted to do so and the required dependencies are present.

This allows configuration to be done before installing core dependencies when the script is used interactively.

This makes sense when you consider you don’t need to install host gcc to cross-build, something the script handles automatically when configured to cross-build.

The documentation will be focused on qbt-nox-static.bash as it is the better-behaved script with a better user experience.

It handles a lot of the nuanced complexity around building various dependencies on two different host platforms toward the same outcome and can target these architectures via cross-building:

Cross-building is done by Musl Cross Make on Alpine and Crossbuild Essentials on Debian-based.

target architectures

armel armhf armv7 aarch64

x86 x86_64

s390x

powerpc ppc64el

mips mipsel mips64 mips64el

loongarch64

riscv64

⭐ On supported host build platforms, the qbt-nox-static.bash will perform these three main tasks via a simple prompt:

  1. Update the system and install the core build dependencies, based on activated options — requires root or sudo privileges if any dependencies are missing.

  2. Download all dependencies locally and build qbittorrent-nox with no special privileges required.

  3. Build a fully static and portable qbittorrent-nox binary using the latest versions of all supported dependencies.

The script is highly configurable and is capable of native and cross-building. These more advanced configurations will be discussed in later sections of the documentation.

⭐ Here is an example successful default build profile:

qBittorrent 5.1.2 was built with the following libraries:
Qt: 6.9.1
Libtorrent: 2.0.11
Boost: 1.89.0
OpenSSL: 3.5.2
zlib: 1.3.1.1-motley

The script creates a fully static qbittorrent-nox binary using glibc

The final result will show this when using ldd

ldd ~/qbt-build/bin/qbittorrent-nox

Gives this result:

not a dynamic executable

The script can be downloaded locally and run on a supported host or via Docker. It has a comprehensive built-in help section, available via the -h flag, that explains all options and demonstrates dynamic command choices. The best thing to do is to read the script installation and usage sections to understand the key features and how to use them.