pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/audio/ncspot ncspot: use PKG_OPTIONS framework
details: https://anonhg.NetBSD.org/pkgsrc/rev/01d36da2cbd7
branches: trunk
changeset: 440869:01d36da2cbd7
user: tnn <tnn%pkgsrc.org@localhost>
date: Tue Oct 20 18:40:31 2020 +0000
description:
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.
diffstat:
audio/ncspot/Makefile | 21 +++++++------
audio/ncspot/distinfo | 3 +-
audio/ncspot/options.mk | 53 +++++++++++++++++++++++++++++++++++
audio/ncspot/patches/patch-Cargo.toml | 20 -------------
4 files changed, 65 insertions(+), 32 deletions(-)
diffs (145 lines):
diff -r fe20f2a02c51 -r 01d36da2cbd7 audio/ncspot/Makefile
--- a/audio/ncspot/Makefile Tue Oct 20 18:37:36 2020 +0000
+++ b/audio/ncspot/Makefile Tue Oct 20 18:40:31 2020 +0000
@@ -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 @@
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 @@
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 -r fe20f2a02c51 -r 01d36da2cbd7 audio/ncspot/distinfo
--- a/audio/ncspot/distinfo Tue Oct 20 18:37:36 2020 +0000
+++ b/audio/ncspot/distinfo Tue Oct 20 18:40:31 2020 +0000
@@ -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 @@
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 -r fe20f2a02c51 -r 01d36da2cbd7 audio/ncspot/options.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/audio/ncspot/options.mk Tue Oct 20 18:40:31 2020 +0000
@@ -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 -r fe20f2a02c51 -r 01d36da2cbd7 audio/ncspot/patches/patch-Cargo.toml
--- a/audio/ncspot/patches/patch-Cargo.toml Tue Oct 20 18:37:36 2020 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -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"]
Home |
Main Index |
Thread Index |
Old Index