From e1c1fa695a6794cd6003765ac1d34a00c5a47768 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Mon, 21 Nov 2016 12:39:12 -0600 Subject: [PATCH] pugixml: fix darwin build --- .../development/libraries/pugixml/default.nix | 5 ++++- .../libraries/pugixml/no-long-long.patch | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/libraries/pugixml/no-long-long.patch diff --git a/pkgs/development/libraries/pugixml/default.nix b/pkgs/development/libraries/pugixml/default.nix index 6ce2d9e2ffe0..ebb62459091e 100644 --- a/pkgs/development/libraries/pugixml/default.nix +++ b/pkgs/development/libraries/pugixml/default.nix @@ -20,11 +20,14 @@ stdenv.mkDerivation rec { sed -ire '/PUGIXML_HAS_LONG_LONG/ s/^\/\///' ../src/pugiconfig.hpp ''; + patches = [] + ++ stdenv.lib.optionals stdenv.isDarwin [ ./no-long-long.patch ]; + meta = with stdenv.lib; { description = "Light-weight, simple and fast XML parser for C++ with XPath support"; homepage = http://pugixml.org/; license = licenses.mit; maintainers = with maintainers; [ pSub ]; - platforms = platforms.linux; + platforms = platforms.unix; }; } diff --git a/pkgs/development/libraries/pugixml/no-long-long.patch b/pkgs/development/libraries/pugixml/no-long-long.patch new file mode 100644 index 000000000000..46c54e85a1d0 --- /dev/null +++ b/pkgs/development/libraries/pugixml/no-long-long.patch @@ -0,0 +1,19 @@ +Get rid of long-long feature. This breaks on AppleClang compilers. +--- +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 40a7ab0..c84f0f7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -26,9 +26,9 @@ else() + endif() + + # Enable C++11 long long for compilers that are capable of it +-if(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} STRLESS 3.1) +- target_compile_features(pugixml PUBLIC cxx_long_long_type) +-endif() ++# if(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} STRLESS 3.1) ++# target_compile_features(pugixml PUBLIC cxx_long_long_type) ++# endif() + + set_target_properties(pugixml PROPERTIES VERSION 1.7 SOVERSION 1) +