From f245d61490a1087e8b2aabefe6f7ab0cd6b5ce93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Sun, 24 Jan 2021 12:02:03 +0700 Subject: [PATCH] 0ad: fix build for gcc-10 --- srcpkgs/0ad/patches/build-fcollada-once.patch | 23 ++++++++++ srcpkgs/0ad/patches/template-misuse.patch | 43 +++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 srcpkgs/0ad/patches/build-fcollada-once.patch create mode 100644 srcpkgs/0ad/patches/template-misuse.patch diff --git a/srcpkgs/0ad/patches/build-fcollada-once.patch b/srcpkgs/0ad/patches/build-fcollada-once.patch new file mode 100644 index 00000000000..f65fdcf7d81 --- /dev/null +++ b/srcpkgs/0ad/patches/build-fcollada-once.patch @@ -0,0 +1,23 @@ +Index: libraries/source/fcollada/src/Makefile +=================================================================== +--- libraries/source/fcollada/src/Makefile.orig ++++ libraries/source/fcollada/src/Makefile +@@ -224,7 +224,7 @@ OBJECTS_RELEASE = $(addprefix output/rel + OBJECTS_TEST = $(addprefix output/test/,$(SOURCE:.cpp=.o) $(TEST_SOURCE:.cpp=.o)) + OBJECTS_ALL = $(OBJECTS_DEBUG) $(OBJECTS_RELEASE) $(OBJECTS_TEST) + +-all: output/libFColladaSD.a output/libFColladaSR.a install ++all: output/libFColladaSR.a install + + output_dirs: + bash -c 'mkdir -p output/{debug,release,test}/{FCollada/{FCDocument,FMath,FUtils,FColladaTest/{FCTestAssetManagement,FCTestExportImport,FCTestXRef}},FColladaPlugins/FArchiveXML}' +@@ -244,8 +244,7 @@ output/libFColladaSR.a: $(OBJECTS_RELEAS + output/FColladaTest: $(OBJECTS_TEST) | output_dirs + $(CXX) -o $@ $(LDFLAGS) $(OBJECTS_TEST) $(LIBS) + +-install: output/libFColladaSD.a output/libFColladaSR.a +- cp output/libFColladaSD.a ../lib/libFColladaSD.a ++install: output/libFColladaSR.a + cp output/libFColladaSR.a ../lib/libFColladaSR.a + + dfile = $(@:.o=.d) diff --git a/srcpkgs/0ad/patches/template-misuse.patch b/srcpkgs/0ad/patches/template-misuse.patch new file mode 100644 index 00000000000..7ae376ff1fe --- /dev/null +++ b/srcpkgs/0ad/patches/template-misuse.patch @@ -0,0 +1,43 @@ +Index: libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FAXPhysicsExport.cpp +=================================================================== +--- libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FAXPhysicsExport.cpp.orig ++++ libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FAXPhysicsExport.cpp +@@ -329,16 +329,3 @@ void FArchiveXML::WritePhysicsRigidBodyP + FArchiveXML::LetWriteObject(physicsRigidBodyParameters->GetPhysicsShape(i), techniqueNode); + } + } +- +-template +-xmlNode* FArchiveXML::AddPhysicsParameter(xmlNode* parentNode, const char* name, FCDParameterAnimatableT& value) +-{ +- xmlNode* paramNode = AddChild(parentNode, name); +- AddContent(paramNode, FUStringConversion::ToString((TYPE&) value)); +- if (value.IsAnimated()) +- { +- const FCDAnimated* animated = value.GetAnimated(); +- FArchiveXML::WriteAnimatedValue(animated, paramNode, name); +- } +- return paramNode; +-} +Index: libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FArchiveXML.h +=================================================================== +--- libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FArchiveXML.h.orig ++++ libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FArchiveXML.h +@@ -573,4 +573,17 @@ public: + static xmlNode* WriteLibrary(FCDLibrary* library, xmlNode* node); + }; + ++template ++xmlNode* FArchiveXML::AddPhysicsParameter(xmlNode* parentNode, const char* name, FCDParameterAnimatableT& value) ++{ ++ xmlNode* paramNode = AddChild(parentNode, name); ++ AddContent(paramNode, FUStringConversion::ToString((TYPE&) value)); ++ if (value.IsAnimated()) ++ { ++ const FCDAnimated* animated = value.GetAnimated(); ++ FArchiveXML::WriteAnimatedValue(animated, paramNode, name); ++ } ++ return paramNode; ++} ++ + #endif //_FCPARCHIVECOLLADA_H_