From ee246681e9524d40e0779f551379e525ab49baf6 Mon Sep 17 00:00:00 2001
From: Koichiro Iwao
Date: Thu, 16 Aug 2018 01:51:04 +0000
Subject: [PATCH] New port: audio/pulseaudio-module-xrdp: separate PulseAudio
modules from net/xrdp
This update separates PulseAudio modules from net/xrdp port.
There're two reasons to separete them. The one is upstream now provides
them as separated repositories. The another one is PulseAudio modules
need to be rebuilt after the version of audio/pulseaudio changed but
the most part of net/xrdp port doesn't need rebuild. This minimizes
time for rebuilding.
Approved by: hrs (mentor)
Differential Revision: https://reviews.freebsd.org/D16621
---
audio/Makefile | 1 +
audio/pulseaudio-module-xrdp/Makefile | 36 ++++++++++++++++++++++++++
audio/pulseaudio-module-xrdp/distinfo | 3 +++
audio/pulseaudio-module-xrdp/pkg-descr | 3 +++
net/xrdp/Makefile | 30 ++-------------------
net/xrdp/pkg-plist | 2 --
6 files changed, 45 insertions(+), 30 deletions(-)
create mode 100644 audio/pulseaudio-module-xrdp/Makefile
create mode 100644 audio/pulseaudio-module-xrdp/distinfo
create mode 100644 audio/pulseaudio-module-xrdp/pkg-descr
diff --git a/audio/Makefile b/audio/Makefile
index 6b00ccd6f6b5..3e7d676135ad 100644
--- a/audio/Makefile
+++ b/audio/Makefile
@@ -664,6 +664,7 @@
SUBDIR += puddletag
SUBDIR += pulseaudio
SUBDIR += pulseaudio-module-sndio
+ SUBDIR += pulseaudio-module-xrdp
SUBDIR += py-SoundFile
SUBDIR += py-al
SUBDIR += py-ao
diff --git a/audio/pulseaudio-module-xrdp/Makefile b/audio/pulseaudio-module-xrdp/Makefile
new file mode 100644
index 000000000000..647a089d2837
--- /dev/null
+++ b/audio/pulseaudio-module-xrdp/Makefile
@@ -0,0 +1,36 @@
+# $FreeBSD$
+
+PORTNAME= pulseaudio-module-xrdp
+PORTVERSION= 0.0.20180808
+CATEGORIES= audio
+
+MAINTAINER= meta@FreeBSD.org
+COMMENT= PulseAudio module which enables xrdp to use audio redirection
+
+LICENSE= APACHE20
+
+BUILD_DEPENDS= ${NONEXISTENT}:audio/pulseaudio:configure \
+ ${LOCALBASE}/include/xrdp_constants.h:net/xrdp
+LIB_DEPENDS= libpulse.so:audio/pulseaudio
+
+USES= autoreconf:build libtool pkgconfig
+GNU_CONFIGURE= yes
+USE_GITHUB= yes
+GH_ACCOUNT= neutrinolabs
+GH_PROJECT= pulseaudio-module-xrdp
+GH_TAGNAME= 0d80384
+
+PLIST_FILES= `${PULSE_MODDIR}`/module-xrdp-sink.so \
+ `${PULSE_MODDIR}`/module-xrdp-source.so
+
+CONFIGURE_ARGS= PULSE_DIR=${WRKDIR}/pulseaudio-`${PULSE_VERSION}`
+
+PULSE_VERSION= pkg-config --modversion libpulse
+PULSE_MODDIR= pkg-config --variable=modlibexecdir libpulse
+PULSE_WRKSRC= ${MAKE} -C ${PORTSDIR}/audio/pulseaudio -VWRKSRC
+
+pre-configure:
+ @cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} ./bootstrap.sh
+ @${CP} -r "`${PULSE_WRKSRC}`" ${WRKDIR}
+
+.include
diff --git a/audio/pulseaudio-module-xrdp/distinfo b/audio/pulseaudio-module-xrdp/distinfo
new file mode 100644
index 000000000000..2f489b96ce4d
--- /dev/null
+++ b/audio/pulseaudio-module-xrdp/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1533702829
+SHA256 (neutrinolabs-pulseaudio-module-xrdp-0.0.20180808-0d80384_GH0.tar.gz) = 9e3a4c1164c43e87c1f603589afc0134324ae95da138b60ea3c550358f9d3812
+SIZE (neutrinolabs-pulseaudio-module-xrdp-0.0.20180808-0d80384_GH0.tar.gz) = 10267
diff --git a/audio/pulseaudio-module-xrdp/pkg-descr b/audio/pulseaudio-module-xrdp/pkg-descr
new file mode 100644
index 000000000000..c0170cd44f5d
--- /dev/null
+++ b/audio/pulseaudio-module-xrdp/pkg-descr
@@ -0,0 +1,3 @@
+PulseAudio module which enables xrdp to use audio redirection
+
+WWW: https://github.com/neutrinolabs/pulseaudio-module-xrdp
diff --git a/net/xrdp/Makefile b/net/xrdp/Makefile
index ddc58f6556a9..120addd4bbca 100644
--- a/net/xrdp/Makefile
+++ b/net/xrdp/Makefile
@@ -3,6 +3,7 @@
PORTNAME= xrdp
PORTVERSION= 0.9.7
+PORTREVISION= 1
DISTVERSIONPREFIX= v
PORTEPOCH= 1
CATEGORIES= net
@@ -14,9 +15,7 @@ COMMENT= Open source Remote Desktop Protocol (RDP) server
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/COPYING
-# pulseaudio's configured source is required for audio redirection
-BUILD_DEPENDS= ${NONEXISTENT}:audio/pulseaudio:configure \
- ${LOCALBASE}/bin/nasm:devel/nasm
+BUILD_DEPENDS= ${LOCALBASE}/bin/nasm:devel/nasm
RUN_DEPENDS= ${LOCALBASE}/lib/xorg/modules/libxorgxrdp.so:x11-drivers/xorgxrdp
USES= autoreconf:build jpeg localbase libtool pkgconfig ssl
@@ -57,39 +56,14 @@ MP3LAME_LIB_DEPENDS= libmp3lame.so:audio/lame
OPUS_CONFIGURE_ENABLE= opus
OPUS_LIB_DEPENDS= libopus.so:audio/opus
-# don't forget to increase PORTREVISION after pulseaudio update
-PULSE_VERSION= ${MAKE} -C ${PORTSDIR}/audio/pulseaudio -VPORTVERSION
-PULSE_WRKSRC= ${MAKE} -C ${PORTSDIR}/audio/pulseaudio -VWRKSRC
-
post-extract:
# librfxcodec is provided as git submodule
@${CP} -r ${WRKSRC_librfxcodec}/ ${WRKSRC}/librfxcodec/
@${CP} -r ${WRKSRC_libpainter}/ ${WRKSRC}/libpainter/
-post-patch:
- @${REINPLACE_CMD} \
- -e "s|^PULSE_DIR = .*|PULSE_DIR = `${PULSE_WRKSRC}`|" \
- -e "s|-Wall -O2|-Wall -O2 -I${LOCALBASE}/include|" \
- ${WRKSRC}/sesman/chansrv/pulse/Makefile
-
pre-configure:
@cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} ./bootstrap
-post-build:
- # build pulseaudio module
- @${CP} -r "`${PULSE_WRKSRC}`" ${WRKDIR}
- @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} -C sesman/chansrv/pulse
-
-post-install:
- # install pulseaudio module
- ${MKDIR} "${STAGEDIR}${PREFIX}/lib/pulse-`${PULSE_VERSION}`/modules/"
-.for f in module-xrdp-sink.so module-xrdp-source.so
- ${INSTALL_LIB} -m 0755 ${WRKSRC}/sesman/chansrv/pulse/$f \
- "${STAGEDIR}${PREFIX}/lib/pulse-`${PULSE_VERSION}`/modules/"
-.endfor
- # substitute pkg-plist not using PLIST_SUB
- ${REINPLACE_CMD} -e "s|%%PULSE_VERSION%%|`${PULSE_VERSION}`|g" ${TMPPLIST}
-
post-stage:
@${RM} ${STAGEDIR}${PREFIX}/etc/xrdp/rsakeys.ini
@${RM} ${STAGEDIR}${PREFIX}/etc/xrdp/cert.pem
diff --git a/net/xrdp/pkg-plist b/net/xrdp/pkg-plist
index 01b731ddb042..d88ed24f4c8e 100644
--- a/net/xrdp/pkg-plist
+++ b/net/xrdp/pkg-plist
@@ -19,8 +19,6 @@ include/xrdp_client_info.h
include/xrdp_constants.h
include/xrdp_rail.h
include/xrdp_sockets.h
-lib/pulse-%%PULSE_VERSION%%/modules/module-xrdp-sink.so
-lib/pulse-%%PULSE_VERSION%%/modules/module-xrdp-source.so
libdata/pkgconfig/libpainter.pc
libdata/pkgconfig/rfxcodec.pc
libdata/pkgconfig/xrdp.pc