dev-libs/tinyxml2: version bump to 4.0.1
authorTim Harder <radhermit@gentoo.org>
Thu, 4 Aug 2016 03:49:14 +0000 (23:49 -0400)
committerTim Harder <radhermit@gentoo.org>
Thu, 4 Aug 2016 03:52:26 +0000 (23:52 -0400)
dev-libs/tinyxml2/Manifest
dev-libs/tinyxml2/files/tinyxml2-4.0.1-optional-tests.patch [new file with mode: 0644]
dev-libs/tinyxml2/files/tinyxml2-4.0.1-xmltest.patch [new file with mode: 0644]
dev-libs/tinyxml2/tinyxml2-4.0.1.ebuild [new file with mode: 0644]

index 6edb19da951296df2d8438c10d753c159dbf4a28..f98ef54109c8d33ce94aaf50c1eda50e607b75be 100644 (file)
@@ -1,2 +1,3 @@
 DIST tinyxml2-1.0.9_p20121123.tar.bz2 91204 SHA256 894b6b1136c86cc98bff77892ca077726b470432e871ca8c8c605177047272ea SHA512 054342b51141771c7611ae5aeb6ea332c42dff603aa6747f802d02bd010cad4b5c84fadf976576d2a604f1cccc7afe95ff23682a98c9294b032c94aa48b09aaf WHIRLPOOL 9aa505e7794b1fe1919b185d2080e63f3b01f44d2daeba94b7da6701f4931ec9188c0f92c9db9c6e8ac02772ef85f582b3a5d64227fd7b353da0a258c8a72eb7
 DIST tinyxml2-2.2.0.tar.gz 455226 SHA256 f891224f32e7a06bf279290619cec80cc8ddc335c13696872195ffb87f5bce67 SHA512 e06edb46f96dcc58cf16c8fef91dd072c9bd6dd296bb9ba3e082db059438f5f31e0689015deee7f1c390788d9bd0e64b6f5c0235c9d2839419ee2ab1784f53c4 WHIRLPOOL 6310e1492b180cc1a74f856dbf78897c5db7777d44ffd5ef785f85fb87a91462479a9da006d93ad7157763416863ed623b14cfc8d99f35494335de7252cda754
+DIST tinyxml2-4.0.1.tar.gz 344295 SHA256 14b38ef25cc136d71339ceeafb4856bb638d486614103453eccd323849267f20 SHA512 4add31a72c62b3f68bdb17fb90630bc51bf96b616f4beafb413082dc77bc699b8d516fa0955d001d5d69bc3371b7ca9ce5cd9696d91dd913b09a1c10681b819e WHIRLPOOL 76fd8f6d15f73845b1051385aaff64d33263639cc630eaaf2563d6f1c3fca1ffae277d7c540197c6eee65ac4429ac6f1f0541ab99520cf809afd655fbdacc9ab
diff --git a/dev-libs/tinyxml2/files/tinyxml2-4.0.1-optional-tests.patch b/dev-libs/tinyxml2/files/tinyxml2-4.0.1-optional-tests.patch
new file mode 100644 (file)
index 0000000..95e849f
--- /dev/null
@@ -0,0 +1,30 @@
+--- tinyxml2-4.0.1/CMakeLists.txt
++++ tinyxml2-4.0.1/CMakeLists.txt
+@@ -100,15 +100,18 @@
+         ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})\r
+ endif()\r
+ \r
+-add_executable(xmltest xmltest.cpp)\r
+-if(BUILD_SHARED_LIBS)\r
+-   add_dependencies(xmltest tinyxml2)\r
+-   add_dependencies(xmltest ${TARGET_DATA_COPY})\r
+-   target_link_libraries(xmltest tinyxml2)\r
+-else(BUILD_STATIC_LIBS)\r
+-   add_dependencies(xmltest tinyxml2_static)\r
+-   add_dependencies(xmltest ${TARGET_DATA_COPY})\r
+-   target_link_libraries(xmltest tinyxml2_static)\r
++set(BUILD_TEST OFF CACHE BOOL "Set to ON to build tests")\r
++if(BUILD_TEST)\r
++      add_executable(xmltest xmltest.cpp)\r
++      if(BUILD_SHARED_LIBS)\r
++              add_dependencies(xmltest tinyxml2)\r
++              add_dependencies(xmltest ${TARGET_DATA_COPY})\r
++              target_link_libraries(xmltest tinyxml2)\r
++      else(BUILD_STATIC_LIBS)\r
++              add_dependencies(xmltest tinyxml2_static)\r
++              add_dependencies(xmltest ${TARGET_DATA_COPY})\r
++              target_link_libraries(xmltest tinyxml2_static)\r
++      endif()\r
+ endif()\r
+ install(TARGETS DESTINATION ${CMAKE_INSTALL_BINDIR})\r
+ \r
diff --git a/dev-libs/tinyxml2/files/tinyxml2-4.0.1-xmltest.patch b/dev-libs/tinyxml2/files/tinyxml2-4.0.1-xmltest.patch
new file mode 100644 (file)
index 0000000..94b2668
--- /dev/null
@@ -0,0 +1,11 @@
+--- tinyxml2-4.0.1/xmltest.cpp
++++ tinyxml2-4.0.1/xmltest.cpp
+@@ -1618,7 +1618,7 @@
+ \r
+               FILE* perfFP = fopen("resources/dream.xml", "r");\r
+               fseek(perfFP, 0, SEEK_END);\r
+-              long size = ftell(fp);\r
++              long size = ftell(perfFP);\r
+               fseek(perfFP, 0, SEEK_SET);\r
+ \r
+               char* mem = new char[size + 1];\r
diff --git a/dev-libs/tinyxml2/tinyxml2-4.0.1.ebuild b/dev-libs/tinyxml2/tinyxml2-4.0.1.ebuild
new file mode 100644 (file)
index 0000000..be95959
--- /dev/null
@@ -0,0 +1,34 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit cmake-utils
+
+DESCRIPTION="A simple, small, efficient, C++ XML parser"
+HOMEPAGE="http://www.grinninglizard.com/tinyxml2/ https://github.com/leethomason/tinyxml2/"
+SRC_URI="https://github.com/leethomason/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="ZLIB"
+SLOT="0/4"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="static-libs test"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-optional-tests.patch
+       "${FILESDIR}"/${P}-xmltest.patch
+)
+
+src_configure() {
+       local mycmakeargs=(
+               -DBUILD_STATIC_LIBS=$(usex static-libs)
+               -DBUILD_TEST=$(usex test)
+       )
+       cmake-utils_src_configure
+}
+
+src_test() {
+       cmake-utils_src_test
+       ./xmltest || die "Tests failed"
+}