Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Nov 2021 10:33:24 GMT
From:      Alexey Dokuchaev <danfe@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 46f126d48beb - main - benchmarks/linux-unigine-{heaven,valley}: the ports had been improved (+)
Message-ID:  <202111221033.1AMAXOf9084886@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by danfe:

URL: https://cgit.FreeBSD.org/ports/commit/?id=46f126d48beb5b3588105ed9371b63653ba81637

commit 46f126d48beb5b3588105ed9371b63653ba81637
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2021-11-22 10:31:58 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2021-11-22 10:31:59 +0000

    benchmarks/linux-unigine-{heaven,valley}: the ports had been improved (+)
    
    - Add missing dependency for playing music: USE_LINUX+=openal-soft
    - In the `do-extract', rather than changing current directory, pass it to
      tar(1) as a -C argument and don't needlessly use semi-private _DISTDIR
      variable: this makes the command shorter and avoids bogus double slash
      in the build log
    - Provide more user-friendly wrapper script which anticipates potential
      problems that typically affect running this program and advises on how
      to solve them
    - Spell GNU/Linux correctly in the COMMENT and port description; reformat
      the latter with `fmt -w 75' for better looks (less ragged right edge)
---
 benchmarks/linux-unigine-heaven/Makefile           | 14 +++++++-------
 .../linux-unigine-heaven/files/wrapper.sh.in       | 22 ++++++++++++++++++++++
 benchmarks/linux-unigine-heaven/pkg-descr          | 20 ++++++++++----------
 benchmarks/linux-unigine-valley/Makefile           | 14 +++++++-------
 .../linux-unigine-valley/files/wrapper.sh.in       | 22 ++++++++++++++++++++++
 benchmarks/linux-unigine-valley/pkg-descr          | 17 ++++++++---------
 6 files changed, 76 insertions(+), 33 deletions(-)

diff --git a/benchmarks/linux-unigine-heaven/Makefile b/benchmarks/linux-unigine-heaven/Makefile
index b46236bd1ddc..79053df8409b 100644
--- a/benchmarks/linux-unigine-heaven/Makefile
+++ b/benchmarks/linux-unigine-heaven/Makefile
@@ -2,7 +2,7 @@
 
 PORTNAME=	unigine-heaven
 PORTVERSION=	4.0
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	benchmarks linux
 MASTER_SITES=	https://assets.unigine.com/d/
 PKGNAMEPREFIX=	linux-
@@ -10,7 +10,7 @@ DISTNAME=	Unigine_Heaven-${PORTVERSION}
 EXTRACT_SUFX=	.run
 
 MAINTAINER=	h2+fbsdports@fsfe.org
-COMMENT=	Unigine Heaven Benchmark, basic version, linux binaries
+COMMENT=	Unigine Heaven benchmark (basic version for GNU/Linux)
 
 LICENSE=	Proprietary
 LICENSE_NAME=	Unigine "Basic" License
@@ -19,24 +19,24 @@ LICENSE_PERMS=	no-dist-sell no-pkg-sell no-dist-mirror no-pkg-mirror
 
 ONLY_FOR_ARCHS=	amd64 i386
 USES=		linux shebangfix
-USE_LINUX=	dri xorglibs
+USE_LINUX=	dri openal-soft xorglibs
 USE_LDCONFIG=	yes
 NO_BUILD=	yes
 
 SHEBANG_FILES=	heaven
 bash_CMD=	${LINUXBASE}/bin/bash
+SUB_FILES=	wrapper.sh
 
 DESKTOP_ENTRIES="Unigine Heaven" "${COMMENT}" "${DATADIR}/data/launcher/icon.png" \
 		"${PKGNAMEPREFIX}${PORTNAME}" "Game;" false
 
 do-extract:
 	@${MKDIR} ${WRKSRC}
-	cd ${WRKSRC} && ${TAIL} -n 1097642 ${_DISTDIR}/${DISTFILES} | ${TAR} zxf -
-	${PRINTF} '#!/bin/sh\ncd ${DATADIR}\nexec\
-		${LINUXBASE}/bin/bash ./heaven\n' > ${WRKDIR}/${PORTNAME}
+	@${TAIL} -n 1097642 ${DISTDIR}/${DISTFILES} | ${TAR} xzf - -C ${WRKSRC}
 
 do-install:
