From b761a3a403fe785f4800c9ba24b9f10cd16e75ec Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Wed, 13 Nov 2024 08:27:46 -0600 Subject: [PATCH 1/2] ddnet: format --- pkgs/games/ddnet/default.nix | 133 +++++++++++++++++++---------------- 1 file changed, 72 insertions(+), 61 deletions(-) diff --git a/pkgs/games/ddnet/default.nix b/pkgs/games/ddnet/default.nix index b6d276c64a3f..165144b7818f 100644 --- a/pkgs/games/ddnet/default.nix +++ b/pkgs/games/ddnet/default.nix @@ -1,36 +1,37 @@ -{ lib -, stdenv -, fetchFromGitHub -, cargo -, cmake -, ninja -, pkg-config -, rustPlatform -, rustc -, curl -, freetype -, libGLU -, libnotify -, libogg -, libX11 -, opusfile -, pcre -, python3 -, SDL2 -, sqlite -, wavpack -, ffmpeg -, x264 -, vulkan-headers -, vulkan-loader -, glslang -, spirv-tools -, gtest -, Carbon -, Cocoa -, OpenGL -, Security -, buildClient ? true +{ + lib, + stdenv, + fetchFromGitHub, + cargo, + cmake, + ninja, + pkg-config, + rustPlatform, + rustc, + curl, + freetype, + libGLU, + libnotify, + libogg, + libX11, + opusfile, + pcre, + python3, + SDL2, + sqlite, + wavpack, + ffmpeg, + x264, + vulkan-headers, + vulkan-loader, + glslang, + spirv-tools, + gtest, + Carbon, + Cocoa, + OpenGL, + Security, + buildClient ? true, }: stdenv.mkDerivation rec { @@ -63,33 +64,39 @@ stdenv.mkDerivation rec { gtest ]; - buildInputs = [ - curl - libnotify - pcre - python3 - sqlite - ] ++ lib.optionals buildClient ([ - freetype - libGLU - libogg - opusfile - SDL2 - wavpack - ffmpeg - x264 - vulkan-loader - vulkan-headers - glslang - spirv-tools - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ - libX11 - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ - Carbon - Cocoa - OpenGL - Security - ]); + buildInputs = + [ + curl + libnotify + pcre + python3 + sqlite + ] + ++ lib.optionals buildClient ( + [ + freetype + libGLU + libogg + opusfile + SDL2 + wavpack + ffmpeg + x264 + vulkan-loader + vulkan-headers + glslang + spirv-tools + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libX11 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + Carbon + Cocoa + OpenGL + Security + ] + ); postPatch = '' substituteInPlace src/engine/shared/storage.cpp \ @@ -130,7 +137,11 @@ stdenv.mkDerivation rec { ''; homepage = "https://ddnet.org"; license = licenses.asl20; - maintainers = with maintainers; [ sirseruju lom ncfavier ]; + maintainers = with maintainers; [ + sirseruju + lom + ncfavier + ]; mainProgram = "DDNet"; }; } From a4c1840b8dd7be8d75579ae3df4c4859f0e7e36a Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Wed, 13 Nov 2024 08:28:41 -0600 Subject: [PATCH 2/2] ddnet: fix x86 darwin Aligned alloc requires higher sdk. --- pkgs/games/ddnet/default.nix | 10 ++-------- pkgs/top-level/all-packages.nix | 4 +--- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/pkgs/games/ddnet/default.nix b/pkgs/games/ddnet/default.nix index 165144b7818f..7ab1ef89e2e7 100644 --- a/pkgs/games/ddnet/default.nix +++ b/pkgs/games/ddnet/default.nix @@ -8,6 +8,7 @@ pkg-config, rustPlatform, rustc, + apple-sdk_11, curl, freetype, libGLU, @@ -27,10 +28,6 @@ glslang, spirv-tools, gtest, - Carbon, - Cocoa, - OpenGL, - Security, buildClient ? true, }: @@ -91,10 +88,7 @@ stdenv.mkDerivation rec { libX11 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ - Carbon - Cocoa - OpenGL - Security + apple-sdk_11 ] ); diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 930d24a9eb82..f5123095aec2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17025,9 +17025,7 @@ with pkgs; deliantra-maps = callPackage ../games/deliantra/maps.nix { }; deliantra-data = callPackage ../games/deliantra/data.nix { }; - ddnet = callPackage ../games/ddnet { - inherit (darwin.apple_sdk.frameworks) Carbon Cocoa OpenGL Security; - }; + ddnet = callPackage ../games/ddnet {}; ddnet-server = ddnet.override { buildClient = false; }; devilutionx = callPackage ../games/devilutionx {