continuwuity-bsd/freebsd/Makefile
Katie Kloss 7237dc5a9f
All checks were successful
Build FreeBSD package / build (generic, 15) (push) Successful in 22m55s
Build FreeBSD package / build (generic, 14) (push) Successful in 25m24s
Build FreeBSD package / build (haswell, 15) (push) Successful in 22m40s
Build FreeBSD package / build (haswell, 14) (push) Successful in 24m9s
use LTO profile
2026-02-27 07:54:50 -05:00

61 lines
1.7 KiB
Makefile

PORTNAME= continuwuity
CATEGORIES= net-im
MAINTAINER= katherine.kloss@proton.me
LICENSE= APACHE20
WWW= https://continuwuity.org/
CONFLICTS= conduwuit
FLAVORS= generic haswell
generic_PKGNAMESUFFIX= -generic
haswell_PKGNAMESUFFIX= -haswell
BUILD_DEPENDS+= rust>=1.90:lang/rust \
${LOCALBASE}/llvm21/lib/libclang.so:devel/llvm21
LIB_DEPENDS+= librocksdb.so:databases/rocksdb
UID_FILES= UIDs
GID_FILES= GIDs
USERS= continuwuity
GROUPS= continuwuity
NO_CHECKSUM= yes # b/c no distfiles
USE_RC_SUBR= continuwuity
PLIST_FILES= bin/continuwuity \
"@sample etc/continuwuity/continuwuity.toml.sample"
CARGO_ENV= CARGO_BUILD_JOBS=${MAKE_JOBS_NUMBER}
CARGO_RUN= ${MAKE_ENV} ${CARGO_ENV} ${LOCALBASE}/bin/cargo
.if ${FLAVOR:U}== haswell
CARGO_ENV+= RUSTFLAGS="-C target-cpu=haswell"
.else
CARGO_ENV+= RUSTFLAGS="-C target-cpu=x86-64"
.endif
# override the default fetch-extract targets so we don't try to download distfiles like normal
do-fetch:
do-extract:
# build the current checkout in place but output to the work dir - Cargo will travel upward until it finds a Cargo.toml to build
do-build:
${CARGO_RUN} build \
--profile release-high-perf \
--locked \
--no-default-features \
--package conduwuit \
--target-dir ${WRKDIR}/target \
--features blurhashing,brotli_compression,element_hacks,gzip_compression,io_uring,ldap,media_thumbnail,url_preview,zstd_compression,sentry_telemetry,otlp_telemetry,console,perf_measurements,release_max_log_level
do-install:
${INSTALL_PROGRAM} ${WRKDIR}/target/release-high-perf/conduwuit ${STAGEDIR}${PREFIX}/bin/continuwuity
${MKDIR} ${STAGEDIR}${ETCDIR}
${INSTALL_DATA} ../../conduwuit-example.toml ${STAGEDIR}${ETCDIR}/continuwuity.toml.sample
.include <bsd.port.mk>