Skip to content

Commit

Permalink
user/*: patch_style=git
Browse files Browse the repository at this point in the history
  • Loading branch information
nekopsykose committed Oct 4, 2024
1 parent 112c40f commit ac9f6ca
Show file tree
Hide file tree
Showing 36 changed files with 267 additions and 319 deletions.
4 changes: 2 additions & 2 deletions user/android-tools/patches/ppc.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
+#elif defined(__powerpc__)
+#define OPENSSL_32_BIT
#else
// Note BoringSSL only supports standard 32-bit and 64-bit two's-complement,
// little-endian architectures. Functions will not produce the correct answer
// The list above enumerates the platforms that BoringSSL supports. For these
// platforms we keep a reasonable bar of not breaking them: automated test
--- a/vendor/e2fsprogs/contrib/android/perms.h
+++ b/vendor/e2fsprogs/contrib/android/perms.h
@@ -1,6 +1,7 @@
Expand Down
1 change: 0 additions & 1 deletion user/android-tools/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
url = "https://github.com/nmeum/android-tools"
source = f"{url}/releases/download/{pkgver}/android-tools-{pkgver}.tar.xz"
sha256 = "d2c3222280315f36d8bfa5c02d7632b47e365bfe2e77e99a3564fb6576f04097"
patch_style = "patch"
tool_flags = {"CXXFLAGS": ["-D_LARGEFILE64_SOURCE"]}
hardening = ["vis", "cfi"]

Expand Down
2 changes: 1 addition & 1 deletion user/cppcheck/patches/feenableexcept.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ index 023137c2a..92b3fe8af 100644
+++ b/test/signal/test-signalhandler.cpp
@@ -46,9 +46,6 @@

/*static*/ void my_fpe()
/*static*/ void my_fpe() // NOLINT(misc-use-internal-linkage)
{
-#if !defined(__APPLE__)
- feenableexcept(FE_ALL_EXCEPT); // TODO: check result
Expand Down
1 change: 0 additions & 1 deletion user/cppcheck/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
url = "https://cppcheck.sourceforge.io"
source = f"https://github.com/danmar/cppcheck/archive/refs/tags/{pkgver}.tar.gz"
sha256 = "98bcc40ac8062635b492fb096d7815376a176ae26749d6c708083f4637f7c0bb"
patch_style = "patch"
# TestSymbolDatabase::enum14 test failed
# (0x7FFFFFFFFFFFFFFF + 1 cause signed overflow)
hardening = ["!int"]
Expand Down
53 changes: 0 additions & 53 deletions user/gamescope/patches/more-mtx-cpp-20.patch

This file was deleted.

63 changes: 52 additions & 11 deletions user/gamescope/patches/mtx-cpp-20.patch
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ is a little bit slower
src/sdlwindow.cpp | 40 +++++++++++++++++++++++++++++++---------
1 file changed, 31 insertions(+), 9 deletions(-)

diff --git a/src/sdlwindow.cpp b/src/sdlwindow.cpp
index 50c3b95..7bd1104 100644
--- a/src/Backends/SDLBackend.cpp
+++ b/src/Backends/SDLBackend.cpp
@@ -177,13 +177,14 @@ namespace gamescope
@@ -179,13 +179,14 @@ namespace gamescope
std::vector<const char *> m_pszInstanceExtensions;

std::thread m_SDLThread;
Expand All @@ -32,7 +30,7 @@ index 50c3b95..7bd1104 100644
SDL_Surface *m_pIconSurface = nullptr;
SDL_Surface *m_pCursorSurface = nullptr;
SDL_Cursor *m_pCursor = nullptr;
@@ -479,7 +480,10 @@ namespace gamescope
@@ -475,7 +476,10 @@ namespace gamescope

void CSDLBackend::SetCursorImage( std::shared_ptr<INestedHints::CursorInfo> info )
{
Expand All @@ -44,7 +42,7 @@ index 50c3b95..7bd1104 100644
PushUserEvent( GAMESCOPE_SDL_EVENT_CURSOR );
}
void CSDLBackend::SetRelativeMouseMode( bool bRelative )
@@ -494,12 +498,18 @@ namespace gamescope
@@ -490,12 +494,18 @@ namespace gamescope
}
void CSDLBackend::SetTitle( std::shared_ptr<std::string> szTitle )
{
Expand All @@ -64,8 +62,8 @@ index 50c3b95..7bd1104 100644
+ }
PushUserEvent( GAMESCOPE_SDL_EVENT_ICON );
}

