aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md14
-rw-r--r--copypasta/src/lib.rs5
-rw-r--r--src/config.rs3
-rw-r--r--src/tty.rs6
4 files changed, 18 insertions, 10 deletions
diff --git a/README.md b/README.md
index 41e4437c..407bfd6c 100644
--- a/README.md
+++ b/README.md
@@ -50,9 +50,9 @@ will walk you through how to build from source on both macOS and Ubuntu.
```sh
rustup override set nightly
```
-
+
If you run into problems, you can try a known-good version of the compiler by running
-
+
```sh
rustup override set $(<rustc-version)
```
@@ -107,6 +107,16 @@ On [Void Linux](https://voidlinux.eu), install following packages before compili
xbps-install cmake freetype-devel freetype expat-devel fontconfig xclip
```
+##### FreeBSD
+
+On FreeBSD, you need a few extra libraries to build Alacritty. Here's a `pkg`
+command that should install all of them. If something is still found to be
+missing, please open an issue.
+
+```sh
+pkg install cmake freetype2 fontconfig xclip
+```
+
##### Other
If you build Alacritty on another Linux distribution, we would love some help
diff --git a/copypasta/src/lib.rs b/copypasta/src/lib.rs
index b498e2e9..828c23bd 100644
--- a/copypasta/src/lib.rs
+++ b/copypasta/src/lib.rs
@@ -40,13 +40,12 @@ pub trait Store : Load {
where S: Into<String>;
}
-#[cfg(target_os = "linux")]
+#[cfg(any(target_os = "linux", target_os = "freebsd"))]
mod x11;
-#[cfg(target_os = "linux")]
+#[cfg(any(target_os = "linux", target_os = "freebsd"))]
pub use x11::{Clipboard, Error};
#[cfg(target_os = "macos")]
mod macos;
#[cfg(target_os = "macos")]
pub use macos::{Clipboard, Error};
-
diff --git a/src/config.rs b/src/config.rs
index 2665c3b3..e9173f6c 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -1100,7 +1100,7 @@ impl Default for Font {
}
}
-#[cfg(target_os = "linux")]
+#[cfg(any(target_os = "linux",target_os = "freebsd"))]
impl Default for Font {
fn default() -> Font {
Font {
@@ -1546,4 +1546,3 @@ impl Key {
}
}
}
-
diff --git a/src/tty.rs b/src/tty.rs
index c9feae36..0f885d52 100644
--- a/src/tty.rs
+++ b/src/tty.rs
@@ -20,7 +20,7 @@ use std::fs::File;
use std::os::unix::io::FromRawFd;
use std::ptr;
-use libc::{self, winsize, c_int, pid_t, WNOHANG, WIFEXITED, WEXITSTATUS, SIGCHLD};
+use libc::{self, winsize, c_int, pid_t, WNOHANG, WIFEXITED, WEXITSTATUS, SIGCHLD, TIOCSCTTY};
use term::SizeInfo;
use display::OnResize;
@@ -112,7 +112,7 @@ fn openpty(rows: u8, cols: u8) -> (c_int, c_int) {
(master, slave)
}
-#[cfg(target_os = "macos")]
+#[cfg(any(target_os = "macos",target_os = "freebsd"))]
fn openpty(rows: u8, cols: u8) -> (c_int, c_int) {
let mut master: c_int = 0;
let mut slave: c_int = 0;
@@ -138,7 +138,7 @@ fn openpty(rows: u8, cols: u8) -> (c_int, c_int) {
/// Really only needed on BSD, but should be fine elsewhere
fn set_controlling_terminal(fd: c_int) {
let res = unsafe {
- libc::ioctl(fd, libc::TIOCSCTTY as _, 0)
+ libc::ioctl(fd, TIOCSCTTY as _, 0)
};
if res < 0 {