fix: openbsd build

This commit is contained in:
zappityzap 2024-08-12 06:55:06 -07:00 committed by Greg Heartsfield
parent 4f518fd0e7
commit 914ec77617
3 changed files with 9 additions and 4 deletions

View File

@ -55,9 +55,9 @@ bech32 = "0.9.1"
url = "2.3.1"
qrcode = { version = "0.12.0", default-features = false, features = ["svg"] }
nostr = { version = "0.18.0", default-features = false, features = ["base", "nip04", "nip19"] }
[target.'cfg(not(target_env = "msvc"))'.dependencies]
tikv-jemallocator = "0.5"
log = "0.4"
[target.'cfg(all(not(target_env = "msvc"), not(target_os = "openbsd")))'.dependencies]
tikv-jemallocator = "0.5"
[dev-dependencies]
anyhow = "1"

View File

@ -98,6 +98,11 @@ The following OS packages will be helpful; on Debian/Ubuntu:
$ sudo apt-get install build-essential cmake protobuf-compiler pkg-config libssl-dev
```
On OpenBSD:
```console
$ doas pkg_add rust protobuf
```
Clone this repository, and then build a release version of the relay:
```console

View File

@ -10,13 +10,13 @@ use std::process;
use std::sync::mpsc as syncmpsc;
use std::sync::mpsc::{Receiver as MpscReceiver, Sender as MpscSender};
use std::thread;
#[cfg(not(target_env = "msvc"))]
#[cfg(all(not(target_env = "msvc"), not(target_os = "openbsd")))]
use tikv_jemallocator::Jemalloc;
use tracing::info;
use tracing_appender::non_blocking::WorkerGuard;
use tracing_subscriber::EnvFilter;
#[cfg(not(target_env = "msvc"))]
#[cfg(all(not(target_env = "msvc"), not(target_os = "openbsd")))]
#[global_allocator]
static GLOBAL: Jemalloc = Jemalloc;