Skip to content

Commit 4cf10b1

Browse files
authored
feat(netbsd): Allow building on NetBSD (#164)
* Allow building on NetBSD
1 parent a9ed954 commit 4cf10b1

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ core-graphics = "0.22.2"
4242
core-foundation = "0.9.2"
4343
core-foundation-sys = "0.8.3"
4444

45-
[target.'cfg(target_os = "linux")'.dependencies]
45+
[target.'cfg(any(target_os = "linux", target_os = "netbsd"))'.dependencies]
4646
x11rb = "0.9.0"
4747

4848
[features]
@@ -71,4 +71,4 @@ presentations)
7171

7272
[package.metadata.rpm.targets]
7373
buildflags = ["--release"]
74-
t-rec = { path = "/usr/bin/t-rec" }
74+
t-rec = { path = "/usr/bin/t-rec" }

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Blazingly fast terminal recorder that generates animated gif images for the web
2222
- Generates high quality small sized animated gif images or mp4 videos
2323
- **Build-In idle frames detection and optimization** (for super fluid presentations)
2424
- Applies (can be disabled) border decor effects like drop shadow
25-
- Runs on MacOS and Linux
25+
- Runs on MacOS, Linux and NetBSD
2626
- Uses native efficient APIs
2727
- Runs without any cloud service and entirely offline
2828
- No issues with terminal sizes larger than 80x24
@@ -92,6 +92,17 @@ cd t-rec
9292
makepkg -si
9393
```
9494

95+
### Installation on NetBSD
96+
```
97+
pkgin install t-rec
98+
```
99+
100+
Or, if you prefer to build from source,
101+
```
102+
cd /usr/pkgsrc/multimedia/t-rec
103+
make install
104+
```
105+
95106
### with cargo
96107
```sh
97108
sudo apt-get install libx11-dev imagemagick

build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#[cfg(target_os = "linux")]
1+
#[cfg(any(target_os = "linux", target_os = "netbsd"))]
22
fn main() {
33
println!("cargo:rustc-link-lib=X11");
44
}
55

6-
#[cfg(not(target_os = "linux"))]
6+
#[cfg(all(not(target_os = "linux"), not(target_os = "netbsd")))]
77
fn main() {}

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ mod generators;
55
mod tips;
66

77
mod capture;
8-
#[cfg(target_os = "linux")]
8+
#[cfg(any(target_os = "linux", target_os = "netbsd"))]
99
mod linux;
1010
#[cfg(target_os = "macos")]
1111
mod macos;
1212
mod utils;
1313
#[cfg(target_os = "windows")]
1414
mod win;
1515

16-
#[cfg(target_os = "linux")]
16+
#[cfg(any(target_os = "linux", target_os = "netbsd"))]
1717
use crate::linux::*;
1818
#[cfg(target_os = "macos")]
1919
use crate::macos::*;

0 commit comments

Comments
 (0)