diff --git a/main/mangohud/.checksums b/main/mangohud/.checksums new file mode 100644 index 000000000..21cbb5a1a --- /dev/null +++ b/main/mangohud/.checksums @@ -0,0 +1,4 @@ +a99617f745652a3805c2e3bb5cdc5045 0001-fix-ld_libdir_mangohud.patch +ca4508366736317ce323a27e1bde259a 0002-fix-stat64.patch +2da0ef7b71b3f331da89145097eb4d2f fc925300601098dc45241087626369843d6a2c66.patch +926b264bf14b93ee86d2ff941ac71638 mangohud-0.7.0.tar.xz diff --git a/main/mangohud/.pkgfiles b/main/mangohud/.pkgfiles new file mode 100644 index 000000000..bee673313 --- /dev/null +++ b/main/mangohud/.pkgfiles @@ -0,0 +1,28 @@ +mangohud-0.7.0-1 +drwxr-xr-x root/root usr/ +drwxr-xr-x root/root usr/bin/ +-rwxr-xr-x root/root usr/bin/mangoapp +-rwxr-xr-x root/root usr/bin/mangohud +-rwxr-xr-x root/root usr/bin/mangohudctl +-rwxr-xr-x root/root usr/bin/mangoplot +drwxr-xr-x root/root usr/lib/ +-rwxr-xr-x root/root usr/lib/libMangoApp.so +-rwxr-xr-x root/root usr/lib/libMangoHud.so +-rwxr-xr-x root/root usr/lib/libMangoHud_dlsym.so +-rwxr-xr-x root/root usr/lib/libMangoHud_opengl.so +drwxr-xr-x root/root usr/share/ +drwxr-xr-x root/root usr/share/icons/ +drwxr-xr-x root/root usr/share/icons/hicolor/ +drwxr-xr-x root/root usr/share/icons/hicolor/scalable/ +drwxr-xr-x root/root usr/share/icons/hicolor/scalable/apps/ +-rw-r--r-- root/root usr/share/icons/hicolor/scalable/apps/io.github.flightlessmango.mangohud.svg +drwxr-xr-x root/root usr/share/man/ +drwxr-xr-x root/root usr/share/man/man1/ +-rw-r--r-- root/root usr/share/man/man1/mangoapp.1.gz +-rw-r--r-- root/root usr/share/man/man1/mangohud.1.gz +drwxr-xr-x root/root usr/share/metainfo/ +-rw-r--r-- root/root usr/share/metainfo/io.github.flightlessmango.mangohud.metainfo.xml +drwxr-xr-x root/root usr/share/vulkan/ +drwxr-xr-x root/root usr/share/vulkan/implicit_layer.d/ +-rw-r--r-- root/root usr/share/vulkan/implicit_layer.d/MangoHud.x86_64.json +-rw-r--r-- root/root usr/share/vulkan/implicit_layer.d/libMangoApp.x86_64.json diff --git a/main/mangohud/0001-fix-ld_libdir_mangohud.patch b/main/mangohud/0001-fix-ld_libdir_mangohud.patch new file mode 100644 index 000000000..eee48968b --- /dev/null +++ b/main/mangohud/0001-fix-ld_libdir_mangohud.patch @@ -0,0 +1,277 @@ + + + +0001-fix-ld_libdir_mangohud.patch « mangohud « community - aports - Alpine packages build scripts + + + + + + + + + + +
+ + + + +
+aboutsummaryrefslogtreecommitdiffstats
+ + + +
+
+
path: root/community/mangohud/0001-fix-ld_libdir_mangohud.patch
blob: af1fd233226e05ca55ab9496e2a320c8c1ddcf11 (plain) + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+
Fix ld_libdir_mangohud used by the mangohud shell script to locate the
+libMangoHud.so lib.
+--- a/src/meson.build
++++ b/src/meson.build
+@@ -3,10 +3,10 @@
+ # Needs prefix for configure_file()
+ if get_option('append_libdir_mangohud')
+   libdir_mangohud = join_paths(get_option('prefix'), get_option('libdir'), 'mangohud')
+-  ld_libdir_mangohud = get_option('prefix') + '/\$LIB/mangohud/'
++  ld_libdir_mangohud = join_paths(get_option('prefix'), get_option('libdir'), 'mangohud') + '/'
+ else
+   libdir_mangohud = join_paths(get_option('prefix'), get_option('libdir'))
+-  ld_libdir_mangohud = get_option('prefix') + '/\$LIB/'
++  ld_libdir_mangohud = join_paths(get_option('prefix'), get_option('libdir')) + '/'
+ endif
+ 
+ conf_data = configuration_data()
+
+
+
+ +
+ + diff --git a/main/mangohud/0002-fix-stat64.patch b/main/mangohud/0002-fix-stat64.patch new file mode 100644 index 000000000..8394ab0ff --- /dev/null +++ b/main/mangohud/0002-fix-stat64.patch @@ -0,0 +1,269 @@ + + + +0002-fix-stat64.patch « mangohud « community - aports - Alpine packages build scripts + + + + + + + + + + +
+ + + + +
+aboutsummaryrefslogtreecommitdiffstats
+ + + +
+
+
path: root/community/mangohud/0002-fix-stat64.patch
blob: b898160c7d654c47be920165812ad8795e14dce4 (plain) + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+
stat() is always 64 bit on musl and stat64() has been long deprecated and
+eventually removed as alias for `stat()`.
+--- a/subprojects/spdlog-1.8.5/include/spdlog/details/os-inl.h
++++ b/subprojects/spdlog-1.8.5/include/spdlog/details/os-inl.h
+@@ -231,7 +231,7 @@
+     int fd = ::fileno(f);
+ #endif
+ // 64 bits(but not in osx or cygwin, where fstat64 is deprecated)
+-#if (defined(__linux__) || defined(__sun) || defined(_AIX)) && (defined(__LP64__) || defined(_LP64))
++#if ((defined(__linux__) && defined(__GLIBC__)) || defined(__sun) || defined(_AIX)) && (defined(__LP64__) || defined(_LP64))
+     struct stat64 st;
+     if (::fstat64(fd, &st) == 0)
+     {
+
+
+
+ +
+ + diff --git a/main/mangohud/fc925300601098dc45241087626369843d6a2c66.patch b/main/mangohud/fc925300601098dc45241087626369843d6a2c66.patch new file mode 100644 index 000000000..3862edb83 --- /dev/null +++ b/main/mangohud/fc925300601098dc45241087626369843d6a2c66.patch @@ -0,0 +1,453 @@ + + + +fc925300601098dc45241087626369843d6a2c66.patch « mangohud « community - aports - Alpine packages build scripts + + + + + + + + + + +
+ + + + +
+aboutsummaryrefslogtreecommitdiffstats
+ + + +
+
+
path: root/community/mangohud/fc925300601098dc45241087626369843d6a2c66.patch
blob: ff18578a2cd2e9fb8f8729e11cb168c6605abb38 (plain) + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+
From fc925300601098dc45241087626369843d6a2c66 Mon Sep 17 00:00:00 2001
+From: John Zimmermann <me@johnnynator.dev>
+Date: Thu, 28 Sep 2023 16:42:21 +0200
+Subject: [PATCH] elfhacks: d_un.d_ptr is relative on non glibc systems
+
+elf(5) documents it this way, GLIBC diverts from this documentation
+
+partial fix for #601
+---
+ src/elfhacks.cpp   | 22 ++++++++++++++--------
+ src/real_dlsym.cpp |  1 +
+ 2 files changed, 15 insertions(+), 8 deletions(-)
+
+diff --git a/src/elfhacks.cpp b/src/elfhacks.cpp
+index 7cfc310ee9..810a19d967 100644
+--- a/src/elfhacks.cpp
++++ b/src/elfhacks.cpp
+@@ -29,6 +29,12 @@
+  *  \{
+  */
+ 
++#ifdef __GLIBC__
++# define ABS_ADDR(obj, ptr) (ptr)
++#else
++# define ABS_ADDR(obj, ptr) ((obj->addr) + (ptr))
++#endif
++
+ struct eh_iterate_callback_args {
+ 	eh_iterate_obj_callback_func callback;
+ 	void *arg;
+@@ -196,22 +202,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 *) ABS_ADDR(obj, obj->dynamic[p].d_un.d_ptr);
+ 		} 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) *) ABS_ADDR(obj, obj->dynamic[p].d_un.d_ptr);
+ 		} 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 *) ABS_ADDR(obj, obj->dynamic[p].d_un.d_ptr);
+ 		} 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) *) ABS_ADDR(obj, obj->dynamic[p].d_un.d_ptr);
+ 		}
+ 		p++;
+ 	}
+@@ -449,7 +455,7 @@ int eh_find_next_dyn(eh_obj_t *obj, ElfW_Sword tag, int i, ElfW(Dyn) **next)
+ 
+ int eh_set_rela_plt(eh_obj_t *obj, int p, const char *sym, void *val)
+ {
+-	ElfW(Rela) *rela = (ElfW(Rela) *) obj->dynamic[p].d_un.d_ptr;
++	ElfW(Rela) *rela = (ElfW(Rela) *) ABS_ADDR(obj, obj->dynamic[p].d_un.d_ptr);
+ 	ElfW(Dyn) *relasize;
+ 	unsigned int i;
+ 
+@@ -470,7 +476,7 @@ int eh_set_rela_plt(eh_obj_t *obj, int p, const char *sym, void *val)
+ 
+ int eh_set_rel_plt(eh_obj_t *obj, int p, const char *sym, void *val)
+ {
+-	ElfW(Rel) *rel = (ElfW(Rel) *) obj->dynamic[p].d_un.d_ptr;
++	ElfW(Rel) *rel = (ElfW(Rel) *) ABS_ADDR(obj, obj->dynamic[p].d_un.d_ptr);
+ 	ElfW(Dyn) *relsize;
+ 	unsigned int i;
+ 
+@@ -520,7 +526,7 @@ int eh_set_rel(eh_obj_t *obj, const char *sym, void *val)
+ 
+ int eh_iterate_rela_plt(eh_obj_t *obj, int p, eh_iterate_rel_callback_func callback, void *arg)
+ {
+-	ElfW(Rela) *rela = (ElfW(Rela) *) obj->dynamic[p].d_un.d_ptr;
++	ElfW(Rela) *rela = (ElfW(Rela) *) ABS_ADDR(obj, obj->dynamic[p].d_un.d_ptr);
+ 	ElfW(Dyn) *relasize;
+ 	eh_rel_t rel;
+ 	eh_sym_t sym;
+@@ -550,7 +556,7 @@ int eh_iterate_rela_plt(eh_obj_t *obj, int p, eh_iterate_rel_callback_func callb
+ 
+ int eh_iterate_rel_plt(eh_obj_t *obj, int p, eh_iterate_rel_callback_func callback, void *arg)
+ {
+-	ElfW(Rel) *relp = (ElfW(Rel) *) obj->dynamic[p].d_un.d_ptr;
++	ElfW(Rel) *relp = (ElfW(Rel) *) ABS_ADDR(obj, obj->dynamic[p].d_un.d_ptr);
+ 	ElfW(Dyn) *relsize;
+ 	eh_rel_t rel;
+ 	eh_sym_t sym;
+diff --git a/src/real_dlsym.cpp b/src/real_dlsym.cpp
+index 173dc1be9d..3e5a77c4ed 100644
+--- a/src/real_dlsym.cpp
++++ b/src/real_dlsym.cpp
+@@ -26,6 +26,7 @@ static void get_real_functions()
+ #endif
+         "*libc.so*",
+         "*libc.*.so*",
++        "*ld-musl-*.so*",
+     };
+ 
+     for (size_t i = 0; i < sizeof(libs) / sizeof(*libs); i++)
+
+
+
+ +
+ + diff --git a/main/mangohud/spkgbuild b/main/mangohud/spkgbuild new file mode 100755 index 000000000..e95341113 --- /dev/null +++ b/main/mangohud/spkgbuild @@ -0,0 +1,28 @@ +# description : Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more +# depends : dbus glew glfw glslang libx11 libxrandr mesa meson ninja nlohmann-json python3-mako sdl2 spdlog vulkan-headers vulkan-icd-loader wayland + +name=mangohud +version=0.7.0 +release=1 +source="$name-$version.tar.xz::https://github.com/flightlessmango/MangoHud/releases/download/v$version/MangoHud-v$version-Source.tar.xz + 0001-fix-ld_libdir_mangohud.patch + 0002-fix-stat64.patch + fc925300601098dc45241087626369843d6a2c66.patch" + +build() { + venom-meson MangoHud-v$version build \ + -Dappend_libdir_mangohud=false \ + -Dimgui:glfw=enabled \ + -Dimgui:opengl=enabled \ + -Dimgui:sdl2=enabled \ + -Dimgui:vulkan=enabled \ + -Dmangoapp=true \ + -Dmangoapp_layer=true \ + -Dmangohudctl=true \ + -Dtests=disabled \ + -Dwith_dbus=enabled \ + -Dwith_wayland=enabled \ + -Dwith_xnvctrl=disabled + meson compile -C build + DESTDIR=$PKG meson install --no-rebuild -C build +}