Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Aug 2020 11:20:18 +0000 (UTC)
From:      Alexey Dokuchaev <danfe@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r546066 - in head/benchmarks: . mangohud mangohud/files
Message-ID:  <202008241120.07OBKIMs078323@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: danfe
Date: Mon Aug 24 11:20:18 2020
New Revision: 546066
URL: https://svnweb.freebsd.org/changeset/ports/546066

Log:
  MangoHud is a Vulkan/OpenGL overlay for monitoring FPS, temperatures,
  CPU/GPU load, and more.
  
  WWW: https://github.com/flightlessmango/MangoHud

Added:
  head/benchmarks/mangohud/
  head/benchmarks/mangohud/Makefile   (contents, props changed)
  head/benchmarks/mangohud/distinfo   (contents, props changed)
  head/benchmarks/mangohud/files/
  head/benchmarks/mangohud/files/patch-include_elfhacks.h   (contents, props changed)
  head/benchmarks/mangohud/files/patch-meson.build   (contents, props changed)
  head/benchmarks/mangohud/files/patch-src_elfhacks.cpp   (contents, props changed)
  head/benchmarks/mangohud/files/patch-src_meson.build   (contents, props changed)
  head/benchmarks/mangohud/pkg-descr   (contents, props changed)
Modified:
  head/benchmarks/Makefile

Modified: head/benchmarks/Makefile
==============================================================================
--- head/benchmarks/Makefile	Mon Aug 24 11:17:19 2020	(r546065)
+++ head/benchmarks/Makefile	Mon Aug 24 11:20:18 2020	(r546066)
@@ -41,6 +41,7 @@
     SUBDIR += linux-vdbench
     SUBDIR += lmbench
     SUBDIR += lzbench
+    SUBDIR += mangohud
     SUBDIR += mdtest
     SUBDIR += nbench
     SUBDIR += netio

Added: head/benchmarks/mangohud/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/benchmarks/mangohud/Makefile	Mon Aug 24 11:20:18 2020	(r546066)
@@ -0,0 +1,47 @@
+# Created by: Alexey Dokuchaev <danfe@FreeBSD.org>
+# $FreeBSD$
+
+PORTNAME=	mangohud
+PORTVERSION=	0.5.1
+DISTVERSIONPREFIX=	v
+CATEGORIES=	benchmarks graphics
+
+MAINTAINER=	danfe@FreeBSD.org
+COMMENT=	Vulkan/OpenGL overlay for CPU/GPU monitoring
+
+LICENSE=	MIT
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+BUILD_DEPENDS=	glslangValidator:devel/glslang \
+		${LOCALBASE}/share/vulkan/registry/vk.xml:devel/vulkan-headers \
+		${PYTHON_PKGNAMEPREFIX}mako>=0:textproc/py-mako@${PY_FLAVOR}
+LIB_DEPENDS=	libdbus-1.so:devel/dbus \
+		libinotify.so:devel/libinotify
+
+USES=		compiler:c++14-lang meson pkgconfig python:build xorg
+USE_GITHUB=	yes
+GH_ACCOUNT=	flightlessmango
+GH_PROJECT=	MangoHud
+USE_XORG=	x11
+MESON_ARGS=	-Duse_system_vulkan=enabled -Dwith_xnvctrl=disabled
+
+PLIST_FILES=	bin/mangohud lib/mangohud/libMangoHud.so \
+		lib/mangohud/libMangoHud_dlsym.so man/man1/mangohud.1.gz \
+		share/vulkan/implicit_layer.d/MangoHud.json
+PORTEXAMPLES=	MangoHud.conf.example
+
+OPTIONS_DEFINE=	EXAMPLES
+
+post-patch:
+	@${REINPLACE_CMD} -e '/version : /s,0\.4\.0,${PORTVERSION}, ; \
+		/^prog_python = /s,3,${PYTHON_VER},' ${WRKSRC}/meson.build
+	@${REINPLACE_CMD} -e '1s,usr/bin/env ba,bin/,' \
+		${WRKSRC}/bin/mangohud.in
+	@${REINPLACE_CMD} -e 's,/usr/share/doc,${PREFIX}/share/examples,' \
+		${WRKSRC}/data/mangohud.1
+	@${REINPLACE_CMD} -e '/#include <sys\/sysinfo\.h>/d' \
+		${WRKSRC}/src/overlay_params.cpp
+	@${REINPLACE_CMD} -e 's,libdl\.so,ld-elf.so,' \
+		${WRKSRC}/src/real_dlsym.cpp
+
+.include <bsd.port.mk>

Added: head/benchmarks/mangohud/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/benchmarks/mangohud/distinfo	Mon Aug 24 11:20:18 2020	(r546066)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1597596860
+SHA256 (flightlessmango-MangoHud-v0.5.1_GH0.tar.gz) = 3e91d4fc7369d46763894c13f3315133871dd02705072981770c3cf58e8081c6
+SIZE (flightlessmango-MangoHud-v0.5.1_GH0.tar.gz) = 15042595

