From 1d3cc9064ef2575eb85a24be2b618bbdeaa67990 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Sun, 3 Aug 2025 20:19:26 +0200 Subject: [PATCH] steamworks: Various fixes - Change updateScript to gitUpdater, nix-update-script was trying to downgrade to the last tag with a release page - Add catch2 to checkInputs, was previously unused - Fix catch2 linking - Fix non-debug compilation - Enable tests - Add references to upstream-submitted fixes --- .../1001-Add-missing-logger-methods.patch | 26 +++++++++++++++++ pkgs/by-name/st/steamworks/package.nix | 29 ++++++++++++++----- 2 files changed, 48 insertions(+), 7 deletions(-) create mode 100644 pkgs/by-name/st/steamworks/1001-Add-missing-logger-methods.patch diff --git a/pkgs/by-name/st/steamworks/1001-Add-missing-logger-methods.patch b/pkgs/by-name/st/steamworks/1001-Add-missing-logger-methods.patch new file mode 100644 index 000000000000..b7d98fabfe20 --- /dev/null +++ b/pkgs/by-name/st/steamworks/1001-Add-missing-logger-methods.patch @@ -0,0 +1,26 @@ +From 5f144d5d26ea0dd1754ed25a583ebafa01ecbb4b Mon Sep 17 00:00:00 2001 +From: OPNA2608 +Date: Sun, 3 Aug 2025 20:06:49 +0200 +Subject: [PATCH] src/common/logger.h: Add missing methods under NDEBUG + +--- + src/common/logger.h | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/common/logger.h b/src/common/logger.h +index 0901205..259f058 100644 +--- a/src/common/logger.h ++++ b/src/common/logger.h +@@ -81,6 +81,9 @@ public: + LoggerStream& getStream(int level) { return stream; } + + void debug(...) {} ++ void warn(...) {} ++ ++ bool isDebugEnabled() { return false; } + }; + + // Bogus level numbers; I don't know if these are compatible with +-- +2.50.1 + diff --git a/pkgs/by-name/st/steamworks/package.nix b/pkgs/by-name/st/steamworks/package.nix index c528c6897c95..f8c48dffcbb2 100644 --- a/pkgs/by-name/st/steamworks/package.nix +++ b/pkgs/by-name/st/steamworks/package.nix @@ -11,7 +11,7 @@ log4cpp, openldap, sqlite, - nix-update-script, + gitUpdater, }: stdenv.mkDerivation (finalAttrs: { @@ -25,9 +25,20 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-hD1nTyv/t7MQdopqivfSE0o4Qk1ymG8zQVg56lY+t9o="; }; - # src/common/logger.h:254:63: error: 'uint8_t' does not name a type + patches = [ + # https://gitlab.com/arpa2/steamworks/-/merge_requests/13 + ./1001-Add-missing-logger-methods.patch + ]; + postPatch = '' - sed -i "38i #include " src/common/logger.h + # src/common/logger.h:254:63: error: 'uint8_t' does not name a type + # https://gitlab.com/arpa2/steamworks/-/merge_requests/11 + sed -i "40i #include " src/common/logger.h + + # ld: cannot find -lLog4cpp: No such file or directory + # https://gitlab.com/arpa2/steamworks/-/merge_requests/12 + substituteInPlace src/common/CMakeLists.txt \ + --replace-fail 'Catch2::Catch2 Log4cpp' 'Catch2::Catch2 Log4cpp::Log4cpp' ''; strictDeps = true; @@ -47,11 +58,15 @@ stdenv.mkDerivation (finalAttrs: { sqlite ]; - # Currently doesn't build in `Release` since a macro is messing with some code - # when building in `Release`. - cmakeBuildType = "Debug"; + checkInputs = [ + catch2 + ]; - passthru.updateScript = nix-update-script { }; + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; + + passthru.updateScript = gitUpdater { + rev-prefix = "v"; + }; meta = { description = "Configuration information distributed over LDAP in near realtime";