From f76f4ec7dd0fd7a3a92bf9087217b7f4fb4e710a Mon Sep 17 00:00:00 2001 From: mingchuan Date: Sat, 24 Feb 2018 03:51:07 +0800 Subject: [PATCH 1/2] glm: fix gcc 7.3 support This will also fix several packages' build --- pkgs/development/libraries/glm/default.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/glm/default.nix b/pkgs/development/libraries/glm/default.nix index 904727ceae63..803f08a7a11c 100644 --- a/pkgs/development/libraries/glm/default.nix +++ b/pkgs/development/libraries/glm/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchzip, cmake }: +{ stdenv, fetchurl, fetchzip, cmake }: stdenv.mkDerivation rec { version = "0.9.8.5"; @@ -15,9 +15,16 @@ stdenv.mkDerivation rec { cmakeConfigureFlags = [ "-DGLM_INSTALL_ENABLE=off" ]; + # 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"; + }; + postPatch = '' substituteInPlace CMakeLists.txt \ --replace '"''${CMAKE_CURRENT_BINARY_DIR}/''${GLM_INSTALL_CONFIGDIR}' '"''${GLM_INSTALL_CONFIGDIR}' + cp ${gcc7PlatformPatch} glm/simd/platform.h ''; postInstall = '' From fd6930f404601ed47c9aa95374328d0dbfd46caf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Tue, 27 Feb 2018 00:04:39 +0100 Subject: [PATCH 2/2] Revert "glm: "build" with gcc6 again" This reverts commit c6d26b7f72247bd4d7f0d738dbf48cb605567e0b. The hack isn't needed anymore. No change in output compared to the parent commit (except for hashes). --- pkgs/top-level/all-packages.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index cdc888fba438..76bd15fe5676 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8870,9 +8870,7 @@ with pkgs; glibc32 = pkgsi686Linux.glibc; }; - glm = callPackage ../development/libraries/glm - (lib.optionalAttrs stdenv.cc.isGNU { stdenv = overrideCC stdenv gcc6;/*maybe a hack*/ }); - + glm = callPackage ../development/libraries/glm { }; glm_0954 = callPackage ../development/libraries/glm/0954.nix { }; globalplatform = callPackage ../development/libraries/globalplatform { };