pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

jibri: build the package in offline mode



Module Name:	pkgsrc-wip
Committed By:	Pierre Pronchery <khorben%defora.org@localhost>
Pushed By:	khorben
Date:		Tue Jan 3 12:10:41 2023 +0100
Changeset:	396b1ab8b7eed14ed3cf8238965752acb2f2bb36

Modified Files:
	jibri/Makefile
	jibri/PLIST
	jibri/distinfo
Added Files:
	jibri/patches/patch-pom.xml

Log Message:
jibri: build the package in offline mode

While there:

* register the package version with maven when building
* add a rule to generate the dependencies archive
* let the build proceed with warnings

This paves the way for jibri to be included in pkgsrc proper.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=396b1ab8b7eed14ed3cf8238965752acb2f2bb36

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 jibri/Makefile              | 64 +++++++++++++++++++++++++--------------------
 jibri/PLIST                 |  1 -
 jibri/distinfo              |  4 +++
 jibri/patches/patch-pom.xml | 14 ++++++++++
 4 files changed, 54 insertions(+), 29 deletions(-)

diffs:
diff --git a/jibri/Makefile b/jibri/Makefile
index 0b92def5a2..9f639c46f5 100644
--- a/jibri/Makefile
+++ b/jibri/Makefile
@@ -13,13 +13,37 @@ HOMEPAGE=	https://github.com/jitsi/jibri/
 COMMENT=	Jitsi BRoadcasting Infrastructure
 LICENSE=	apache-2.0
 
-WRKSRC=		${WRKDIR}/jibri-8.0
+DISTFILES=	${DEFAULT_DISTFILES}
+DISTFILES+=	jibri-java-deps-${PKGVERSION_NOREV}.tar.gz
+SITES.jibri-java-deps-${PKGVERSION_NOREV}.tar.gz= \
+		ftp://ftp.NetBSD.org/pub/NetBSD/misc/khorben/
+
+WRKSRC=		${WRKDIR}/jibri-${PKGVERSION_NOREV}
+
+USE_TOOLS+=	bash:run pax:build
 
-USE_TOOLS=	bash:run
 USE_JAVA2=	8
 
+TOOL_DEPENDS+=	apache-maven-[0-9]*:../../devel/apache-maven
+
+MAVEN_FLAGS+=	-Duser.home=${FAKEHOMEDIR}
+MAVEN_FLAGS+=	-Dmaven.repo.local=${WRKDIR}/deps
+MAVEN_FLAGS+=	--offline
+MAVEN_FLAGS+=	-DskipTests
+MVN=		mvn ${MAVEN_FLAGS}
+
 REPLACE_BASH=	resources/debian-package/opt/jitsi/jibri/launch.sh
 
+EGDIR=			share/examples/jibri
+PKG_SYSCONFSUBDIR=	jitsi/jibri
+CONF_FILES=		${EGDIR}/asoundrc ${PKG_SYSCONFDIR}/asoundrc
+CONF_FILES+=		${EGDIR}/config.json \
+			${PKG_SYSCONFDIR}/config.json
+CONF_FILES+=		${EGDIR}/logging.properties \
+			${PKG_SYSCONFDIR}/logging.properties
+CONF_FILES+=		${EGDIR}/xorg-video-dummy.conf \
+			${PKG_SYSCONFDIR}/xorg-video-dummy.conf
+
 SUBST_CLASSES+=		launch
 SUBST_STAGE.launch=	post-configure
 SUBST_FILES.launch=	resources/debian-package/opt/jitsi/jibri/launch.sh
@@ -27,38 +51,22 @@ SUBST_SED.launch=	-e 's,^exec java,exec ${JAVA_BINPREFIX}-java,'
 SUBST_SED.launch+=	-e 's,=/etc/,=${PKG_SYSCONFDIR}/,'
 SUBST_SED.launch+=	-e 's,=/opt/jitsi/jibri/,=${PREFIX}/share/jibri/,g'
 
-TOOL_DEPENDS+=		apache-maven-[0-9]*:../../devel/apache-maven
-
-MAVEN_FLAGS+=		-DskipTests
-MAVEN_FLAGS+=		-Djavax.net.ssl.trustStore=${WRKDIR}/keystore
-MAVEN_FLAGS+=		-Djavax.net.ssl.trustStorePassword=password
-
-EGDIR=			share/examples/jibri
-CONF_FILES=		${EGDIR}/asoundrc ${PKG_SYSCONFDIR}/jitsi/jibri/asoundrc
-CONF_FILES+=		${EGDIR}/config.json \
-			${PKG_SYSCONFDIR}/jitsi/jibri/config.json
-CONF_FILES+=		${EGDIR}/logging.properties \
-			${PKG_SYSCONFDIR}/jitsi/jibri/logging.properties
-CONF_FILES+=		${EGDIR}/xorg-video-dummy.conf \
-			${PKG_SYSCONFDIR}/jitsi/jibri/xorg-video-dummy.conf
-
 INSTALLATION_DIRS+=	bin
 INSTALLATION_DIRS+=	${EGDIR}
 INSTALLATION_DIRS+=	share/jibri
 
