From nobody Tue Dec 14 05:16:42 2021 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 15F1718DD672; Tue, 14 Dec 2021 05:16:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JCmnk52rNz4Rjt; Tue, 14 Dec 2021 05:16:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C579221D9; Tue, 14 Dec 2021 05:16:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1BE5GgG6074137; Tue, 14 Dec 2021 05:16:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BE5GgDb074136; Tue, 14 Dec 2021 05:16:42 GMT (envelope-from git) Date: Tue, 14 Dec 2021 05:16:42 GMT Message-Id: <202112140516.1BE5GgDb074136@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Alexey Dokuchaev Subject: git: 9d20c9a6b3e5 - main - benchmarks/mangohud: the port had been updated to version 0.6.5 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: danfe X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9d20c9a6b3e5a561abff0bf131c9025b555bf133 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639459002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HZbn9C5ju5dYG3UyNxY3VQvPTyl2+3+AonIKFhDn0pc=; b=eVz8Hk1csMh3KK4LGfNsdKY/6BpZkv0xZLhQ5urgaOKlA09eWBXvImeeEzZKrKQ+sCKD0V vQCdLZdUjo8uZJELYPWNpPeiAfcfw1SpQeTT1VL3ryfobnvAg9p/F2P/vVu7vu7xX+cuzS ydgQA/czDw5vgeeTr25WnZxU2PJEaTXNp96Fl+59C72E0yOhlyuOJM9YXrNZdI4hXefgA8 gv+nW9U8c85lyw+x5NEh6j3SnKURf08P+c+lgVOIp5viqiDQMj3+haMF6XZDhG/DYODHM+ P6IRJa5n+LgMmhUS1vpfSchbTzEQPr8Qcpo34Vc0EZBaddqDJWR69p+yQGHZeA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639459002; a=rsa-sha256; cv=none; b=Gugwej1VxYGAiOBBaF5zuG3VuGVoZ8YWkcO0MP3BXAvLySkdm1Le4yrUHyBD9+f2w2yvas vJhJ6HuT3sHDGRRvbaBlq8gbEY0hsjEDDBEht/lp+ez680hT8fChxvk8VaIvZWN0Y8d8SC cbU0Liw03uXNYmkgIuXg+pwDFJ5P3mLkm+REoBAq1veNZ0mh59Ak3948cR27zjxiLqsyFt OmbitesbwuUP6UlDEh1JoeAfKx2dmvNPX3l3Y10atPicR7Jr5BEtnSq3Rt/L47UChiNc8L o2Ms6XRyekRthWZ7HG4tRCSK1ByaKTJIAYvC8MxWJRG+4lur7W/vZkEAd5HxPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by danfe: URL: https://cgit.FreeBSD.org/ports/commit/?id=9d20c9a6b3e5a561abff0bf131c9025b555bf133 commit 9d20c9a6b3e5a561abff0bf131c9025b555bf133 Author: Alexey Dokuchaev AuthorDate: 2021-12-14 05:15:24 +0000 Commit: Alexey Dokuchaev CommitDate: 2021-12-14 05:15:24 +0000 benchmarks/mangohud: the port had been updated to version 0.6.5 Now comes with CPU load monitoring enabled by default and better system information report in debug mode. Note that those things currently require mounted linprocfs(5) to work. Reported by: portscout --- benchmarks/mangohud/Makefile | 23 +++---- benchmarks/mangohud/distinfo | 12 ++-- benchmarks/mangohud/files/patch-meson.build | 6 +- .../mangohud/files/patch-src_file__utils.cpp | 28 ++++++++ benchmarks/mangohud/files/patch-src_meson.build | 6 +- benchmarks/mangohud/files/patch-src_vulkan.cpp | 77 ++++++++++++++++++++++ 6 files changed, 130 insertions(+), 22 deletions(-) diff --git a/benchmarks/mangohud/Makefile b/benchmarks/mangohud/Makefile index d2e96215ead9..2be3c8377b8f 100644 --- a/benchmarks/mangohud/Makefile +++ b/benchmarks/mangohud/Makefile @@ -1,12 +1,11 @@ # Created by: Alexey Dokuchaev PORTNAME= mangohud -PORTVERSION= 0.5.1 +PORTVERSION= 0.6.5 DISTVERSIONPREFIX= v CATEGORIES= benchmarks graphics - -PATCH_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/ -PATCHFILES= cec98369ae34d910476b78f98adece96016ab603.diff:-p1 +MASTER_SITES= https://wrapdb.mesonbuild.com/v1/projects/imgui/1.81/1/get_zip?dummy=/:igw +DISTFILES= imgui-1.81-1-wrap.zip:igw MAINTAINER= danfe@FreeBSD.org COMMENT= Vulkan/OpenGL overlay for CPU/GPU monitoring @@ -21,11 +20,15 @@ LIB_DEPENDS= libinotify.so:devel/libinotify USES= compiler:c++14-lang meson pkgconfig python:build xorg USE_GITHUB= yes -GH_ACCOUNT= flightlessmango -GH_PROJECT= MangoHud +GH_ACCOUNT= flightlessmango ocornut:ig +GH_PROJECT= MangoHud imgui:ig +GH_TAGNAME= v1.81:ig +GH_SUBDIR= subprojects/imgui-1.81:ig USE_XORG= x11 MESON_ARGS= -Duse_system_vulkan=enabled -Dwith_xnvctrl=disabled +CPPFLAGS+= -DPROCDIR=\\\"${LINUXBASE}/proc\\\" + 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 @@ -38,15 +41,13 @@ DBUS_LIB_DEPENDS= libdbus-1.so:devel/dbus DBUS_MESON_OFF= -Dwith_dbus=disabled post-patch: - @${REINPLACE_CMD} -e '/version : /s,0\.4\.0,${PORTVERSION}, ; \ + @${REINPLACE_CMD} -e 's,cygwin,${OPSYS:tl}, ; \ /^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 /d' \ - ${WRKSRC}/src/overlay_params.cpp @${REINPLACE_CMD} -e 's,libdl\.so,ld-elf.so,' \ ${WRKSRC}/src/real_dlsym.cpp + @${REINPLACE_CMD} -e 's,def __gnu_linux__,ndef _WIN32,' \ + ${WRKSRC}/src/logging.cpp .include diff --git a/benchmarks/mangohud/distinfo b/benchmarks/mangohud/distinfo index efa987906dde..e5afe5bc6482 100644 --- a/benchmarks/mangohud/distinfo +++ b/benchmarks/mangohud/distinfo @@ -1,5 +1,7 @@ -TIMESTAMP = 1597596860 -SHA256 (flightlessmango-MangoHud-v0.5.1_GH0.tar.gz) = 3e91d4fc7369d46763894c13f3315133871dd02705072981770c3cf58e8081c6 -SIZE (flightlessmango-MangoHud-v0.5.1_GH0.tar.gz) = 15042595 -SHA256 (cec98369ae34d910476b78f98adece96016ab603.diff) = 5af8817cc62bbf441c7a7b735f391bb648e7d90668e7a3746c1b91199698b1d6 -SIZE (cec98369ae34d910476b78f98adece96016ab603.diff) = 551 +TIMESTAMP = 1625725439 +SHA256 (imgui-1.81-1-wrap.zip) = 6d00b442690b6a5c5d8f898311daafbce16d370cf64f53294c3b8c5c661e435f +SIZE (imgui-1.81-1-wrap.zip) = 1850 +SHA256 (flightlessmango-MangoHud-v0.6.5_GH0.tar.gz) = 5e5490407a64275e04dae7b3068cbfcbb522f02c632c872a212b95025a316f72 +SIZE (flightlessmango-MangoHud-v0.6.5_GH0.tar.gz) = 14828281 +SHA256 (ocornut-imgui-v1.81_GH0.tar.gz) = f7c619e03a06c0f25e8f47262dbc32d61fd033d2c91796812bf0f8c94fca78fb +SIZE (ocornut-imgui-v1.81_GH0.tar.gz) = 1413443 diff --git a/benchmarks/mangohud/files/patch-meson.build b/benchmarks/mangohud/files/patch-meson.build index eb9ffcf29134..5068faad2643 100644 --- a/benchmarks/mangohud/files/patch-meson.build +++ b/benchmarks/mangohud/files/patch-meson.build @@ -15,6 +15,6 @@ -if dep_vulkan.found() +if true - datadir = get_option('datadir') - if not datadir.startswith('/') - datadir = get_option('prefix') / datadir + datadir = get_option('vulkan_datadir') + if datadir == '' + datadir = get_option('datadir') diff --git a/benchmarks/mangohud/files/patch-src_file__utils.cpp b/benchmarks/mangohud/files/patch-src_file__utils.cpp new file mode 100644 index 000000000000..4ae32c1fc2b2 --- /dev/null +++ b/benchmarks/mangohud/files/patch-src_file__utils.cpp @@ -0,0 +1,28 @@ +--- src/file_utils.cpp.orig 2021-07-08 06:23:59 UTC ++++ src/file_utils.cpp +@@ -109,7 +109,7 @@ std::string read_symlink(const char * link) + + std::string get_exe_path() + { +- return read_symlink("/proc/self/exe"); ++ return read_symlink(PROCDIR "/self/exe"); + } + + std::string get_wine_exe_name(bool keep_ext) +@@ -119,14 +119,14 @@ std::string get_wine_exe_name(bool keep_ext) + return std::string(); + } + +- std::string line = read_line("/proc/self/comm"); // max 16 characters though ++ std::string line = read_line(PROCDIR "/self/comm"); // max 16 characters though + if (ends_with(line, ".exe", true)) + { + auto dot = keep_ext ? std::string::npos : line.find_last_of('.'); + return line.substr(0, dot); + } + +- std::ifstream cmdline("/proc/self/cmdline"); ++ std::ifstream cmdline(PROCDIR "/self/cmdline"); + // Iterate over arguments (separated by NUL byte). + while (std::getline(cmdline, line, '\0')) { + auto n = std::string::npos; diff --git a/benchmarks/mangohud/files/patch-src_meson.build b/benchmarks/mangohud/files/patch-src_meson.build index 2a87d1c1eef4..9f796c446235 100644 --- a/benchmarks/mangohud/files/patch-src_meson.build +++ b/benchmarks/mangohud/files/patch-src_meson.build @@ -13,11 +13,11 @@ dep_dl, dep_rt, dep_pthread, -- dep_vulkan], -+ dep_inotify], +- dep_vulkan, ++ dep_inotify, + windows_deps], 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( diff --git a/benchmarks/mangohud/files/patch-src_vulkan.cpp b/benchmarks/mangohud/files/patch-src_vulkan.cpp new file mode 100644 index 000000000000..7c8876346f01 --- /dev/null +++ b/benchmarks/mangohud/files/patch-src_vulkan.cpp @@ -0,0 +1,77 @@ +--- src/vulkan.cpp.orig 2021-07-08 06:23:59 UTC ++++ src/vulkan.cpp +@@ -33,7 +33,7 @@ + #include + #include + #include +-#ifdef __gnu_linux__ ++#ifndef _WIN32 + #include + #include + #endif +@@ -464,10 +464,10 @@ struct overlay_draw *get_overlay_draw(struct swapchain + + void init_cpu_stats(overlay_params& params) + { +-#ifdef __gnu_linux__ + auto& enabled = params.enabled; + enabled[OVERLAY_PARAM_ENABLED_cpu_stats] = cpuStats.Init() + && enabled[OVERLAY_PARAM_ENABLED_cpu_stats]; ++#ifdef __gnu_linux__ + enabled[OVERLAY_PARAM_ENABLED_cpu_temp] = cpuStats.GetCpuFile() + && enabled[OVERLAY_PARAM_ENABLED_cpu_temp]; + enabled[OVERLAY_PARAM_ENABLED_cpu_power] = cpuStats.InitCpuPowerData() +@@ -600,21 +600,24 @@ void init_gpu_stats(uint32_t& vendorID, overlay_params + } + + void init_system_info(){ +- #ifdef __gnu_linux__ + const char* ld_preload = getenv("LD_PRELOAD"); + if (ld_preload) + unsetenv("LD_PRELOAD"); + +- ram = exec("cat /proc/meminfo | grep 'MemTotal' | awk '{print $2}'"); ++ ram = exec("grep MemTotal " PROCDIR "/meminfo | awk '{print $2}'"); + trim(ram); +- cpu = exec("cat /proc/cpuinfo | grep 'model name' | tail -n1 | sed 's/^.*: //' | sed 's/([^)]*)/()/g' | tr -d '(/)'"); ++ cpu = exec("grep 'model name' " PROCDIR "/cpuinfo | tail -n1 | sed 's/^.*: //' | sed 's/([^)]*)/()/g' | tr -d '(/)'"); + trim(cpu); + kernel = exec("uname -r"); + trim(kernel); + os = exec("cat /etc/*-release | grep 'PRETTY_NAME' | cut -d '=' -f 2-"); + os.erase(remove(os.begin(), os.end(), '\"' ), os.end()); + trim(os); +- cpusched = read_line("/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"); ++ gpu = exec("pciconf -lv | grep -A2 ^vgapci0 | tail -1 | cut -d\\' -f2"); ++ trim(gpu); ++ driver = exec("glxinfo -B | grep 'OpenGL version' | sed 's/^.*: //'"); ++ trim(driver); ++ cpusched = exec("sysctl -b kern.sched.name"); + + const char* mangohud_recursion = getenv("MANGOHUD_RECURSION"); + if (!mangohud_recursion) { +@@ -669,6 +672,8 @@ void init_system_info(){ + else { + wineVersion = ""; + } ++ ++#ifdef __gnu_linux__ + // check for gamemode and vkbasalt + stringstream ss; + string line; +@@ -686,6 +691,7 @@ void init_system_info(){ + if (HUDElements.gamemode_bol && HUDElements.vkbasalt_bol) + break; + } ++#endif + + if (ld_preload) + setenv("LD_PRELOAD", ld_preload, 1); +@@ -697,7 +703,6 @@ void init_system_info(){ + << "Gpu:" << gpu << "\n" + << "Driver:" << driver << "\n" + << "CPU Scheduler:" << cpusched << std::endl; +-#endif + #endif + } +