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,75 @@
{
fetchFromGitHub,
lib,
nix-update-script,
rustPlatform,
stdenv,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "librashader";
version = "0.9.1";
src = fetchFromGitHub {
owner = "SnowflakePowered";
repo = "librashader";
tag = "librashader-v${finalAttrs.version}";
hash = "sha256-jrx7TzV9Q7JB8se6J5Wfa1iT1RSJnZbjEn7yTZ64zYU=";
};
patches = [
./patches/fix-optional-dep-syntax.patch
];
cargoHash = "sha256-LFub48GklgOLncqazAIn2Bz+tSsXgS4TTnAdfYw7xHk=";
buildPhase = ''
runHook preBuild
cargo run -p librashader-build-script -- --profile optimized --stable
runHook postBuild
'';
doCheck = false;
installPhase = ''
runHook preInstall
cd target/optimized
mkdir -p $out/lib $out/include/librashader
''
+ (
if stdenv.hostPlatform.isDarwin then
''
install_name_tool -id $out/lib/librashader.dylib librashader.dylib
install -m755 librashader.dylib $out/lib/librashader.dylib
''
else
''
patchelf --set-soname librashader.so.2 librashader.so
install -m755 librashader.so $out/lib/librashader.so.2
ln -s $out/lib/librashader.so.2 $out/lib/librashader.so
''
)
+ ''
install -m644 ../../include/librashader.h -t $out/include/librashader
install -m644 ../../include/librashader_ld.h -t $out/include/librashader
runHook postInstall
'';
passthru.updateScript = nix-update-script {
extraArgs = [
"--version-regex"
"librashader-v(.*)"
];
};
meta = {
description = "RetroArch Shaders for All";
homepage = "https://github.com/SnowflakePowered/librashader";
license = with lib.licenses; [
mpl20
gpl3Only
];
maintainers = with lib.maintainers; [ nadiaholmquist ];
platforms = lib.platforms.all;
};
})

View File

@@ -0,0 +1,31 @@
diff --git a/librashader-capi/Cargo.toml b/librashader-capi/Cargo.toml
index 4a103ab7..38971ddb 100644
--- a/librashader-capi/Cargo.toml
+++ b/librashader-capi/Cargo.toml
@@ -17,12 +17,12 @@ crate-type = [ "cdylib", "staticlib" ]
[features]
default = ["runtime-all" ]
runtime-all = ["runtime-opengl", "runtime-d3d9", "runtime-d3d11", "runtime-d3d12", "runtime-vulkan", "runtime-metal"]
-runtime-opengl = ["glow", "librashader/runtime-gl"]
-runtime-d3d11 = ["windows", "librashader/runtime-d3d11", "windows/Win32_Graphics_Direct3D11"]
-runtime-d3d12 = ["windows", "librashader/runtime-d3d12", "windows/Win32_Graphics_Direct3D12"]
-runtime-d3d9 = ["windows", "librashader/runtime-d3d9", "windows/Win32_Graphics_Direct3D9"]
+runtime-opengl = ["dep:glow", "librashader/runtime-gl"]
+runtime-d3d11 = ["dep:windows", "librashader/runtime-d3d11", "windows/Win32_Graphics_Direct3D11"]
+runtime-d3d12 = ["dep:windows", "librashader/runtime-d3d12", "windows/Win32_Graphics_Direct3D12"]
+runtime-d3d9 = ["dep:windows", "librashader/runtime-d3d9", "windows/Win32_Graphics_Direct3D9"]
-runtime-vulkan = ["ash", "librashader/runtime-vk"]
+runtime-vulkan = ["dep:ash", "librashader/runtime-vk"]
runtime-metal = ["__cbindgen_internal_objc", "librashader/runtime-metal"]
reflect-unstable = []
@@ -33,7 +33,7 @@ __cbindgen_internal = ["runtime-all"]
# make runtime-metal depend on this, so its automatically implied.
# this will make cbindgen generate __OBJC__ ifdefs for metal functions.
-__cbindgen_internal_objc = ["objc2-metal", "objc2"]
+__cbindgen_internal_objc = ["dep:objc2-metal", "dep:objc2"]
[dependencies]
thiserror = "2"