void-packages/srcpkgs/libSavitar/patches/system-pugixml.patch

73 lines
1.7 KiB
Diff

Author: Gregor Riepl <onitake@gmail.com>
Description: Depend on system pugixml.
Upstream bundled their own version of pugixml.
On Debian, we have a maintained packages of this library,
so use that instead.
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -8,7 +8,9 @@
option(BUILD_STATIC "Build as a static library" OFF)
-add_subdirectory(pugixml)
+find_path(PUGIXML_INCLUDE_DIR "pugixml.hpp" REQUIRED)
+find_library(PUGIXML_LIBRARY pugixml REQUIRED)
+include_directories(${PUGIXML_INCLUDE_DIR} SYSTEM)
if(BUILD_PYTHON)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
@@ -65,7 +67,7 @@
add_library(Savitar SHARED ${savitar_SRCS})
endif()
-target_link_libraries(Savitar PUBLIC pugixml)
+target_link_libraries(Savitar PUBLIC ${PUGIXML_LIBRARY})
if(NOT WIN32 OR CMAKE_COMPILER_IS_GNUCXX)
set_target_properties(Savitar PROPERTIES COMPILE_FLAGS -fPIC)
--- src/MeshData.cpp
+++ src/MeshData.cpp
@@ -17,7 +17,7 @@
*/
#include "MeshData.h"
-#include "../pugixml/src/pugixml.hpp"
+#include <pugixml.hpp>
#include <iostream>
using namespace Savitar;
--- src/Scene.cpp
+++ src/Scene.cpp
@@ -17,7 +17,7 @@
*/
#include "Scene.h"
-#include "../pugixml/src/pugixml.hpp"
+#include <pugixml.hpp>
#include <iostream>
#include <string>
using namespace Savitar;
--- src/SceneNode.cpp
+++ src/SceneNode.cpp
@@ -17,7 +17,7 @@
*/
#include "SceneNode.h"
-#include "../pugixml/src/pugixml.hpp"
+#include <pugixml.hpp>
#include <iostream>
using namespace Savitar;
--- src/ThreeMFParser.h
+++ src/ThreeMFParser.h
@@ -21,7 +21,7 @@
#include "SavitarExport.h"
#include "SceneNode.h"
-#include "../pugixml/src/pugixml.hpp"
+#include <pugixml.hpp>
#include <string>
namespace Savitar