+.PHONY: create-deps-file
+create-deps-file: build
+	#XXX disable offline mode for maven before using this rule
+	cd ${WRKSRC} && ${MVN} validate
+	cd ${WRKDIR} && \
+		${PAX} -wz -f jibri-java-deps-${PKGVERSION_NOREV}.tar.gz deps
+
 do-configure:
-	#XXX this assumes trusted CA certificates are in /etc/openssl/certs
-	cd ${WRKSRC} && \
-		for cert in /etc/openssl/certs/*.0; do \
-			/usr/pkg/java/openjdk11/bin/keytool -importcert \
-					-keystore ${WRKDIR}/keystore \
-					-noprompt -trustcacerts \
-					-storepass password -file "$$cert" \
-					-alias $$(basename "$$cert"); done
+	cd ${WRKSRC} && ${MVN} versions:set -DnewVersion="${PKGVERSION_NOREV}"
 
 do-build:
-	cd ${WRKSRC} && \
-		mvn package ${MAVEN_FLAGS}
+	cd ${WRKSRC} && ${MVN} package
 
 do-install:
 	${INSTALL_DATA} ${WRKSRC}/lib/logging.properties \
@@ -71,7 +79,7 @@ do-install:
 		${DESTDIR}${PREFIX}/${EGDIR}/xorg-video-dummy.conf
 	${INSTALL_SCRIPT} ${WRKSRC}/resources/debian-package/opt/jitsi/jibri/launch.sh \
 		${DESTDIR}${PREFIX}/bin/jibri
-	${INSTALL_DATA} ${WRKSRC}/target/jibri-8.0-SNAPSHOT-jar-with-dependencies.jar \
+	${INSTALL_DATA} ${WRKSRC}/target/jibri-${PKGVERSION_NOREV}-jar-with-dependencies.jar \
 		${DESTDIR}${PREFIX}/share/jibri/jibri.jar
 
 .include "../../mk/java-vm.mk"
diff --git a/jibri/PLIST b/jibri/PLIST
index 9f2c09cd61..1dcadf515b 100644
--- a/jibri/PLIST
+++ b/jibri/PLIST
@@ -5,4 +5,3 @@ share/examples/jibri/config.json
 share/examples/jibri/logging.properties
 share/examples/jibri/xorg-video-dummy.conf
 share/jibri/jibri.jar
-@pkgdir etc/jitsi/jibri
diff --git a/jibri/distinfo b/jibri/distinfo
index 8540813f45..eb9038c09f 100644
--- a/jibri/distinfo
+++ b/jibri/distinfo
@@ -1,5 +1,9 @@
 $NetBSD$
 
+BLAKE2s (jibri/jibri-java-deps-8.0.tar.gz) = dd1b9f232b459294da0423b5bba6885b82decbbb38c97c0f8009936882633aff
+SHA512 (jibri/jibri-java-deps-8.0.tar.gz) = 235f8b2a9b77ccadc618c953b45958ab356c396235e27d3d4b8e9d0fbd68d00d9494d373deb5cf707aff23be49d60745144c37ae0561b12b79b1d4ada8f35b6a
+Size (jibri/jibri-java-deps-8.0.tar.gz) = 199453494 bytes
 BLAKE2s (jibri/v8.0.tar.gz) = 6e8bf591e6e75e14b13ef9c81865d43787866b102576fcc1416b7dbfffb87fd0
 SHA512 (jibri/v8.0.tar.gz) = 5d152c571c4eaaa45c26afe049daf1018d7bc650c0b663686c8869d7e371098824c9e63e013a3d84344f64beeb5d70c70fcd5997ddb29eea55e97cd1b706aef6
 Size (jibri/v8.0.tar.gz) = 74132 bytes
+SHA1 (patch-pom.xml) = 96aeb8fe308018c03ea5af21fe300d222efe9841
diff --git a/jibri/patches/patch-pom.xml b/jibri/patches/patch-pom.xml
new file mode 100644
index 0000000000..8aa3a75c84
--- /dev/null
+++ b/jibri/patches/patch-pom.xml
@@ -0,0 +1,14 @@
+$NetBSD$
+
+Disable -Werror
+
+--- pom.xml.orig	2023-01-03 10:53:43.935539973 +0000
++++ pom.xml
+@@ -215,7 +215,6 @@
+                                 <sourceDir>${project.basedir}/src/main/java</sourceDir>
+                             </sourceDirs>
+                             <args>
+-                                <arg>-Werror</arg>
+                             </args>
+                         </configuration>
+                     </execution>


Home | Main Index | Thread Index | Old Index