Skip to content

Commit 3616444

Browse files
committed
docs
1 parent 4571154 commit 3616444

File tree

6 files changed

+123
-50
lines changed

6 files changed

+123
-50
lines changed

docs/src/components/global.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import GithubActions from "/src/components/github-actions.astro";
55
import Modal from "/src/components/modal.astro";
66
import BuildInfo from "/src/components/buildinfo.astro";
77
import PatchInfo from "/src/components/patchinfo.astro";
8+
import ScriptVersions from "/src/components/scriptversions.astro";
89

910
import { Steps, Tabs, TabItem, Card, CardGrid, LinkCard, Aside, Icon, FileTree } from "@astrojs/starlight/components";
1011

11-
export { Advanced, BuildInfo, Charts, Details, GithubActions, Modal, Steps, Tabs, TabItem, Card, CardGrid, LinkCard, Aside, Icon, PatchInfo, FileTree };
12+
13+
export { Advanced, BuildInfo, Charts, Details, GithubActions, Modal, Steps, Tabs, TabItem, Card, CardGrid, LinkCard, Aside, Icon, PatchInfo, FileTree, ScriptVersions };
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
import fs from "node:fs/promises";
3+
4+
type Props = {
5+
// Render mode: "sentence" returns a ready-to-use sentence; "values" just returns versions.
6+
mode?: "sentence" | "values";
7+
};
8+
9+
const { mode = "sentence" } = Astro.props as Props;
10+
11+
async function readVersion(relPath: string): Promise<string> {
12+
try {
13+
// Build a file URL relative to this component's location
14+
const url = new URL(relPath, import.meta.url);
15+
const content = await fs.readFile(url, "utf8");
16+
const match = content.match(/script_version=\"([^\"]*)\"/);
17+
return match?.[1] ?? "unknown";
18+
} catch {
19+
return "unknown";
20+
}
21+
}
22+
23+
// Scripts live at the repository root; this component is at docs/src/components/
24+
// So we traverse up three directories to reach the repo root.
25+
const bashVersion = await readVersion("../../../qbt-nox-static.bash");
26+
const shVersion = await readVersion("../../../qbittorrent-nox-static.sh");
27+
---
28+
29+
{
30+
mode === "values" ? (
31+
// Expose just the values when needed
32+
<span data-qbt-bash-version={bashVersion} data-qbt-sh-version={shVersion} />
33+
) : (
34+
<>
35+
<code>qbt-nox-static.bash™</code> is <code>v{bashVersion}</code> and{" "}
36+
<code>qbittorrent-nox-static.sh™</code> is <code>v{shVersion}</code>
37+
</>
38+
)
39+
}

docs/src/content/docs/build-help.mdx

Lines changed: 41 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -42,28 +42,32 @@ The script has some `env` settings that can trigger certain behaviour without th
4242

4343
You can export these before you run the script to set them. The can be used for docker builds or local builds and work in the `.qbt_env` file.
4444

45-
| Build variable | Default if unset | Options | example usage |
46-
| ------------------------------- | ----------------------------------- | ---------------------------- | --------------------------------------------------- |
47-
| `qbt_build_dir` | `qbt-build` | Any valid path | `qbt_build_dir="~/custom"` |
48-
| `qbt_libtorrent_version` | `2.0` | `1.2` `2.0` | `qbt_libtorrent_version="2.0"` |
49-
| `qbt_qt_version` | `6` | `5.12` `5.15` `6.3` `6.3.1` | `qbt_qt_version="6"` |
50-
| `qbt_build_tool` | `cmake` | `cmake` `qmake` | `qbt_build_tool="cmake"` |
51-
| `qbt_cross_name` | empty = `unset` (default to OS gcc) | See Cross arch options below | `qbt_cross_name="aarch64"` |
52-
| `qbt_patches_url` | `username/repo` | `username/repo` | `qbt_patches_url="userdocs/qbittorrent-nox-static"` |
53-
| `qbt_skip_icu` | `yes` | `yes` `no` | `qbt_skip_icu="yes"` |
54-
| `qbt_boost_tag` | latest github stable release or tag | Any valid git tag | `qbt_boost_tag="boost-1.86.0"` |
55-
| `qbt_libtorrent_tag` | latest github stable release or tag | Any valid git tag | `qbt_libtorrent_tag="v2.0.10"` |
56-
| `qbt_qt_tag` | latest github stable release or tag | Any valid git tag | `qbt_qt_tag="v6.8.0"` |
57-
| `qbt_qbittorrent_tag` | latest github stable release or tag | Any valid git tag | `qbt_qbittorrent_tag="release-5.0.1"` |
58-
| `qbt_libtorrent_master_jamfile` | `no` | `yes` `no` | `qbt_libtorrent_master_jamfile="no"` |
59-
| `qbt_workflow_files` | `no` | `yes` `no` | `qbt_workflow_files="no"` |
60-
| `qbt_workflow_artifacts` | `no` | `yes` `no` | `qbt_workflow_artifacts="no"` |
61-
| `qbt_cache_dir` | empty = `unset` | Path: relative or full | `qbt_cache_dir=""` |
62-
| `qbt_optimise_strip` | `yes` | `yes` `no` | `qbt_optimise_strip="yes"` |
63-
| `qbt_build_debug` | `no` | `yes` `no` | `qbt_build_debug="no"` |
64-
| `qbt_standard` | `20` | `14` `17` `20` `23` | `qbt_standard="20"` |
65-
| `qbt_static_ish` | `no` | `yes` `no` | `qbt_static_ish="no"` |
66-
| `qbt_optimise` | `no` | `yes` `no` | `qbt_optimise="yes"` |
45+
| Build variable | Default if unset | Options | example usage |
46+
| ------------------------------- | --------------------------------- | ---------------------------- | --------------------------------------------------- |
47+
| `qbt_zlib_type` | `zlib` | `zlib` `zlib-ng` | `qbt_zlib_type=zlib` |
48+
| `qbt_skip_icu` | `yes` | `yes` `no` | `qbt_skip_icu="yes"` |
49+
| `qbt_boost_tag` | `boost-1.88.0` | Any valid git tag | `qbt_boost_tag="boost-1.86.0"` |
50+
| `qbt_libtorrent_version` | `2.0` | `1.2` `2.0` | `qbt_libtorrent_version="2.0"` |
51+
| `qbt_libtorrent_tag` | `v2.0.11` | Any valid git tag | `qbt_libtorrent_tag="v2.0.10"` |
52+
| `qbt_libtorrent_master_jamfile` | `no` | `yes` `no` | `qbt_libtorrent_master_jamfile="no"` |
53+
| `qbt_qt_version` | `6` | `5.12` `5.15` `6.3` `6.3.1` | `qbt_qt_version="6"` |
54+
| `qbt_qt_tag` | `v6.9.1` | Any valid git tag | `qbt_qt_tag="v6.8.0"` |
55+
| `qbt_qbittorrent_tag` | `release-5.1.2` | Any valid git tag | `qbt_qbittorrent_tag="release-5.1.2"` |
56+
| `qbt_build_dir` | `qbt-build` | `qbt-build` | `qbt_build_dir="~/custom"` |
57+
| `qbt_build_tool` | `cmake` | `cmake` `qmake` | `qbt_build_tool="cmake"` |
58+
| `qbt_cross_name` | `default` (default to OS gcc) | See Cross arch options below | `qbt_cross_name="aarch64"` |
59+
| `qbt_mcm_url` | `userdocs/qbt-musl-cross-make` | | `qbt_mcm_url="userdocs/qbt-musl-cross-make"` |
60+
| `qbt_patches_url` | `userdocs/qbittorrent-nox-static` | | `qbt_patches_url="userdocs/qbittorrent-nox-static"` |
61+
| `qbt_workflow_files` | `no` | `yes` `no` | `qbt_workflow_files="no"` |
62+
| `qbt_cache_dir` | empty = `unset` | | `qbt_cache_dir="cache"` |
63+
| `qbt_optimise_strip` | `yes` | `yes` `no` | `qbt_optimise_strip="yes"` |
64+
| `qbt_build_debug` | `no` | | `qbt_build_debug="no"` |
65+
| `qbt_standard` | `20` | `14` `17` `20` `23` | `qbt_standard="20"` |
66+
| `qbt_static_ish` | `no` | | `qbt_static_ish="no"` |
67+
| `qbt_optimise` | `no` | `yes` `no` | `qbt_optimise="yes"` |
68+
| `qbt_with_qemu` | `yes` | `yes` `no` | `qbt_with_qemu="yes"` |
69+
| `qbt_with_qemu` | `no` | `yes` `no` | `qbt_with_qemu=no` |
70+
| `qbt_host_deps_repo` | `userdocs/qbt-host-deps` | | `qbt_host_deps_repo=userdocs/qbt-host-deps` |
6771

6872
## Build flags
6973

@@ -132,6 +136,7 @@ The `--bootstrap-release` and `--bootstrap-multi-arch` options are specific to G
132136
Use: -cd or --cache-directory Help: -h-cd or --help-cache-directory
133137
Use: -d or --debug Help: -h-d or --help-debug
134138
Use: -bs-e or --bootstrap-env Help: -h-bs-e or --help-bootstrap-env
139+
Use: -bs-ef or --bootstrap-env-full Help: -h-bs-ef or --help-bootstrap-env-full
135140
Use: -bs-p or --bootstrap-patches Help: -h-bs-p or --help-bootstrap-patches
136141
Use: -bs-c or --bootstrap-cmake Help: -h-bs-c or --help-bootstrap-cmake
137142
Use: -bs-r or --bootstrap-release Help: -h-bs-r or --help-bootstrap-release
@@ -146,7 +151,7 @@ The `--bootstrap-release` and `--bootstrap-multi-arch` options are specific to G
146151
Use: -o or --optimise Help: -h-o or --help-optimise
147152
Use: -p or --proxy Help: -h-p or --help-proxy
148153
Use: -pr or --patch-repo Help: -h-pr or --help-patch-repo
149-
Use: -q or --qmake Help: -h-q or --help-qmkae
154+
Use: -q or --qmake Help: -h-q or --help-qmake
150155
Use: -qm or --qbittorrent-master Help: -h-qm or --help-qbittorrent-master
151156
Use: -qt or --qbittorrent-tag Help: -h-qt or --help-qbittorrent-tag
152157
Use: -qtt or --qt-tag Help: -h-qtt or --help-qtt-tag
@@ -185,37 +190,39 @@ The `--bootstrap-release` and `--bootstrap-multi-arch` options are specific to G
185190
export qbt_boost_tag="" ----------------- options Takes a valid git tag or branch for boost
186191
export qbt_qt_tag="" -------------------- options Takes a valid git tag or branch for Qt
187192
export qbt_workflow_files="" ------------ options yes | no - use qbt-workflow-files for dependencies
188-
export qbt_workflow_artifacts="" -------- options yes | no - use qbt_workflow_artifacts for dependencies
189193
export qbt_cache_dir="" ----------------- options path | empty - provide a path to a cache directory
190194
export qbt_libtorrent_master_jamfile="" - options yes | no - use RC branch instead of release jamfile
191195
export qbt_optimise_strip="" ------------ options yes | no - strip binaries - cannot be used with debug
192196
export qbt_build_debug="" --------------- options yes | no - debug build - cannot be used with strip
193-
export qbt_standard="" ------------------ options 14 | 17 | 20 | 23 - c standard for gcc - OS dependendent
197+
export qbt_standard="" ------------------ options 14 | 17 | 20 | 23 - c standard for gcc - OS dependent
194198
export qbt_static_ish="" ---------------- options yes | no - libc linking - link dynamically to host libc
195199

196200
⬤ Default env settings
197201

198-
qbt_build_dir="qbt-build"
202+
qbt_zlib_type="zlib"
203+
qbt_skip_icu="yes"
204+
qbt_boost_tag="boost-1.88.0"
199205
qbt_libtorrent_version="2.0"
206+
qbt_libtorrent_tag="v2.0.11"
207+
qbt_libtorrent_master_jamfile="no"
200208
qbt_qt_version="6"
209+
qbt_qt_tag="v6.9.1"
210+
qbt_qbittorrent_tag="release-5.1.2"
211+
qbt_build_dir="qbt-build"
201212
qbt_build_tool="cmake"
202213
qbt_cross_name="default"
214+
qbt_mcm_url="userdocs/qbt-musl-cross-make"
203215
qbt_patches_url="userdocs/qbittorrent-nox-static"
204-
qbt_skip_icu="yes"
205-
qbt_boost_tag="boost-1.87.0"
206-
qbt_libtorrent_tag="v2.0.10"
207-
qbt_qt_tag="v6.8.1"
208-
qbt_qbittorrent_tag="release-5.0.3"
209-
qbt_libtorrent_master_jamfile="no"
210216
qbt_workflow_files="no"
211-
qbt_workflow_artifacts="no"
212217
qbt_cache_dir=""
213218
qbt_optimise_strip="yes"
214219
qbt_build_debug="no"
215220
qbt_standard="20"
216221
qbt_static_ish="no"
217222
qbt_optimise="no"
218-
223+
qbt_with_qemu="yes"
224+
qbt_host_deps="no"
225+
qbt_host_deps_repo="userdocs/qbt-host-deps"
219226
```
220227
</Details>
221228
:::

docs/src/content/docs/introduction.mdx

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,47 @@ title: Introduction
33
description: Introduction
44
---
55

6-
import { Advanced, BuildInfo, Charts, Details, Modal, Steps, Tabs, TabItem, Card, CardGrid, LinkCard, Aside, Icon } from "/src/components/global.jsx"
6+
import { Advanced, BuildInfo, Charts, Details, Modal, Steps, Tabs, TabItem, Card, CardGrid, LinkCard, Aside, Icon, ScriptVersions } from "/src/components/global.jsx"
77

88
## What is it?
99

1010
`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 a complicated bash script.
1111

1212
:::note
13-
`qbt-nox-static.bash™` is `v2.2.0` and `qbittorrent-nox-static.sh™` is `v2.0.20`. The former is a fork of the latter, from this version, with changes specific to the dependency handling, which in turn makes breaking changes to the default behavior of the script. Combined with renaming the script to `.bash` from `.sh` as it is not a POSIX compliant script this would effectively have made `qbt-nox-static.bash` unavailable for use.
13+
<ScriptVersions/>
14+
15+
The former is a fork of the latter, from this version, with changes specific to the dependency handling, which in turn makes breaking changes to the default behavior of the script. Combined with renaming the script to `.bash` from `.sh` as it is not a POSIX compliant script this would effectively have made `qbittorrent-nox-static.sh` unavailable for use.
1416

1517
So the existence of the two is a transitional change and the `qbt-nox-static.bash` will be deprecated in the future, though any non breaking changes will be backported to the original script.
1618
:::
1719

18-
### What does it do?
20+
### How are they different?
21+
22+
`qbittorrent-nox-static.sh` (legacy)
23+
24+
When the script runs it will attempt to automatically install the host dependencies if it can. It does this with no user input. This is because it was designed to be used in a docker and not a normal host.
25+
26+
If the host env if pre-configured this produces the desired result but if the user does not understand this and runs the script it will just be confusing to see it installing lots of things with no context.
27+
28+
The logic of this is done using [bash indexed arrays](https://www.gnu.org/software/bash/manual/html_node/Arrays.html).
29+
30+
`qbt-nox-static.bash` (current)
31+
32+
When the script runs it will only detect dependencies offer options to proceed. It does nothing unless specifically asked and in a modular way.
33+
34+
With the minimum test dependencies installed, `git`,`bash` and `curl` it can perform most dynamic help functions and testing required to configure the script before installing the core dependencies.
35+
36+
This makes sense when you consider you don't need to install host gcc to crossbuild, somehting which the script handled automatically when configured to crossbuild.
37+
38+
The logic of this is done using [bash associative arrays](https://www.gnu.org/software/bash/manual/html_node/Arrays.html).
39+
40+
### What does it mean to you?
41+
42+
The documentation will be focused on `qbt-nox-static.bash` as it is the more sane behaving script with a better user experience.
43+
44+
The binary outcome should be identical for both. You should use `qbt-nox-static.bash` but if you understand how it works and are using docker, `.qbt_env` or a pre-configured environment, `qbittorrent-nox-static.sh` will do the same thing.
45+
46+
## What does it do?
1947

2048
It handles a lot of the nuanced complexity around building various different dependencies on two different host platforms, towards the same outcome and can target these architectures via crossbuilding:
2149

@@ -49,7 +77,7 @@ It handles a lot of the nuanced complexity around building various different dep
4977

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

52-
### What is the outcome
80+
## What is the outcome
5381

5482
⭐ Here is an example successful default build profile:
5583

docs/src/content/docs/prerequisites.mdx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ For faster build times you can consider a paid service like <Modal id="buildjet"
1818
If you want to self host you need to be able to meet these conditions on your host in order to use the script.
1919

2020
🟩 Supported host build platforms
21-
- Debian: `Bookworm`
22-
- Ubuntu: `Noble`
23-
- Alpine: `3.15` or greater
21+
- Debian: `trixie`
22+
- Ubuntu: `noble`
23+
- Alpine: `3.18` or greater
2424

2525
🟩 Build environment
2626
- <Modal id="docker" label="Docker"/> via a shell like <Modal id="bash" label="Bash"/> or <Modal id="powershell" label="Powershell"/>
@@ -30,19 +30,16 @@ If you want to self host you need to be able to meet these conditions on your ho
3030
- Via <Modal id="docker-desktop" label="Docker Desktop"/> ✅ (recommended method)
3131
- Docker installed in <Modal id="wsl2" label="WSL2"/> image ✅ (alternative recommendation)
3232

33-
3433
🟩 Bash Shell script
3534
- This is 100% a modern bash shell script and it requires having access to bash to run it.
3635

37-
3836
🟧 Host permissions
3937

4038
- The script needs to install some system dependencies in order to proceed and if you do not have permission or access to do this or no access to docker to use a container you must find a more suitable host environment.
4139

42-
4340
🟥 Qt6 requirements
4441

45-
- If you build using Qt6 you will need to have these dependencies installed on the host, <Modal id="qemu" label="qemu and binmtfs"/>
42+
- If you build using Qt6 you will need to have these dependencies installed on the host (not inside the docker), <Modal id="qemu" label="qemu and binmtfs"/>
4643

4744
<Tabs>
4845
<TabItem value="Debian based Linux" label="debian">

0 commit comments

Comments
 (0)