From 914ec776176588cf0f1a3e379f84602f360a19ed Mon Sep 17 00:00:00 2001 From: zappityzap Date: Mon, 12 Aug 2024 06:55:06 -0700 Subject: [PATCH] fix: openbsd build --- Cargo.toml | 4 ++-- README.md | 5 +++++ src/main.rs | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 401165f..9415826 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/README.md b/README.md index d569640..e998ac4 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/src/main.rs b/src/main.rs index ee92534..feadf2c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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;