lol

Merge pull request #134913 from smancill/bump-glm

authored by

Sandro and committed by
GitHub
1a15a4bc f023c471

+45 -22
+38 -22
pkgs/development/libraries/glm/default.nix
··· 1 - { lib, stdenv, fetchurl, fetchzip, cmake }: 1 + { lib, stdenv, fetchFromGitHub, cmake }: 2 2 3 3 stdenv.mkDerivation rec { 4 - version = "0.9.8.5"; 4 + version = "0.9.9.8"; 5 5 pname = "glm"; 6 6 7 - src = fetchzip { 8 - url = "https://github.com/g-truc/glm/releases/download/${version}/${pname}-${version}.zip"; 9 - sha256 = "0dkfj4hin3am9fxgcvwr5gj0h9y52x7wa03lfwb3q0bvaj1rsly2"; 7 + src = fetchFromGitHub { 8 + owner = "g-truc"; 9 + repo = pname; 10 + rev = version; 11 + sha256 = "sha256-F//+3L5Ozrw6s7t4LrcUmO7sN30ZSESdrPAYX57zgr8="; 10 12 }; 11 13 14 + outputs = [ "out" "doc" ]; 15 + 12 16 nativeBuildInputs = [ cmake ]; 13 17 14 - outputs = [ "out" "doc" ]; 18 + cmakeFlags = [ 19 + "-DBUILD_SHARED_LIBS=OFF" 20 + "-DBUILD_STATIC_LIBS=OFF" 21 + "-DGLM_TEST_ENABLE=${if doCheck then "ON" else "OFF"}" 22 + ]; 15 23 16 - cmakeConfigureFlags = [ "-DGLM_INSTALL_ENABLE=off" ]; 24 + doCheck = true; 17 25 18 - # fetch newer version of platform.h which correctly supports gcc 7.3 19 - gcc7PlatformPatch = fetchurl { 20 - url = "https://raw.githubusercontent.com/g-truc/glm/384dab02e45a8ad3c1a3fa0906e0d5682c5b27b9/glm/simd/platform.h"; 21 - sha256 = "0ym0sgwznxhfyi014xs55x3ql7r65fjs34sqb5jiaffkdhkqgzia"; 22 - }; 26 + installPhase = '' 27 + runHook preInstall 23 28 24 - postPatch = '' 25 - substituteInPlace CMakeLists.txt \ 26 - --replace '"''${CMAKE_CURRENT_BINARY_DIR}/''${GLM_INSTALL_CONFIGDIR}' '"''${GLM_INSTALL_CONFIGDIR}' 27 - cp ${gcc7PlatformPatch} glm/simd/platform.h 28 - ''; 29 + # Install header-only library 30 + mkdir -p $out/include 31 + cp -rv ../glm $out/include 32 + rm $out/include/glm/CMakeLists.txt 33 + rm $out/include/glm/detail/*.cpp 29 34 30 - NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-DGLM_COMPILER=0"; 35 + # Install CMake files 36 + mkdir -p $out/lib 37 + cp -rv ../cmake $out/lib 38 + substituteInPlace $out/lib/cmake/glm/glmConfig.cmake \ 39 + --replace 'GLM_INCLUDE_DIRS ''${_IMPORT_PREFIX}' "GLM_INCLUDE_DIRS $out/include" 31 40 32 - postInstall = '' 41 + # Install pkg-config file 42 + mkdir -p $out/lib/pkgconfig 43 + substituteAll ${./glm.pc.in} $out/lib/pkgconfig/glm.pc 44 + 45 + # Install docs 33 46 mkdir -p $doc/share/doc/glm 34 - cp -rv $NIX_BUILD_TOP/$sourceRoot/doc/* $doc/share/doc/glm 47 + cp -rv ../doc/api $doc/share/doc/glm/html 48 + cp -v ../doc/manual.pdf $doc/share/doc/glm 49 + 50 + runHook postInstall 35 51 ''; 36 52 37 53 meta = with lib; { ··· 41 57 graphics software based on the OpenGL Shading Language (GLSL) 42 58 specification and released under the MIT license. 43 59 ''; 44 - homepage = "http://glm.g-truc.net/"; 60 + homepage = "https://github.com/g-truc/glm"; 45 61 license = licenses.mit; 46 62 platforms = platforms.unix; 47 - maintainers = with lib.maintainers; [ ]; 63 + maintainers = with maintainers; [ smancill ]; 48 64 }; 49 65 } 50 66
+7
pkgs/development/libraries/glm/glm.pc.in
··· 1 + prefix=@out@ 2 + includedir=@out@/include 3 + 4 + Name: GLM 5 + Description: OpenGL Mathematics 6 + Version: @version@ 7 + Cflags: -I${includedir}