Skip to content

Commit

Permalink
dev-libs/tinyxml2: version bump to 4.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
radhermit committed Aug 4, 2016
1 parent aa11a5d commit 3aa4296
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 0 deletions.
1 change: 1 addition & 0 deletions dev-libs/tinyxml2/Manifest
Original file line number Diff line number Diff line change
@@ -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
30 changes: 30 additions & 0 deletions dev-libs/tinyxml2/files/tinyxml2-4.0.1-optional-tests.patch
Original file line number Diff line number Diff line change
@@ -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})
endif()

-add_executable(xmltest xmltest.cpp)
-if(BUILD_SHARED_LIBS)
- add_dependencies(xmltest tinyxml2)
- add_dependencies(xmltest ${TARGET_DATA_COPY})
- target_link_libraries(xmltest tinyxml2)
-else(BUILD_STATIC_LIBS)
- add_dependencies(xmltest tinyxml2_static)
- add_dependencies(xmltest ${TARGET_DATA_COPY})
- target_link_libraries(xmltest tinyxml2_static)
+set(BUILD_TEST OFF CACHE BOOL "Set to ON to build tests")
+if(BUILD_TEST)
+ add_executable(xmltest xmltest.cpp)
+ if(BUILD_SHARED_LIBS)
+ add_dependencies(xmltest tinyxml2)
+ add_dependencies(xmltest ${TARGET_DATA_COPY})
+ target_link_libraries(xmltest tinyxml2)
+ else(BUILD_STATIC_LIBS)
+ add_dependencies(xmltest tinyxml2_static)
+ add_dependencies(xmltest ${TARGET_DATA_COPY})
+ target_link_libraries(xmltest tinyxml2_static)
+ endif()
endif()
install(TARGETS DESTINATION ${CMAKE_INSTALL_BINDIR})

11 changes: 11 additions & 0 deletions dev-libs/tinyxml2/files/tinyxml2-4.0.1-xmltest.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- tinyxml2-4.0.1/xmltest.cpp
+++ tinyxml2-4.0.1/xmltest.cpp
@@ -1618,7 +1618,7 @@

FILE* perfFP = fopen("resources/dream.xml", "r");
fseek(perfFP, 0, SEEK_END);
- long size = ftell(fp);
+ long size = ftell(perfFP);
fseek(perfFP, 0, SEEK_SET);

char* mem = new char[size + 1];
34 changes: 34 additions & 0 deletions dev-libs/tinyxml2/tinyxml2-4.0.1.ebuild
Original file line number Diff line number Diff line change
@@ -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"
}

0 comments on commit 3aa4296

Please sign in to comment.