@@ -874,7 +884,11 @@ namespace gamescope
void CSDLBackend::SetSelection( std::shared_ptr<std::string> szContents, GamescopeSelection eSelection )
@@ -842,7 +852,11 @@ namespace gamescope
}
else if ( event.type == GetUserEventIndex( GAMESCOPE_SDL_EVENT_TITLE ) )
{
Expand All @@ -78,7 +76,7 @@ index 50c3b95..7bd1104 100644

std::string szTitle = pAppTitle ? *pAppTitle : "gamescope";
if ( g_bGrabbed )
@@ -883,7 +897,11 @@ namespace gamescope
@@ -855,7 +869,11 @@ namespace gamescope
}
else if ( event.type == GetUserEventIndex( GAMESCOPE_SDL_EVENT_ICON ) )
{
Expand All @@ -91,7 +89,7 @@ index 50c3b95..7bd1104 100644

if ( m_pIconSurface )
{
@@ -911,7 +929,11 @@ namespace gamescope
@@ -883,7 +901,11 @@ namespace gamescope
}
else if ( event.type == GetUserEventIndex( GAMESCOPE_SDL_EVENT_CURSOR ) )
{
Expand All @@ -104,5 +102,48 @@ index 50c3b95..7bd1104 100644

if ( m_pCursorSurface )
{
--
2.43.1
--- a/src/Backends/WaylandBackend.cpp
+++ b/src/Backends/WaylandBackend.cpp
@@ -420,7 +420,8 @@ namespace gamescope
std::optional<wl_fixed_t> m_ofPendingCursorX;
std::optional<wl_fixed_t> m_ofPendingCursorY;

- std::atomic<std::shared_ptr<zwp_relative_pointer_v1>> m_pRelativePointer = nullptr;
+ std::mutex m_pRelativePointerMutex;
+ std::shared_ptr<zwp_relative_pointer_v1> m_pRelativePointer = nullptr;
std::unordered_set<uint32_t> m_uScancodesHeld;

void Wayland_Registry_Global( wl_registry *pRegistry, uint32_t uName, const char *pInterface, uint32_t uVersion );
@@ -2418,12 +2419,17 @@ namespace gamescope
// This constructors/destructors the display's mutex, so should be safe to do across threads.
if ( !bRelative )
{
+ std::lock_guard<std::mutex> g{m_pRelativePointerMutex};
m_pRelativePointer = nullptr;
}
else
{
zwp_relative_pointer_v1 *pRelativePointer = zwp_relative_pointer_manager_v1_get_relative_pointer( m_pRelativePointerManager, m_pPointer );
- m_pRelativePointer = std::shared_ptr<zwp_relative_pointer_v1>{ pRelativePointer, []( zwp_relative_pointer_v1 *pObject ){ zwp_relative_pointer_v1_destroy( pObject ); } };
+ auto relp = std::shared_ptr<zwp_relative_pointer_v1>{ pRelativePointer, []( zwp_relative_pointer_v1 *pObject ){ zwp_relative_pointer_v1_destroy( pObject ); } };
+ {
+ std::lock_guard<std::mutex> g{m_pRelativePointerMutex};
+ m_pRelativePointer = std::move(relp);
+ }
zwp_relative_pointer_v1_add_listener( pRelativePointer, &s_RelativePointerListener, this );
}
}
@@ -2596,8 +2602,11 @@ namespace gamescope
}
void CWaylandInputThread::Wayland_Pointer_Motion( wl_pointer *pPointer, uint32_t uTime, wl_fixed_t fSurfaceX, wl_fixed_t fSurfaceY )
{
- if ( m_pRelativePointer.load() != nullptr )
- return;
+ {
+ std::lock_guard<std::mutex> g{m_pRelativePointerMutex};
+ if ( m_pRelativePointer != nullptr )
+ return;
+ }

if ( !cv_wayland_mouse_warp_without_keyboard_focus && !m_bKeyboardEntered )
{
22 changes: 10 additions & 12 deletions user/gamescope/patches/steamcompmgr-deadlock.patch
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,17 @@ Date: Sat Nov 11 02:41:10 2023 +0100
Upon invocation of error handler however, do call pthread_exit
and unlock the mutex manually.

diff --git a/src/steamcompmgr.cpp b/src/steamcompmgr.cpp
index f53f49e..08784f1 100644
--- a/src/steamcompmgr.cpp
+++ b/src/steamcompmgr.cpp
@@ -743,6 +743,7 @@ extern float g_flMaxWindowScale;
@@ -782,6 +782,7 @@ extern float g_flMaxWindowScale;
bool synchronize;

std::mutex g_SteamCompMgrXWaylandServerMutex;
+static std::unique_lock<std::mutex> *g_SteamCompMgrXWaylandServerLock;

VBlankTimeInfo_t g_SteamCompMgrVBlankTime = {};
gamescope::VBlankTime g_SteamCompMgrVBlankTime = {};

@@ -5892,8 +5893,8 @@ error(Display *dpy, XErrorEvent *ev)
@@ -5895,8 +5896,8 @@ error(Display *dpy, XErrorEvent *ev)
return 0;
}

Expand All @@ -38,11 +36,11 @@ index f53f49e..08784f1 100644
+static void
+steamcompmgr_exit(bool exit)
{
// Clean up any commits.
{
@@ -5925,14 +5926,19 @@ steamcompmgr_exit(void)
g_ImageWaiter.Shutdown();

finish_drm( &g_DRM );
@@ -5937,14 +5938,19 @@ steamcompmgr_exit(void)
wlserver_shutdown();
wlserver_unlock(false);

- pthread_exit(NULL);
+ if (exit)
Expand All @@ -63,15 +61,15 @@ index f53f49e..08784f1 100644
}

static bool
@@ -7399,6 +7405,7 @@ steamcompmgr_main(int argc, char **argv)
assert( vblankFD >= 0 );
@@ -7495,6 +7501,7 @@ steamcompmgr_main(int argc, char **argv)
init_runtime_info();

std::unique_lock<std::mutex> xwayland_server_guard(g_SteamCompMgrXWaylandServerMutex);
+ g_SteamCompMgrXWaylandServerLock = &xwayland_server_guard;

// Initialize any xwayland ctxs we have
{
@@ -7869,7 +7876,7 @@ steamcompmgr_main(int argc, char **argv)
@@ -8037,7 +8044,7 @@ steamcompmgr_main(int argc, char **argv)
vblank = false;
}

Expand Down
6 changes: 2 additions & 4 deletions user/gamescope/patches/system-spirv-headers.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@ Date: Sat Oct 14 16:36:01 2023 +0200

use system spirv-headers

diff --git a/src/meson.build b/src/meson.build
index c63cbd7..0afe796 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -94,7 +94,7 @@ reshade_src = [
@@ -87,7 +87,7 @@ reshade_src = [
reshade_include = include_directories([
'reshade/source',
'reshade/include',
- '../thirdparty/SPIRV-Headers/include/spirv/unified1'
+ '/usr/include/spirv/unified1'
])

src = [
required_wlroots_features = ['xwayland']
1 change: 0 additions & 1 deletion user/gamescope/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
"8de28aee6f90f47b7fc7037dcd2360166197c0b5d2033f3afdbd34f2ea1bf216",
"3aa6feda7773cc8ffa8fb012fe95e6207c776101e29198d0e0d34a0c5e339f6a",
]
patch_style = "patch"
file_modes = {
"usr/bin/gamescope": ("root", "root", 0o755),
}
Expand Down
13 changes: 5 additions & 8 deletions user/gcc/patches/0003-specs-turn-on-Wl-z-now-by-default.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index b6731a4673c..f393c7846c6 100644
index f82f7d2..9f0a34c 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -17961,6 +17961,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
@@ -18924,6 +18924,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
linker. When using the GNU linker, you can also get the same effect with
@option{-Wl,-Map=output.map}.

Expand All @@ -13,17 +13,14 @@ index b6731a4673c..f393c7846c6 100644
@item -u @var{symbol}
Pretend the symbol @var{symbol} is undefined, to force linking of
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 33b56e721d2..f82fae23c22 100644
index 728332b..b19a69f 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -1144,6 +1144,7 @@ proper position among the other output files. */
@@ -1157,6 +1157,7 @@ proper position among the other output files. */
"%{flto|flto=*:%<fcompare-debug*} \
%{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC \
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
+ "-z relro -z now " \
"%X %{o*} %{e*} %{N} %{n} %{r}\
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
%{Wno-poison-system-directories:--no-poison-system-directories} \
--
2.41.0

%{static|no-pie|static-pie:} %@{L*} %(link_libgcc) " \
Loading

0 comments on commit ac9f6ca

Please sign in to comment.