diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 9105a8ec8a5d..16a94fc4e170 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -19288,6 +19288,12 @@ email = "nyu@nyuku.ru"; githubId = 97425873; }; + nyxonios = { + name = "nyxonios"; + github = "Nyxonios"; + email = "martin.n.seller@gmail.com"; + githubId = 18164197; + }; nzbr = { email = "nixos@nzbr.de"; github = "nzbr"; diff --git a/pkgs/by-name/sd/sdl3-shadercross/package.nix b/pkgs/by-name/sd/sdl3-shadercross/package.nix new file mode 100644 index 000000000000..a6ed11ea2c1b --- /dev/null +++ b/pkgs/by-name/sd/sdl3-shadercross/package.nix @@ -0,0 +1,79 @@ +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + ninja, + sdl3, + spirv-cross, + directx-shader-compiler, + nix-update-script, + runCommand, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "sdl3-shadercross"; + version = "0-unstable-2025-09-18"; + + outputs = [ + "out" + "lib" + "dev" + ]; + + src = fetchFromGitHub { + owner = "libsdl-org"; + repo = "SDL_shadercross"; + rev = "3e572c3219ea438bff849cebea34f3aad7e1859b"; + hash = "sha256-2kpW4AN5eYPY3GxxDpH++nVHtBhSVv5FM2X4I+F2iAU="; + }; + + strictDeps = true; + + nativeBuildInputs = [ + cmake + ninja + ]; + + buildInputs = [ + sdl3 + spirv-cross + directx-shader-compiler + ]; + + cmakeFlags = [ + (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic)) + (lib.cmakeBool "SDLSHADERCROSS_INSTALL" true) + (lib.cmakeBool "SDLSHADERCROSS_TESTS" finalAttrs.finalPackage.doCheck) + ]; + + doCheck = true; + + passthru.updateScript = nix-update-script { extraArgs = [ "--version=branch" ]; }; + + passthru.tests.example = runCommand "compile-spv-example" { } '' + cat > example.vert.hlsl << EOF + struct Input + { + float4 position : POSITION; + float3 color : COLOR; + }; + float3 main(in Input IN) : COLOR + { + return IN.color; + }; + EOF + ${lib.getExe finalAttrs.finalPackage} example.vert.hlsl -o example.spv + touch $out + ''; + + meta = { + description = "Shader translation library"; + mainProgram = "shadercross"; + homepage = "https://github.com/libsdl-org/SDL_shadercross"; + license = lib.licenses.zlib; + maintainers = with lib.maintainers; [ nyxonios ]; + teams = [ lib.teams.sdl ]; + platforms = lib.platforms.linux; + }; +})