mirror of
https://github.com/alacritty/alacritty
synced 2024-09-18 15:21:32 +00:00
Make it run on FreeBSD
This commit is contained in:
parent
a2cd4b647c
commit
398e31fa37
14
README.md
14
README.md
|
@ -50,9 +50,9 @@ will walk you through how to build from source on both macOS and Ubuntu.
|
||||||
```sh
|
```sh
|
||||||
rustup override set nightly
|
rustup override set nightly
|
||||||
```
|
```
|
||||||
|
|
||||||
If you run into problems, you can try a known-good version of the compiler by running
|
If you run into problems, you can try a known-good version of the compiler by running
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
rustup override set $(<rustc-version)
|
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
|
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
|
##### Other
|
||||||
|
|
||||||
If you build Alacritty on another Linux distribution, we would love some help
|
If you build Alacritty on another Linux distribution, we would love some help
|
||||||
|
|
|
@ -40,13 +40,12 @@ pub trait Store : Load {
|
||||||
where S: Into<String>;
|
where S: Into<String>;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
|
||||||
mod x11;
|
mod x11;
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
|
||||||
pub use x11::{Clipboard, Error};
|
pub use x11::{Clipboard, Error};
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
mod macos;
|
mod macos;
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
pub use macos::{Clipboard, Error};
|
pub use macos::{Clipboard, Error};
|
||||||
|
|
||||||
|
|
|
@ -1100,7 +1100,7 @@ impl Default for Font {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(any(target_os = "linux",target_os = "freebsd"))]
|
||||||
impl Default for Font {
|
impl Default for Font {
|
||||||
fn default() -> Font {
|
fn default() -> Font {
|
||||||
Font {
|
Font {
|
||||||
|
@ -1546,4 +1546,3 @@ impl Key {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ use std::fs::File;
|
||||||
use std::os::unix::io::FromRawFd;
|
use std::os::unix::io::FromRawFd;
|
||||||
use std::ptr;
|
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 term::SizeInfo;
|
||||||
use display::OnResize;
|
use display::OnResize;
|
||||||
|
@ -112,7 +112,7 @@ fn openpty(rows: u8, cols: u8) -> (c_int, c_int) {
|
||||||
(master, slave)
|
(master, slave)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(any(target_os = "macos",target_os = "freebsd"))]
|
||||||
fn openpty(rows: u8, cols: u8) -> (c_int, c_int) {
|
fn openpty(rows: u8, cols: u8) -> (c_int, c_int) {
|
||||||
let mut master: c_int = 0;
|
let mut master: c_int = 0;
|
||||||
let mut slave: 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
|
/// Really only needed on BSD, but should be fine elsewhere
|
||||||
fn set_controlling_terminal(fd: c_int) {
|
fn set_controlling_terminal(fd: c_int) {
|
||||||
let res = unsafe {
|
let res = unsafe {
|
||||||
libc::ioctl(fd, libc::TIOCSCTTY as _, 0)
|
libc::ioctl(fd, TIOCSCTTY as _, 0)
|
||||||
};
|
};
|
||||||
|
|
||||||
if res < 0 {
|
if res < 0 {
|
||||||
|
|
Loading…
Reference in a new issue