nixpkgs/pkgs/by-name/gl/glsl_analyzer/package.nix
Sam 6d404af7be
glsl_analyzer: fix on x86_64-darwin
Because apple-sdk defaults to 11 on aarch64-darwin, glsl_analyzer builds
fine, but on x86_64-darwin (where apple-sdk defaults to 10.12) it fails
to build. I've bumped the SDK version to be 11 on both platforms, which
fixes the build.
2024-11-24 20:09:20 -08:00

44 lines
1.2 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, zig_0_13
, apple-sdk_11
}:
stdenv.mkDerivation (finalAttrs: {
pname = "glsl_analyzer";
version = "1.5.1";
src = fetchFromGitHub {
owner = "nolanderc";
repo = "glsl_analyzer";
rev = "v${finalAttrs.version}";
hash = "sha256-AIzk05T8JZn8HWSI6JDFUIYl4sutd3HR3Zb+xmJll0g=";
};
nativeBuildInputs = [
zig_0_13.hook
];
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
# The package failed to build on x86_64-darwin because the default was the 10.12 SDK
# Once the default on all platforms has been raised to the 11.0 SDK or higher, this can be removed.
apple-sdk_11
];
postPatch = ''
substituteInPlace build.zig \
--replace-fail 'b.run(&.{ "git", "describe", "--tags", "--always" })' '"${finalAttrs.src.rev}"'
'';
meta = {
description = "Language server for GLSL (OpenGL Shading Language)";
changelog = "https://github.com/nolanderc/glsl_analyzer/releases/tag/v${finalAttrs.version}";
homepage = "https://github.com/nolanderc/glsl_analyzer";
mainProgram = "glsl_analyzer";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ wr7 ];
platforms = lib.platforms.unix;
};
})