8 stdenv.mkDerivation rec {
12 src = fetchFromGitHub {
16 sha256 = "sha256-GnGyzNRpzuguc3yYbEFtYLvG+KiCtRAktiN+NvbOICE=";
24 nativeBuildInputs = [ cmake ];
26 env.NIX_CFLAGS_COMPILE =
27 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102823
28 if (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "11") then
30 # Fix compilation errors on darwin
31 else if (stdenv.cc.isClang) then
37 (lib.cmakeBool "BUILD_SHARED_LIBS" false)
38 (lib.cmakeBool "BUILD_STATIC_LIBS" false)
39 (lib.cmakeBool "GLM_TEST_ENABLE" doCheck)
45 # Install pkg-config file
46 mkdir -p $out/lib/pkgconfig
47 substituteAll ${./glm.pc.in} $out/lib/pkgconfig/glm.pc
50 mkdir -p $doc/share/doc/glm
51 cp -rv ../doc/api $doc/share/doc/glm/html
52 cp -v ../doc/manual.pdf $doc/share/doc/glm
56 description = "OpenGL Mathematics library for C++";
58 OpenGL Mathematics (GLM) is a header only C++ mathematics library for
59 graphics software based on the OpenGL Shading Language (GLSL)
60 specification and released under the MIT license.
62 homepage = "https://github.com/g-truc/glm";
63 license = licenses.mit;
64 platforms = platforms.unix;
65 maintainers = with maintainers; [ smancill ];