@@ -7,10 +7,10 @@ A quick installation of the `stg` binary may be performed with `cargo`:
7
7
$ cargo install --path=.
8
8
```
9
9
10
- The above will install the statically linked ` stg ` executable to
11
- ` ~/.cargo/bin ` , by default. The ` --root ` option, ` CARGO_INSTALL_ROOT `
12
- environment variable, or ` install.root ` Cargo config value may be used
13
- to change where StGit is installed.
10
+ The above will install the ` stg ` executable to ` ~/.cargo/bin ` , by
11
+ default. The ` --root ` option, ` CARGO_INSTALL_ROOT ` environment variable,
12
+ or ` install.root ` Cargo config value may be used to change where StGit
13
+ is installed.
14
14
15
15
The ` --locked ` option may be passed to ` cargo install ` to used the
16
16
specific dependency versions from the ` Cargo.lock ` file, otherwise the
@@ -69,3 +69,71 @@ By default the documentation is built using `asciidoc`, but
69
69
``` shellsession
70
70
$ make USE_ASCIIDOCTOR=1 install-man
71
71
```
72
+
73
+ Debian and RPM Packages
74
+ -----------------------
75
+
76
+ The top-level Makefile has targets for building Debian and RPM packages.
77
+ None of the distributions that use Debian and RPM packaging provide
78
+ StGit 2.x (or 1.x) packages. The deb and rpm packages built from the
79
+ StGit repository are meant to fill that gap.
80
+
81
+ These StGit-provided packages do not necessarily conform to all of the
82
+ packaging standards of those distributions. That said, an effort is made
83
+ to properly install man pages, shell completions, and vim files in addition
84
+ to the ` stg ` executable.
85
+
86
+ In order to be maximally portable, the ` stg ` executable in these packages
87
+ is statically linked using [ musl] [ musl ] .
88
+
89
+ The following Makefile targets are available to build packages:
90
+
91
+ - ` packages ` : build deb and rpm packages for all supported architectures
92
+ - ` debs ` : build deb packages for all supported architectures
93
+ - ` rpms ` : build rpm packages for all supported architectures
94
+ - ` deb-i686 ` : build ` stgit_x.y.z_i386.deb `
95
+ - ` deb-x86_64 ` : build ` stgit_x.y.z_amd64.deb `
96
+ - ` deb-aarch64 ` : build ` stgit_x.y.z_arm64.deb `
97
+ - ` rpm-i686 ` : build ` stgit-x.y.z-w.i686.rpm `
98
+ - ` rpm-x86_64 ` : build ` stgit-x.y.z-w.x86_64.rpm `
99
+ - ` rpm-aarch64 ` : build ` stgit-x.y.z-w.aarch64.rpm `
100
+
101
+ The generated package files are output to ` target/pkg/ ` .
102
+
103
+ Rust Dependencies
104
+ =================
105
+
106
+ To build these packages, rust needs to be setup for some additional targets:
107
+
108
+ - aarch64-unknown-linux-musl
109
+ - i686-unknown-linux-musl
110
+ - x86_64-unknown-linux-musl
111
+
112
+ If using ` rustup ` , these targets can be added by with ` rustup target add ` .
113
+
114
+ Cargo Dependencies
115
+ ==================
116
+
117
+ The ` cargo-deb ` and ` cargo-generate-rpm ` crates are used to generate the
118
+ deb and rpm packages, respectively. These may be installed using `cargo
119
+ install`.
120
+
121
+ Linker Setup
122
+ ============
123
+
124
+ When cross-compiling, e.g. when building aarch64 targets from an x86_64
125
+ host, the cross compiler linker needs to be installed and configured.
126
+
127
+ On Arch Linux, install ` aarch64-linux-gnu-gcc ` .
128
+
129
+ In Debian/Ubuntu environments, install the ` gcc-aarch64-linux-gnu `
130
+ package.
131
+
132
+ To configure, add the following to your ` ~/.cargo/config.toml ` file:
133
+
134
+ ``` toml
135
+ [target .aarch64-unknown-linux-musl ]
136
+ linker = " aarch64-linux-gnu-gcc"
137
+ ```
138
+
139
+ [ musl ] : https://musl.libc.org/
0 commit comments