From 761a0b68241083ae53b9c6dd5db156f69436fc89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9D=91=B7=F0=9D=92=89=F0=9D=92=8A=F0=9D=92=8D?= =?UTF-8?q?=F0=9D=92=90=F0=9D=92=84=F0=9D=92=82=F0=9D=92=8D=F0=9D=92=9A?= =?UTF-8?q?=F0=9D=92=94=F0=9D=92=95?= Date: Mon, 18 May 2026 19:06:15 -0400 Subject: [PATCH 1/3] veloren: fixed to support darwin --- pkgs/by-name/ve/veloren/package.nix | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/ve/veloren/package.nix b/pkgs/by-name/ve/veloren/package.nix index b58ab75a7281..583f64769cd7 100644 --- a/pkgs/by-name/ve/veloren/package.nix +++ b/pkgs/by-name/ve/veloren/package.nix @@ -3,10 +3,12 @@ rustPlatform, fetchFromGitLab, pkg-config, + stdenv, + + # Linux-only vulkan-loader, alsa-lib, udev, - shaderc, libxcb, libxkbcommon, autoPatchelfHook, @@ -15,7 +17,12 @@ libxcursor, libxrandr, wayland, - stdenv, + + # Both platforms + shaderc, + + # macOS-only + desktopToDarwinBundle, }: let @@ -58,16 +65,23 @@ rustPlatform.buildRustPackage { ''; nativeBuildInputs = [ - autoPatchelfHook pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + autoPatchelfHook + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + desktopToDarwinBundle ]; buildInputs = [ + shaderc + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ alsa-lib udev libxcb libxkbcommon - shaderc stdenv.cc.cc # libgcc_s.so.1 ]; @@ -92,7 +106,7 @@ rustPlatform.buildRustPackage { # Some tests require internet access doCheck = false; - appendRunpaths = [ + appendRunpaths = lib.optionals stdenv.hostPlatform.isLinux [ (lib.makeLibraryPath ( [ libx11 @@ -122,7 +136,7 @@ rustPlatform.buildRustPackage { homepage = "https://www.veloren.net"; license = lib.licenses.gpl3Only; mainProgram = "veloren-voxygen"; - platforms = lib.platforms.linux; + platforms = lib.platforms.all; maintainers = with lib.maintainers; [ rnhmjoj tomodachi94 From 80dbcbccb49d8e3bb11d06b51373cb24ca7c73dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9D=91=B7=F0=9D=92=89=F0=9D=92=8A=F0=9D=92=8D?= =?UTF-8?q?=F0=9D=92=90=F0=9D=92=84=F0=9D=92=82=F0=9D=92=8D=F0=9D=92=9A?= =?UTF-8?q?=F0=9D=92=94=F0=9D=92=95?= Date: Mon, 18 May 2026 19:06:44 -0400 Subject: [PATCH 2/3] veloren: added to maintainers list --- pkgs/by-name/ve/veloren/package.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/by-name/ve/veloren/package.nix b/pkgs/by-name/ve/veloren/package.nix index 583f64769cd7..0dbd30ab7659 100644 --- a/pkgs/by-name/ve/veloren/package.nix +++ b/pkgs/by-name/ve/veloren/package.nix @@ -139,6 +139,7 @@ rustPlatform.buildRustPackage { platforms = lib.platforms.all; maintainers = with lib.maintainers; [ rnhmjoj + philocalyst tomodachi94 ]; }; From 62b227cea0f3f672e07439b877a6a43d0688de8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9D=91=B7=F0=9D=92=89=F0=9D=92=8A=F0=9D=92=8D?= =?UTF-8?q?=F0=9D=92=90=F0=9D=92=84=F0=9D=92=82=F0=9D=92=8D=F0=9D=92=9A?= =?UTF-8?q?=F0=9D=92=94=F0=9D=92=95?= Date: Mon, 18 May 2026 19:07:02 -0400 Subject: [PATCH 3/3] veloren: formatting and cleanup and cleanup --- pkgs/by-name/ve/veloren/package.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ve/veloren/package.nix b/pkgs/by-name/ve/veloren/package.nix index 0dbd30ab7659..43b515447dd7 100644 --- a/pkgs/by-name/ve/veloren/package.nix +++ b/pkgs/by-name/ve/veloren/package.nix @@ -32,7 +32,6 @@ let timestamp = "1769191511"; rev = "1d12f35edd6cdbfc1fb921c167cdd7beeeffe248"; in - rustPlatform.buildRustPackage { pname = "veloren"; inherit version; @@ -52,14 +51,16 @@ rustPlatform.buildRustPackage { postPatch = '' # Force vek to build in unstable mode - cat <<'EOF' | tee "$cargoDepsCopy"/*/vek-*/build.rs + tee "$cargoDepsCopy"/*/vek-*/build.rs > /dev/null <<'EOF' fn main() { println!("cargo:rustc-check-cfg=cfg(nightly)"); println!("cargo:rustc-cfg=nightly"); } EOF + # Fix assets path substituteAllInPlace common/assets/src/lib.rs + # Do not use mold, it produces broken binaries substituteInPlace .cargo/config.toml --replace-fail mold gold ''; @@ -127,6 +128,7 @@ rustPlatform.buildRustPackage { install -Dm644 assets/voxygen/net.veloren.veloren.desktop -t "$out/share/applications" install -Dm644 assets/voxygen/net.veloren.veloren.png -t "$out/share/icons/hicolor/256x256/apps" install -Dm644 assets/voxygen/net.veloren.veloren.metainfo.xml -t "$out/share/metainfo" + # Assets directory mkdir -p "$out/share/veloren"; cp -ar assets "$out/share/veloren/" '';