2018-02-23 20:51:07 +01:00
|
|
|
{ stdenv, fetchurl, fetchzip, cmake }:
|
2014-01-18 18:38:59 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2017-12-29 01:06:38 +01:00
|
|
|
version = "0.9.8.5";
|
2017-03-20 16:08:09 +01:00
|
|
|
name = "glm-${version}";
|
2014-01-18 18:38:59 +01:00
|
|
|
|
2017-12-29 01:06:38 +01:00
|
|
|
src = fetchzip {
|
2017-03-20 16:08:09 +01:00
|
|
|
url = "https://github.com/g-truc/glm/releases/download/${version}/${name}.zip";
|
2017-12-29 01:06:38 +01:00
|
|
|
sha256 = "0dkfj4hin3am9fxgcvwr5gj0h9y52x7wa03lfwb3q0bvaj1rsly2";
|
2014-01-18 18:38:59 +01:00
|
|
|
};
|
|
|
|
|
2017-12-29 01:06:38 +01:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2014-01-18 18:38:59 +01:00
|
|
|
|
|
|
|
outputs = [ "out" "doc" ];
|
|
|
|
|
2017-12-29 01:06:38 +01:00
|
|
|
cmakeConfigureFlags = [ "-DGLM_INSTALL_ENABLE=off" ];
|
2017-03-20 16:08:09 +01:00
|
|
|
|
2018-02-23 20:51:07 +01:00
|
|
|
# fetch newer version of platform.h which correctly supports gcc 7.3
|
|
|
|
gcc7PlatformPatch = fetchurl {
|
|
|
|
url = "https://raw.githubusercontent.com/g-truc/glm/dd48b56e44d699a022c69155c8672caacafd9e8a/glm/simd/platform.h";
|
|
|
|
sha256 = "0y91hlbgn5va7ijg5mz823gqkq9hqxl00lwmdwnf8q2g086rplzw";
|
|
|
|
};
|
|
|
|
|
2017-12-29 01:06:38 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace CMakeLists.txt \
|
|
|
|
--replace '"''${CMAKE_CURRENT_BINARY_DIR}/''${GLM_INSTALL_CONFIGDIR}' '"''${GLM_INSTALL_CONFIGDIR}'
|
2018-02-23 20:51:07 +01:00
|
|
|
cp ${gcc7PlatformPatch} glm/simd/platform.h
|
2017-03-20 16:08:09 +01:00
|
|
|
'';
|
|
|
|
|
2017-12-29 01:06:38 +01:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $doc/share/doc/glm
|
|
|
|
cp -rv $NIX_BUILD_TOP/$sourceRoot/doc/* $doc/share/doc/glm
|
2014-01-18 18:38:59 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "OpenGL Mathematics library for C++";
|
|
|
|
longDescription = ''
|
|
|
|
OpenGL Mathematics (GLM) is a header only C++ mathematics library for
|
|
|
|
graphics software based on the OpenGL Shading Language (GLSL)
|
|
|
|
specification and released under the MIT license.
|
|
|
|
'';
|
|
|
|
homepage = http://glm.g-truc.net/;
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.unix;
|
2014-09-30 11:33:52 +02:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ fuuzetsu ];
|
2014-01-18 18:38:59 +01:00
|
|
|
};
|
|
|
|
}
|
2017-03-20 16:08:09 +01:00
|
|
|
|