From e6e470d251ce371eda16bd11006b2984e701e079 Mon Sep 17 00:00:00 2001 From: Kevin Mihelich Date: Fri, 8 Feb 2019 03:43:17 +0000 Subject: [PATCH] extra/mesa to 18.3.3-2 --- extra/mesa/PKGBUILD | 7 ++- .../mesa/get-program-name-based-on-path.patch | 58 +++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 extra/mesa/get-program-name-based-on-path.patch diff --git a/extra/mesa/PKGBUILD b/extra/mesa/PKGBUILD index 8c3e14800..4af356b8e 100644 --- a/extra/mesa/PKGBUILD +++ b/extra/mesa/PKGBUILD @@ -9,7 +9,7 @@ pkgbase=mesa pkgname=('libva-mesa-driver' 'mesa-vdpau' 'mesa') pkgdesc="An open-source implementation of the OpenGL specification" pkgver=18.3.3 -pkgrel=1 +pkgrel=2 arch=('x86_64') makedepends=('python-mako' 'libxml2' 'libx11' 'glproto' 'libdrm' 'dri2proto' 'dri3proto' 'presentproto' 'libxshmfence' 'libxxf86vm' 'libxdamage' 'libvdpau' 'libva' 'wayland' 'wayland-protocols' @@ -19,10 +19,12 @@ url="https://www.mesa3d.org/" license=('custom') source=(https://mesa.freedesktop.org/archive/mesa-${pkgver}.tar.xz{,.sig} 0001-Rip-out-VC4-forced-NEON.patch + get-program-name-based-on-path.patch LICENSE) sha512sums=('cd6214b8bbeb3e3d187139ae1e949684f32f90152e1d7ba8d81222bd088770e28cff7ff165f2ccc41c068950561fe952420c6e54472f7204532a8d8700ff18bb' 'SKIP' 'df13eaff1f3a95821221637c56d482945c42faca789e8bc71c36d0526750863aac891afab9d51ce0a912d7eede5b2af7c14a1c36ebd17c1bde945c3e057b773b' + '3c851ec0f1d8c1d918756c5b5315901d2a9c1de22624378bb2ba49ae8d7abc0b6c015a91c455f1d40d50532939f60db81cab0d7c9f832d41162c684582783fa6' 'f9f0d0ccf166fe6cb684478b6f1e1ab1f2850431c06aa041738563eb1808a004e52cdec823c103c9e180f03ffc083e95974d291353f0220fe52ae6d4897fecc7') validpgpkeys=('8703B6700E7EE06D7A39B8D6EDAE37B02CEB490D' # Emil Velikov '946D09B5E4C9845E63075FF1D961C596A7203456' # Andres Gomez @@ -33,6 +35,9 @@ validpgpkeys=('8703B6700E7EE06D7A39B8D6EDAE37B02CEB490D' # Emil Velikov +Date: Tue, 23 Oct 2018 11:38:48 -0400 +Subject: [PATCH] util: Get program name based on path when possible + +Some programs start with the path and command line arguments in +argv[0] (program_invocation_name). Chromium is an example of +an application using mesa that does this. + +This tries to query the real path for the symbolic link /proc/self/exe +to find the program name instead. It only uses the realpath if it +was a prefix of the invocation to avoid breaking wine programs. + +Cc: Timothy Arceri +Signed-off-by: Nicholas Kazlauskas +Reviewed-by: Eric Engestrom +--- + src/util/u_process.c | 23 ++++++++++++++++++++++- + 1 file changed, 22 insertions(+), 1 deletion(-) + +diff --git a/src/util/u_process.c b/src/util/u_process.c +index 5e5927678d8..a1667e78074 100644 +--- a/src/util/u_process.c ++++ b/src/util/u_process.c +@@ -41,8 +41,29 @@ static const char * + __getProgramName() + { + char * arg = strrchr(program_invocation_name, '/'); +- if (arg) ++ if (arg) { ++ /* If the / character was found this is likely a linux path or ++ * an invocation path for a 64-bit wine program. ++ * ++ * However, some programs pass command line arguments into argv[0]. ++ * Strip these arguments out by using the realpath only if it was ++ * a prefix of the invocation name. ++ */ ++ static char *path; ++ ++ if (!path) ++ path = realpath("/proc/self/exe", NULL); ++ ++ if (path && strncmp(path, program_invocation_name, strlen(path)) == 0) { ++ /* This shouldn't be null because path is a a prefix, ++ * but check it anyway since path is static. */ ++ char * name = strrchr(path, '/'); ++ if (name) ++ return name + 1; ++ } ++ + return arg+1; ++ } + + /* If there was no '/' at all we likely have a windows like path from + * a wine application. +-- +2.18.1 +