push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,97 @@
{
lib,
stdenv,
rustPlatform,
fetchFromGitHub,
pkg-config,
bzip2,
libGL,
libX11,
libXcursor,
libxkbcommon,
libXi,
moltenvk,
sdl3,
wayland,
zstd,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "gopher64";
version = "1.0.17";
src = fetchFromGitHub {
owner = "gopher64";
repo = "gopher64";
tag = "v${finalAttrs.version}";
hash = "sha256-DDFtPISV17jQMECBIqYbbGhZpjYXuNnOq7EiEVtSzgc=";
fetchSubmodules = true;
leaveDotGit = true;
postFetch = ''
cd "$out"
git rev-parse HEAD > $out/GIT_REV
find "$out" -name .git -print0 | xargs -0 rm -rf
'';
};
cargoPatches = [
# upstream rebuilds SDL3 from source
# this patch makes it use the SDL3 library provided by nixpkgs
./use-sdl3-via-pkg-config.patch
# make the build script use the @GIT_REV@ string that will be substituted in the logic below
./set-git-rev.patch
];
postPatch = ''
# use the file generated in the fetcher to supply the git revision
substituteInPlace build.rs \
--replace-fail "@GIT_REV@" $(cat GIT_REV)
'';
cargoHash = "sha256-31kEYwlDA6iYcwPZyQU4gM/VLfPNeYcDKhhBqzNp/QE=";
env.ZSTD_SYS_USE_PKG_CONFIG = true;
nativeBuildInputs = [
pkg-config
rustPlatform.bindgenHook
];
buildInputs = [
bzip2
sdl3
zstd
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
moltenvk
];
# these are dlopen-ed during runtime
runtimeDependencies = lib.optionalString stdenv.hostPlatform.isLinux [
libGL
libxkbcommon
# for X11
libX11
libXcursor
libXi
# for wayland
wayland
];
postFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
patchelf $out/bin/gopher64 --add-rpath ${lib.makeLibraryPath finalAttrs.runtimeDependencies}
'';
meta = {
changelog = "https://github.com/gopher64/gopher64/releases/tag/${finalAttrs.src.tag}";
description = "N64 emulator written in Rust";
homepage = "https://github.com/gopher64/gopher64";
license = lib.licenses.gpl3Only;
mainProgram = "gopher64";
maintainers = with lib.maintainers; [ tomasajt ];
};
})

View File

@@ -0,0 +1,19 @@
diff --git a/build.rs b/build.rs
index 0b20db2..d904e63 100644
--- a/build.rs
+++ b/build.rs
@@ -163,13 +163,7 @@ fn main() {
simd_build.compile("simd");
}
- let git_output = std::process::Command::new("git")
- .args(["rev-parse", "HEAD"])
- .output()
- .unwrap();
-
- let git_hash = String::from_utf8(git_output.stdout).unwrap();
- println!("cargo:rustc-env=GIT_HASH={}", git_hash);
+ println!("cargo:rustc-env=GIT_HASH={}", "@GIT_REV@");
println!("cargo:rustc-env=N64_STACK_SIZE={}", 8 * 1024 * 1024);
}

View File

@@ -0,0 +1,85 @@
diff --git a/Cargo.lock b/Cargo.lock
index 81c7e20..6ae0a17 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -611,15 +611,6 @@ dependencies = [
"error-code",
]
-[[package]]
-name = "cmake"
-version = "0.1.54"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e7caa3f9de89ddbe2c607f4101924c5abec803763ae9534e4f4d7d8f84aa81f0"
-dependencies = [
- "cc",
-]
-
[[package]]
name = "cobs"
version = "0.2.3"
@@ -3243,12 +3234,6 @@ dependencies = [
"windows-sys 0.52.0",
]
-[[package]]
-name = "rpkg-config"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a2d2f3481209a6b42eec2fbb49063fb4e8d35b57023401495d4fe0f85c817f0"
-
[[package]]
name = "rustc-demangle"
version = "0.1.24"
@@ -3370,21 +3355,13 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
-[[package]]
-name = "sdl3-src"
-version = "3.2.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c5b5d192485408fa251477ea1dfb4778d864efaec72f730ce3a753deaffb27bb"
-
[[package]]
name = "sdl3-sys"
version = "0.5.2+SDL3-3.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0a31799d7cbd36f2b187c32a56975fbdd371c200a91b01d4ed0faf0012bcf9c"
dependencies = [
- "cmake",
- "rpkg-config",
- "sdl3-src",
+ "pkg-config",
]
[[package]]
diff --git a/Cargo.toml b/Cargo.toml
index 82d8e99..8b15aad 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -18,7 +18,7 @@ serde-big-array = "0.5"
eframe = { version = "0.31", default-features = false, features = ["wayland", "x11", "glow"] }
sha2 = "0.10"
ab_glyph = "0.2"
-sdl3-sys = { version = "0.5", features = ["build-from-source-static"] }
+sdl3-sys = { version = "0.5", features = ["use-pkg-config"] }
rfd = { version = "0.15", default-features = false, features = ["xdg-portal", "tokio"] }
tokio = {version = "1.45", features = ["rt-multi-thread", "macros"] }
spin_sleep = "1.3"
diff --git a/build.rs b/build.rs
index f0c6d21..fa28e25 100644
--- a/build.rs
+++ b/build.rs
@@ -52,10 +52,7 @@ fn main() {
.include("parallel-rdp/parallel-rdp-standalone/vulkan")
.include("parallel-rdp/parallel-rdp-standalone/vulkan-headers/include")
.include("parallel-rdp/parallel-rdp-standalone/util")
- .include(
- std::path::PathBuf::from(std::env::var("DEP_SDL3_OUT_DIR").to_owned().unwrap())
- .join("include"),
- );
+ ;
let os = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
let arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap();