tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
librashader: init at 0.6.2
Nadia Holmquist Pedersen
1 year ago
689ef062
53ae2f05
+101
2 changed files
expand all
collapse all
unified
split
pkgs
by-name
li
librashader
package.nix
patches
fix-optional-dep-syntax.patch
+70
pkgs/by-name/li/librashader/package.nix
···
1
1
+
{
2
2
+
fetchFromGitHub,
3
3
+
lib,
4
4
+
rustPlatform,
5
5
+
stdenv,
6
6
+
}:
7
7
+
8
8
+
rustPlatform.buildRustPackage {
9
9
+
pname = "librashader";
10
10
+
version = "0.6.2";
11
11
+
12
12
+
src = fetchFromGitHub {
13
13
+
owner = "SnowflakePowered";
14
14
+
repo = "librashader";
15
15
+
rev = "librashader-v0.6.2";
16
16
+
hash = "sha256-zkvCpQ5Cq3sDOspc12/gPmNi6hn/nBe1UfWrMGi/o0Q=";
17
17
+
};
18
18
+
19
19
+
patches = [
20
20
+
./patches/fix-optional-dep-syntax.patch
21
21
+
];
22
22
+
23
23
+
cargoHash = "sha256-eUZOFdbOPs81LAMEV4i6eYRN8NYVcnmble/L+ptx2EA=";
24
24
+
25
25
+
RUSTC_BOOTSTRAP = 1;
26
26
+
27
27
+
buildPhase = ''
28
28
+
runHook preBuild
29
29
+
cargo run -p librashader-build-script -- --profile optimized
30
30
+
runHook postBuild
31
31
+
'';
32
32
+
33
33
+
doCheck = false;
34
34
+
35
35
+
installPhase =
36
36
+
''
37
37
+
runHook preInstall
38
38
+
cd target/optimized
39
39
+
mkdir -p $out/lib $out/include/librashader
40
40
+
''
41
41
+
+ (
42
42
+
if stdenv.hostPlatform.isDarwin then
43
43
+
''
44
44
+
install_name_tool -id $out/lib/librashader.dylib librashader.dylib
45
45
+
install -m755 librashader.dylib $out/lib/librashader.dylib
46
46
+
''
47
47
+
else
48
48
+
''
49
49
+
patchelf --set-soname librashader.so.2 librashader.so
50
50
+
install -m755 librashader.so $out/lib/librashader.so.2
51
51
+
ln -s $out/lib/librashader.so.2 $out/lib/librashader.so
52
52
+
''
53
53
+
)
54
54
+
+ ''
55
55
+
install -m644 librashader.h -t $out/include/librashader
56
56
+
install -m644 ../../include/librashader_ld.h -t $out/include/librashader
57
57
+
runHook postInstall
58
58
+
'';
59
59
+
60
60
+
meta = {
61
61
+
description = "RetroArch Shaders for All";
62
62
+
homepage = "https://github.com/SnowflakePowered/librashader";
63
63
+
license = with lib.licenses; [
64
64
+
mpl20
65
65
+
gpl3Only
66
66
+
];
67
67
+
maintainers = with lib.maintainers; [ nadiaholmquist ];
68
68
+
platforms = lib.platforms.all;
69
69
+
};
70
70
+
}
+31
pkgs/by-name/li/librashader/patches/fix-optional-dep-syntax.patch
···
1
1
+
diff --git a/librashader-capi/Cargo.toml b/librashader-capi/Cargo.toml
2
2
+
index 4a103ab7..38971ddb 100644
3
3
+
--- a/librashader-capi/Cargo.toml
4
4
+
+++ b/librashader-capi/Cargo.toml
5
5
+
@@ -17,12 +17,12 @@ crate-type = [ "cdylib", "staticlib" ]
6
6
+
[features]
7
7
+
default = ["runtime-all" ]
8
8
+
runtime-all = ["runtime-opengl", "runtime-d3d9", "runtime-d3d11", "runtime-d3d12", "runtime-vulkan", "runtime-metal"]
9
9
+
-runtime-opengl = ["glow", "librashader/runtime-gl"]
10
10
+
-runtime-d3d11 = ["windows", "librashader/runtime-d3d11", "windows/Win32_Graphics_Direct3D11"]
11
11
+
-runtime-d3d12 = ["windows", "librashader/runtime-d3d12", "windows/Win32_Graphics_Direct3D12"]
12
12
+
-runtime-d3d9 = ["windows", "librashader/runtime-d3d9", "windows/Win32_Graphics_Direct3D9"]
13
13
+
+runtime-opengl = ["dep:glow", "librashader/runtime-gl"]
14
14
+
+runtime-d3d11 = ["dep:windows", "librashader/runtime-d3d11", "windows/Win32_Graphics_Direct3D11"]
15
15
+
+runtime-d3d12 = ["dep:windows", "librashader/runtime-d3d12", "windows/Win32_Graphics_Direct3D12"]
16
16
+
+runtime-d3d9 = ["dep:windows", "librashader/runtime-d3d9", "windows/Win32_Graphics_Direct3D9"]
17
17
+
18
18
+
-runtime-vulkan = ["ash", "librashader/runtime-vk"]
19
19
+
+runtime-vulkan = ["dep:ash", "librashader/runtime-vk"]
20
20
+
runtime-metal = ["__cbindgen_internal_objc", "librashader/runtime-metal"]
21
21
+
22
22
+
reflect-unstable = []
23
23
+
@@ -33,7 +33,7 @@ __cbindgen_internal = ["runtime-all"]
24
24
+
25
25
+
# make runtime-metal depend on this, so its automatically implied.
26
26
+
# this will make cbindgen generate __OBJC__ ifdefs for metal functions.
27
27
+
-__cbindgen_internal_objc = ["objc2-metal", "objc2"]
28
28
+
+__cbindgen_internal_objc = ["dep:objc2-metal", "dep:objc2"]
29
29
+
30
30
+
[dependencies]
31
31
+
thiserror = "2"