Added: head/benchmarks/mangohud/files/patch-include_elfhacks.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/benchmarks/mangohud/files/patch-include_elfhacks.h	Mon Aug 24 11:20:18 2020	(r546066)
@@ -0,0 +1,19 @@
+--- include/elfhacks.h.orig	2020-08-16 16:54:20 UTC
++++ include/elfhacks.h
+@@ -58,6 +58,16 @@ extern "C" {
+ # endif
+ #endif
+ 
++#ifndef __ELF_NATIVE_CLASS
++#define __ELF_NATIVE_CLASS __WORDSIZE
++#endif
++
++/* We use this macro to refer to ELF types independent of the native wordsize.
++   `ElfW(TYPE)' is used in place of `Elf32_TYPE' or `Elf64_TYPE'.  */
++#define ElfW(type)	_ElfW (Elf, __ELF_NATIVE_CLASS, type)
++#define _ElfW(e,w,t)	_ElfW_1 (e, w, _##t)
++#define _ElfW_1(e,w,t)	e##w##t
++
+ /**
+  *  \defgroup elfhacks elfhacks
+  *  Elfhacks is a collection of functions that aim for retvieving

Added: head/benchmarks/mangohud/files/patch-meson.build
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/benchmarks/mangohud/files/patch-meson.build	Mon Aug 24 11:20:18 2020	(r546066)
@@ -0,0 +1,20 @@
+--- meson.build.orig	2020-08-16 16:54:20 UTC
++++ meson.build
+@@ -98,7 +98,7 @@ inc_common = [
+     include_directories('include'),
+ ]
+ 
+-dep_vulkan = dependency('vulkan', required: get_option('use_system_vulkan'))
++dep_inotify = dependency('libinotify')
+ dep_pthread = dependency('threads')
+ dbus_dep = dependency('dbus-1', required: get_option('with_dbus')).partial_dependency(compile_args : true, includes : true)
+ 
+@@ -170,7 +170,7 @@ else
+   dep_rt = cc.find_library('rt')
+ endif
+ 
+-if dep_vulkan.found()
++if true
+   datadir = get_option('datadir')
+   if not datadir.startswith('/')
+     datadir = get_option('prefix') / datadir

Added: head/benchmarks/mangohud/files/patch-src_elfhacks.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/benchmarks/mangohud/files/patch-src_elfhacks.cpp	Mon Aug 24 11:20:18 2020	(r546066)
@@ -0,0 +1,29 @@
+--- src/elfhacks.cpp.orig	2020-08-16 16:54:20 UTC
++++ src/elfhacks.cpp
+@@ -195,22 +195,22 @@ int eh_init_obj(eh_obj_t *obj)
+ 			if (obj->strtab)
+ 				return ENOTSUP;
+ 
+-			obj->strtab = (const char *) obj->dynamic[p].d_un.d_ptr;
++			obj->strtab = (const char *) (obj->dynamic[p].d_un.d_ptr + obj->addr);
+ 		} else if (obj->dynamic[p].d_tag == DT_HASH) {
+ 			if (obj->hash)
+ 				return ENOTSUP;
+ 
+-			obj->hash = (ElfW(Word) *) obj->dynamic[p].d_un.d_ptr;
++			obj->hash = (ElfW(Word) *) (obj->dynamic[p].d_un.d_ptr + obj->addr);
+ 		} else if (obj->dynamic[p].d_tag == DT_GNU_HASH) {
+ 			if (obj->gnu_hash)
+ 				return ENOTSUP;
+ 
+-			obj->gnu_hash = (Elf32_Word *) obj->dynamic[p].d_un.d_ptr;
++			obj->gnu_hash = (Elf32_Word *) (obj->dynamic[p].d_un.d_ptr + obj->addr);
+ 		} else if (obj->dynamic[p].d_tag == DT_SYMTAB) {
+ 			if (obj->symtab)
+ 				return ENOTSUP;
+ 
+-			obj->symtab = (ElfW(Sym) *) obj->dynamic[p].d_un.d_ptr;
++			obj->symtab = (ElfW(Sym) *) (obj->dynamic[p].d_un.d_ptr + obj->addr);
+ 		}
+ 		p++;
+ 	}

Added: head/benchmarks/mangohud/files/patch-src_meson.build
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/benchmarks/mangohud/files/patch-src_meson.build	Mon Aug 24 11:20:18 2020	(r546066)
@@ -0,0 +1,29 @@
+--- src/meson.build.orig	2020-08-16 16:54:20 UTC
++++ src/meson.build
+@@ -3,7 +3,7 @@ glslang = find_program('glslangValidator')
+ # Needs prefix for configure_file()
+ if get_option('append_libdir_mangohud')
+   libdir_mangohud = join_paths(get_option('libdir'), 'mangohud')
+-  ld_libdir_mangohud = get_option('prefix') + '/\$LIB/mangohud/'
++  ld_libdir_mangohud = get_option('prefix') + '/lib/mangohud/'
+ else
+   libdir_mangohud = get_option('libdir')
+   ld_libdir_mangohud = get_option('prefix') + '/\$LIB/'
+@@ -141,7 +141,7 @@ vklayer_mesa_overlay = shared_library(
+     dep_dl,
+     dep_rt,
+     dep_pthread,
+-    dep_vulkan],
++    dep_inotify],
+   include_directories : [inc_common],
+   link_args : link_args,
+   install_dir : libdir_mangohud,
+@@ -187,7 +187,7 @@ configure_file(input : '../bin/mangohud.in',
+ if get_option('include_doc')
+   install_data(
+     files('../bin/MangoHud.conf'),
+-    install_dir : join_paths(get_option('datadir'), 'doc', 'mangohud'),
++    install_dir : join_paths(get_option('datadir'), 'examples', 'mangohud'),
+     rename : ['MangoHud.conf.example']
+   )
+ endif

Added: head/benchmarks/mangohud/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/benchmarks/mangohud/pkg-descr	Mon Aug 24 11:20:18 2020	(r546066)
@@ -0,0 +1,4 @@
+MangoHud is a Vulkan/OpenGL overlay for monitoring FPS, temperatures,
+CPU/GPU load, and more.
+
+WWW: https://github.com/flightlessmango/MangoHud



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