diff options
author | tnn <tnn@pkgsrc.org> | 2020-10-20 18:40:31 +0000 |
---|---|---|
committer | tnn <tnn@pkgsrc.org> | 2020-10-20 18:40:31 +0000 |
commit | 9bcbad6f6df646ff48ed617f7203e23c0e0c1d67 (patch) | |
tree | 41c283a8efd45ed50dc1f9a9776aa52384589fe4 | |
parent | bf16acf6c8ff8fc5fc2d65c01ee61218e2c33858 (diff) | |
download | pkgsrc-9bcbad6f6df646ff48ed617f7203e23c0e0c1d67.tar.gz |
ncspot: use PKG_OPTIONS framework
In particular allow building w/o dbus and wide curses but also add
options for the various supported audio backends while here (untested).
Also promote libxcb to full dependency because it failed with
"ld: cannot find -lxcb" when disabling dbus.
-rw-r--r-- | audio/ncspot/Makefile | 21 | ||||
-rw-r--r-- | audio/ncspot/distinfo | 3 | ||||
-rw-r--r-- | audio/ncspot/options.mk | 53 | ||||
-rw-r--r-- | audio/ncspot/patches/patch-Cargo.toml | 20 |
4 files changed, 65 insertions, 32 deletions
diff --git a/audio/ncspot/Makefile b/audio/ncspot/Makefile index c2bebadfc44..3e88a5c41c5 100644 --- a/audio/ncspot/Makefile +++ b/audio/ncspot/Makefile @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.5 2020/10/12 12:04:13 pin Exp $ +# $NetBSD: Makefile,v 1.6 2020/10/20 18:40:31 tnn Exp $ DISTNAME= ncspot-0.2.3 +PKGREVISION= 1 CATEGORIES= audio MASTER_SITES= ${MASTER_SITE_GITHUB:=hrkfdn/} GITHUB_TAG= v${PKGVERSION_NOREV} @@ -15,8 +16,6 @@ USE_TOOLS+= pkg-config PYTHON_VERSIONS_ACCEPTED= 37 PYTHON_FOR_BUILD_ONLY= tool -USE_NCURSES= yes # NCURSES_MOUSE_VERSION, also needs wide support - CARGO_CRATE_DEPENDS+= addr2line-0.13.0 CARGO_CRATE_DEPENDS+= adler-0.2.3 CARGO_CRATE_DEPENDS+= aes-0.3.2 @@ -425,19 +424,21 @@ CARGO_CRATE_DEPENDS+= xml-rs-0.6.1 INSTALLATION_DIRS= bin MAKE_ENV+= OPENSSL_DIR=${BUILDLINK_PREFIX.openssl:Q} -RUSTFLAGS+= -C link-arg=${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.ncursesw}/lib RUSTFLAGS+= -C link-arg=${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.openssl}/lib -RUSTFLAGS+= -C link-arg=${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.portaudio}/${BUILDLINK_LIBDIRS.portaudio} +RUSTFLAGS+= -C link-arg=${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.libxcb}/lib +RUSTFLAGS+= -C link-arg=-L${BUILDLINK_PREFIX.libxcb}/lib MAKE_ENV+= RUSTFLAGS=${RUSTFLAGS:Q} +CARGO_ARGS= ${DEFAULT_CARGO_ARGS} --no-default-features --features ${CARGO_FEATURES:S/ /,/Wg} + +CARGO_FEATURES+= share_clipboard + +.include "options.mk" do-install: ${INSTALL_PROGRAM} ${WRKSRC}/target/release/ncspot ${DESTDIR}${PREFIX}/bin -.include "../../audio/portaudio/buildlink3.mk" -.include "../../devel/ncursesw/buildlink3.mk" +.include "../../lang/python/tool.mk" +.include "../../lang/rust/cargo.mk" .include "../../security/openssl/buildlink3.mk" -.include "../../sysutils/dbus/buildlink3.mk" -BUILDLINK_DEPMETHOD.libxcb?= build .include "../../x11/libxcb/buildlink3.mk" -.include "../../lang/rust/cargo.mk" .include "../../mk/bsd.pkg.mk" diff --git a/audio/ncspot/distinfo b/audio/ncspot/distinfo index b7f20e6c40f..875c6dd39a4 100644 --- a/audio/ncspot/distinfo +++ b/audio/ncspot/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.4 2020/10/12 12:04:13 pin Exp $ +$NetBSD: distinfo,v 1.5 2020/10/20 18:40:31 tnn Exp $ SHA1 (addr2line-0.13.0.crate) = c7a6843df774a95b4db5a5511b58ab22c44f228a RMD160 (addr2line-0.13.0.crate) = 22c733c5358313e9ca7fb95d1dbd695d03fcb552 @@ -1616,4 +1616,3 @@ SHA1 (xml-rs-0.6.1.crate) = 6e27cecdbbc194c01af66be3f9e1cd4ac2a2b2c4 RMD160 (xml-rs-0.6.1.crate) = 470f5a78a46aac7c503aad7a8a00c006c69d898d SHA512 (xml-rs-0.6.1.crate) = 27bba3095a92162f4e0b9f27c2c4c49bd61433ccbbd36957c8347aa25f397d7902253b755f0e70809b96db178cee02620b14e120a80111d4e3da4b40cf2203ab Size (xml-rs-0.6.1.crate) = 50922 bytes -SHA1 (patch-Cargo.toml) = cce572043d1ccd8b59f133487e34a6f6b9a099ed diff --git a/audio/ncspot/options.mk b/audio/ncspot/options.mk new file mode 100644 index 00000000000..44cd1c879bd --- /dev/null +++ b/audio/ncspot/options.mk @@ -0,0 +1,53 @@ +# $NetBSD: options.mk,v 1.1 2020/10/20 18:40:31 tnn Exp $ + +PKG_OPTIONS_VAR= PKG_OPTIONS.ncspot +PKG_OPTIONS_OPTIONAL_GROUPS= backend ui +PKG_OPTIONS_GROUP.backend= alsa portaudio pulseaudio rodio +PKG_OPTIONS_GROUP.ui= ncursesw termion + +PKG_SUPPORTED_OPTIONS= dbus +PKG_SUGGESTED_OPTIONS= portaudio ncursesw + +.include "../../mk/bsd.options.mk" + +.if !empty(PKG_OPTIONS:Malsa) +CARGO_FEATURES+= alsa_backend +RUSTFLAGS+= -C link-arg=${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.alsa-lib}/lib +.include "../../audio/alsa-lib/buildlink3.mk" +.endif + +.if !empty(PKG_OPTIONS:Mportaudio) +CARGO_FEATURES+= portaudio_backend +RUSTFLAGS+= -C link-arg=${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.portaudio}/${BUILDLINK_LIBDIRS.portaudio} +.include "../../audio/portaudio/buildlink3.mk" +.endif + +.if !empty(PKG_OPTIONS:Mpulseaudio) +CARGO_FEATURES+= pulseaudio_backend +RUSTFLAGS+= -C link-arg=${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.pulseaudio}/lib +.include "../../audio/pulseaudio/buildlink3.mk" +.endif + +.if !empty(PKG_OPTIONS:Mrodio) +CARGO_FEATURES+= rodio_backend +.endif + +.if !empty(PKG_OPTIONS:Mncursesw) +USE_NCURSES= yes # NCURSES_MOUSE_VERSION +CARGO_FEATURES+= cursive/pancurses-backend +RUSTFLAGS+= -C link-arg=${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.ncursesw}/lib +.include "../../devel/ncursesw/buildlink3.mk" +.endif + +.if !empty(PKG_OPTIONS:Mtermion) +CARGO_FEATURES+= cursive/termion-backend +.endif + +.if !empty(PKG_OPTIONS:Mdbus) +CARGO_FEATURES+= mpris +CARGO_FEATURES+= notif +RUSTFLAGS+= -C link-arg=${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.dbus}/lib +. include "../../sysutils/dbus/buildlink3.mk" +.else + +.endif diff --git a/audio/ncspot/patches/patch-Cargo.toml b/audio/ncspot/patches/patch-Cargo.toml deleted file mode 100644 index 4e609fc8c65..00000000000 --- a/audio/ncspot/patches/patch-Cargo.toml +++ /dev/null @@ -1,20 +0,0 @@ -$NetBSD: patch-Cargo.toml,v 1.4 2020/10/12 12:04:14 pin Exp $ - -Use portaudio by default - ---- Cargo.toml.orig 2020-10-10 19:00:54.000000000 +0000 -+++ Cargo.toml -@@ -51,12 +51,6 @@ version = "0.15" - default-features = false - - [features] --share_clipboard = ["clipboard"] --alsa_backend = ["librespot-playback/alsa-backend"] --pulseaudio_backend = ["librespot-playback/pulseaudio-backend"] --rodio_backend = ["librespot-playback/rodio-backend"] - portaudio_backend = ["librespot-playback/portaudio-backend"] --termion_backend = ["cursive/termion-backend"] --mpris = ["dbus"] - notify = ["notify-rust"] --default = ["share_clipboard", "pulseaudio_backend", "mpris", "notify", "cursive/pancurses-backend"] -+default = ["portaudio_backend", "notify", "cursive/pancurses-backend"] |