freebsd-ports/multimedia/librespot/Makefile

45 lines
1.2 KiB
Makefile
Raw Normal View History

# $FreeBSD$
PORTNAME= librespot
PORTVERSION= 0.1.0
CATEGORIES= multimedia net devel
MAINTAINER= mmokhi@FreeBSD.org
COMMENT= Open Source Spotify client library
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
BROKEN= tries to clone git repository during build phase
lang/rust: Install Cargo + use bundled crates This port now provides Cargo. This is the recommended now because Cargo won't be provided separately in the future. To build Cargo, we set `extended = true` in `config.toml`. As a side effect, this flag also installs Rust source code. The port has a new `SOURCES` option (disabled by default) to keep those sources. As a consequence of this, `devel/cargo` is removed. Several ports and Makefiles in Mk were updated to depend on `lang/rust` instead of `devel/cargo`. The other big change in this patch is the use of the bundled crates, instead of relying on Cargo's registry (which was part of the distfiles, in order to allow offline builds). So now, we don't need to prepare the registry when updating this port. This has several other benefits: * It fixes the build with sudo(8). * It fixes the use of the ino-64 patch (it was not applied to the registry, thus not used). Compilation errors were fixed in the ino-64 patch. Various `.cargo-checksum.json` files are updated after the sources are patched (FBSD10_FIX, ino-64, and so on). This fixes builds which were failing with errors such as: error: the listed checksum of `.../rustc-1.19.0-src/src/vendor/lzma-sys/xz-5.2.3/build-aux/config.rpath` has changed: expected: c8b4c017079da9dfb3086a0583e60ffe736184d89005dc5973f0bb0fd17c04bb actual: 561b00eb30ecaef2c9da17bc195e7d2a7ea63facea38ea9849fbb0ed340bebba PR: 221088 Reported by: joneum@, nwhitehorn@, romain@, Ekaterina Vaartis <vaartis@cock.li>, david@catwhisker.org, fullermd@over-yonder.net, rum1cro@yandex.ru, w.schwarzenfeld@utanet.at Differential Revision: https://reviews.freebsd.org/D11783
2017-09-15 20:01:17 +02:00
BUILD_DEPENDS= rust>=1.19.0:lang/rust \
portaudio>0:audio/portaudio
USES= localbase pathfix pkgconfig shebangfix
USE_LDCONFIG= yes
# Rust's target arch string is different from *BSD arch strings
RUST_ARCH_x86_64= x86_64 # dragonfly
RUST_ARCH_amd64= x86_64
RUST_ARCH_i386= i686
RUST_TARGET= ${RUST_ARCH_${ARCH}}-unknown-${OPSYS:tl}
USE_GITHUB= yes
GH_ACCOUNT= plietar
GH_TAGNAME= 85dbc3b
MAKE_ENV= CARGO_HOME=${BUILD_WRKSRC}
PLIST_FILES= bin/${PORTNAME} \
lib/rustlib/${RUST_TARGET}/lib/lib${PORTNAME}.rlib
do-build:
cd ${BUILD_WRKSRC} && ${SETENV} ${MAKE_ENV} cargo build --release --verbose
do-install:
@${MKDIR} ${STAGEDIR}${PREFIX}/lib/rustlib/${RUST_TARGET}/lib
${INSTALL_PROGRAM} ${BUILD_WRKSRC}/target/release/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
${INSTALL_PROGRAM} ${BUILD_WRKSRC}/target/release/${PORTNAME} ${STAGEDIR}${PREFIX}/lib/rustlib/${RUST_TARGET}/lib/lib${PORTNAME}.rlib
.include <bsd.port.mk>