-	${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/${PKGNAMEPREFIX}${PORTNAME}
+	${INSTALL_SCRIPT} ${WRKDIR}/wrapper.sh \
+		${STAGEDIR}${PREFIX}/bin/${PKGNAMEPREFIX}${PORTNAME}
 	cd ${WRKSRC} && ${COPYTREE_SHARE} ./data ${STAGEDIR}${DATADIR}
 	cd ${WRKSRC} && ${COPYTREE_SHARE} ./bin ${STAGEDIR}${DATADIR}
 	cd ${WRKSRC} && ${COPYTREE_SHARE} ./documentation ${STAGEDIR}${DATADIR}
diff --git a/benchmarks/linux-unigine-heaven/files/wrapper.sh.in b/benchmarks/linux-unigine-heaven/files/wrapper.sh.in
new file mode 100644
index 000000000000..b1dd04ee3293
--- /dev/null
+++ b/benchmarks/linux-unigine-heaven/files/wrapper.sh.in
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+LNX_ROOT=$(sysctl -n compat.linux.emul_path)
+
+if [ ! -f "$LNX_ROOT/proc/self/exe" -o ! -d "$LNX_ROOT/sys/dev/char" ]
+then
+	echo "This program requires mounted linprocfs(5) and linsysfs(5)" >&2
+	exit 1
+fi
+
+# OpenAL Soft uses PulseAudio by default, which might not work on FreeBSD
+
+ALSOFT_CONF=$LNX_ROOT/etc/openal/alsoft.conf
+
+if ! grep -qs '^drivers[[:blank:]]*=[[:blank:]]*oss' "$ALSOFT_CONF"
+then
+	echo "If there's no sound, try putting \`oss' as the first item" \
+	"on the \`drivers' line in the $ALSOFT_CONF file." | fmt -76 >&2
+	sleep 2
+fi
+
+cd %%DATADIR%% && exec $LNX_ROOT/bin/bash ./heaven
diff --git a/benchmarks/linux-unigine-heaven/pkg-descr b/benchmarks/linux-unigine-heaven/pkg-descr
index 93eb6d0cbb3f..ad042da2d3c0 100644
--- a/benchmarks/linux-unigine-heaven/pkg-descr
+++ b/benchmarks/linux-unigine-heaven/pkg-descr
@@ -1,14 +1,14 @@
-Heaven Benchmark immerses a user into a magical steampunk world of
-shiny brass, wood and gears. Nested on flying islands, a tiny village
-with its cozy, sun-heated cobblestone streets, an elaborately crafted
-dirigible above the expanse of fluffy clouds, and a majestic dragon
-on the central square gives a true sense of adventure. An interactive
-experience with fly-by and walk-through modes allows for exploring
-all corners of this world powered by the cutting-edge UNIGINE Engine
-that leverages the most advanced capabilities of graphics APIs and
-turns this benchmark into a visual masterpiece.
+Heaven Benchmark immerses a user into a magical steampunk world of shiny
+brass, wood and gears.  Nested on flying islands, a tiny village with its
+cozy, sun-heated cobblestone streets, an elaborately crafted dirigible
+above the expanse of fluffy clouds, and a majestic dragon on the central
+square gives a true sense of adventure.  An interactive experience with
+fly-by and walk-through modes allows for exploring all corners of this
+world powered by the cutting-edge UNIGINE Engine that leverages the most
+advanced capabilities of graphics APIs and turns this benchmark into a
+visual masterpiece.
 
-This port includes the linux-binaries of the basic (free-to-use)
+This port includes the binaries for GNU/Linux of the basic (free-to-use)
 version of the benchmark.
 
 WWW: https://benchmark.unigine.com/heaven
diff --git a/benchmarks/linux-unigine-valley/Makefile b/benchmarks/linux-unigine-valley/Makefile
index 0446d215c567..9750dc3d2a80 100644
--- a/benchmarks/linux-unigine-valley/Makefile
+++ b/benchmarks/linux-unigine-valley/Makefile
@@ -2,7 +2,7 @@
 
 PORTNAME=	unigine-valley
 PORTVERSION=	1.0
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	benchmarks linux
 MASTER_SITES=	https://assets.unigine.com/d/
 PKGNAMEPREFIX=	linux-
@@ -10,7 +10,7 @@ DISTNAME=	Unigine_Valley-${PORTVERSION}
 EXTRACT_SUFX=	.run
 
 MAINTAINER=	h2+fbsdports@fsfe.org
-COMMENT=	Unigine Valley Benchmark, basic version, linux binaries
+COMMENT=	Unigine Valley benchmark (basic version for GNU/Linux)
 
 LICENSE=	Proprietary
 LICENSE_NAME=	Unigine "Basic" License
@@ -19,24 +19,24 @@ LICENSE_PERMS=	no-dist-sell no-pkg-sell no-dist-mirror no-pkg-mirror
 
 ONLY_FOR_ARCHS=	amd64 i386
 USES=		linux shebangfix
-USE_LINUX=	dri xorglibs
+USE_LINUX=	dri openal-soft xorglibs
 USE_LDCONFIG=	yes
 NO_BUILD=	yes
 
 SHEBANG_FILES=	valley
 bash_CMD=	${LINUXBASE}/bin/bash
+SUB_FILES=	wrapper.sh
 
 DESKTOP_ENTRIES="Unigine Valley" "${COMMENT}" "${DATADIR}/data/launcher/icon.png" \
 		"${PKGNAMEPREFIX}${PORTNAME}" "Game;" false
 
 do-extract:
 	@${MKDIR} ${WRKSRC}
-	cd ${WRKSRC} && ${TAIL} -n 1491255 ${_DISTDIR}/${DISTFILES} | ${TAR} zxf -
-	${PRINTF} '#!/bin/sh\ncd ${DATADIR}\nexec\
-		${LINUXBASE}/bin/bash ./valley\n' > ${WRKDIR}/${PORTNAME}
+	@${TAIL} -n 1491255 ${DISTDIR}/${DISTFILES} | ${TAR} xzf - -C ${WRKSRC}
 
 do-install:
-	${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/${PKGNAMEPREFIX}${PORTNAME}
+	${INSTALL_SCRIPT} ${WRKDIR}/wrapper.sh \
+		${STAGEDIR}${PREFIX}/bin/${PKGNAMEPREFIX}${PORTNAME}
 	cd ${WRKSRC} && ${COPYTREE_SHARE} ./data ${STAGEDIR}${DATADIR}
 	cd ${WRKSRC} && ${COPYTREE_SHARE} ./bin ${STAGEDIR}${DATADIR}
 	cd ${WRKSRC} && ${COPYTREE_SHARE} ./documentation ${STAGEDIR}${DATADIR}
diff --git a/benchmarks/linux-unigine-valley/files/wrapper.sh.in b/benchmarks/linux-unigine-valley/files/wrapper.sh.in
new file mode 100644
index 000000000000..d1c2b28d1b66
--- /dev/null
+++ b/benchmarks/linux-unigine-valley/files/wrapper.sh.in
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+LNX_ROOT=$(sysctl -n compat.linux.emul_path)
+
+if [ ! -f "$LNX_ROOT/proc/self/exe" -o ! -d "$LNX_ROOT/sys/dev/char" ]
+then
+	echo "This program requires mounted linprocfs(5) and linsysfs(5)" >&2
+	exit 1
+fi
+
+# OpenAL Soft uses PulseAudio by default, which might not work on FreeBSD
+
+ALSOFT_CONF=$LNX_ROOT/etc/openal/alsoft.conf
+
+if ! grep -qs '^drivers[[:blank:]]*=[[:blank:]]*oss' "$ALSOFT_CONF"
+then
+	echo "If there's no sound, try putting \`oss' as the first item" \
+	"on the \`drivers' line in the $ALSOFT_CONF file." | fmt -76 >&2
+	sleep 2
+fi
+
+cd %%DATADIR%% && exec $LNX_ROOT/bin/bash ./valley
diff --git a/benchmarks/linux-unigine-valley/pkg-descr b/benchmarks/linux-unigine-valley/pkg-descr
index 5fc19ae592c7..83204b61024b 100644
--- a/benchmarks/linux-unigine-valley/pkg-descr
+++ b/benchmarks/linux-unigine-valley/pkg-descr
@@ -1,13 +1,12 @@
-Valley Benchmark is a new GPU stress-testing tool from the developers
-of the very popular and highly acclaimed Heaven Benchmark. The
-forest-covered valley surrounded by vast mountains amazes with its
-scale from a bird's-eye view and is extremely detailed down to every
-leaf and flower petal. This non-synthetic benchmark powered by the
-state-of-the art UNIGINE Engine showcases a comprehensive set of
-cutting-edge graphics technologies with a dynamic environment and
-fully interactive modes available to the end user.
+Valley Benchmark is a new GPU stress-testing tool from the developers of
+the very popular and highly acclaimed Heaven Benchmark.  The forest-covered
+valley surrounded by vast mountains amazes with its scale from a bird's-eye
+view and is extremely detailed down to every leaf and flower petal.  This
+non-synthetic benchmark powered by the state-of-the art UNIGINE Engine
+showcases a comprehensive set of cutting-edge graphics technologies with a
+dynamic environment and fully interactive modes available to the end user.
 
-This port includes the linux-binaries of the basic (free-to-use)
+This port includes the binaries for GNU/Linux of the basic (free-to-use)
 version of the benchmark.
 
 WWW: https://benchmark.unigine.com/valley



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202111221033.1AMAXOf9084886>