diff options
author | Peter Asplund <peter.azp@gmail.com> | 2023-03-30 21:29:02 +0200 |
---|---|---|
committer | Peter Asplund <peter.azp@gmail.com> | 2023-03-30 21:29:55 +0200 |
commit | c8b3475d0e967981dc10fbdee84207b47ff786c8 (patch) | |
tree | 6e321c9a710a51c58701bd0facc7ee8328645b66 | |
parent | dev-games/tiled: (diff) | |
download | AzP-c8b3475d0e967981dc10fbdee84207b47ff786c8.tar.gz AzP-c8b3475d0e967981dc10fbdee84207b47ff786c8.tar.bz2 AzP-c8b3475d0e967981dc10fbdee84207b47ff786c8.zip |
dev-games/tmxparser: new package, add 9999
Signed-off-by: Peter Asplund <peter.azp@gmail.com>
-rw-r--r-- | dev-games/tmxparser/Manifest | 1 | ||||
-rw-r--r-- | dev-games/tmxparser/files/tmxparser-fix-build-flags.patch | 25 | ||||
-rw-r--r-- | dev-games/tmxparser/files/tmxparser-replace-deprecated-cpp.patch | 26 | ||||
-rw-r--r-- | dev-games/tmxparser/metadata.xml | 14 | ||||
-rw-r--r-- | dev-games/tmxparser/tmxparser-9999.ebuild | 54 |
5 files changed, 120 insertions, 0 deletions
diff --git a/dev-games/tmxparser/Manifest b/dev-games/tmxparser/Manifest new file mode 100644 index 0000000..838f4be --- /dev/null +++ b/dev-games/tmxparser/Manifest @@ -0,0 +1 @@ +DIST tmxparser.git 231167 BLAKE2B f5d0b4f487700870f22e31362c763d2e58a6d82aa0e42ee1390b77fd900903d5bf5be533f12e4e243e40e433ad7c0fb3e591546bab4b98bdb2bbfa59087df88c SHA512 8a6f68cbc0e57956717acf52a5ddb300ee3454c6be6074cc9e2b242aa40aca2b34a22c0d92779d6dc2bc9f9541448e3aa97eb41f057280091f8cd67354b9c4a0 diff --git a/dev-games/tmxparser/files/tmxparser-fix-build-flags.patch b/dev-games/tmxparser/files/tmxparser-fix-build-flags.patch new file mode 100644 index 0000000..b6ab2d6 --- /dev/null +++ b/dev-games/tmxparser/files/tmxparser-fix-build-flags.patch @@ -0,0 +1,25 @@ +commit 332cf98e3e0d8b72c0fe025e910af22f66ef5507 +Author: Peter Asplund <peter.azp@gmail.com> +Date: Wed Mar 1 12:16:40 2023 +0100 + + Remove build flags that are redundant for C++ + + These are: + strict-prototypes, missing-prototypes, old-style-definition + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 69a0df0..3e396e2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -102,10 +102,7 @@ target_include_directories(tmxparser PUBLIC + + target_compile_options(tmxparser + PRIVATE -pedantic +- PRIVATE -Wall +- PRIVATE -Werror=strict-prototypes +- PRIVATE -Werror=old-style-definition +- PRIVATE -Werror=missing-prototypes) ++ PRIVATE -Wall) + if(NOT USE_MINIZ) + target_compile_options(tmxparser + PRIVATE -Werror) diff --git a/dev-games/tmxparser/files/tmxparser-replace-deprecated-cpp.patch b/dev-games/tmxparser/files/tmxparser-replace-deprecated-cpp.patch new file mode 100644 index 0000000..d527895 --- /dev/null +++ b/dev-games/tmxparser/files/tmxparser-replace-deprecated-cpp.patch @@ -0,0 +1,26 @@ +commit 08b62eae9f0b249c667dba7f6a964da8e3a82377 +Author: Peter Asplund <peter.azp@gmail.com> +Date: Tue Feb 28 22:39:07 2023 +0100 + + Convert deprecated call to ptr_fun to lambda + +diff --git a/src/TmxUtil.cpp b/src/TmxUtil.cpp +index 26993c7..184842d 100644 +--- a/src/TmxUtil.cpp ++++ b/src/TmxUtil.cpp +@@ -46,13 +46,13 @@ namespace Tmx { + + // trim from start + static inline std::string <rim(std::string &s) { +- s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(std::isspace)))); ++ s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](int c){ return !std::isspace(c); })); + return s; + } + + // trim from end + static inline std::string &rtrim(std::string &s) { +- s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end()); ++ s.erase(std::find_if(s.rbegin(), s.rend(), [](int c){ return !std::isspace(c); }).base(), s.end()); + return s; + } + diff --git a/dev-games/tmxparser/metadata.xml b/dev-games/tmxparser/metadata.xml new file mode 100644 index 0000000..708f61b --- /dev/null +++ b/dev-games/tmxparser/metadata.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>none@gentoo.org</email> + <name>MAINTAINER WANTED</name> + </maintainer> + <use> + <flag name="miniz">Use internal header-only miniz instead of zlib</flag> + </use> + <upstream> + <remote-id type="github">sainteos/tmxparser.git</remote-id> + </upstream> +</pkgmetadata> diff --git a/dev-games/tmxparser/tmxparser-9999.ebuild b/dev-games/tmxparser/tmxparser-9999.ebuild new file mode 100644 index 0000000..3af6c16 --- /dev/null +++ b/dev-games/tmxparser/tmxparser-9999.ebuild @@ -0,0 +1,54 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +# The swig fork is required for compatibility with both provided and +# 3rd-party Python scripts. Required patch was sent to upstream in +# 2014: https://github.com/swig/swig/pull/251 + +DOCS_BUILDER="doxygen" +inherit cmake docs git-r3 + +DESCRIPTION="A library for parsing tmx files" +HOMEPAGE="https://github.com/sainteos/tmxparser.git" +SRC_URI="https://github.com/sainteos/tmxparser.git" +EGIT_REPO_URI="https://github.com/sainteos/tmxparser.git" + +LICENSE="MIT" +SLOT="0" +IUSE="miniz test" +REQUIRED_USE="" +RESTRICT="!test? ( test )" + +# Uses internal header-only miniz.c +RDEPEND=" + !miniz? ( sys-libs/zlib ) + >=dev-libs/tinyxml2-6.0.0 +" +DEPEND="${RDEPEND}" +BDEPEND="" + +PATCHES=( + "${FILESDIR}"/${PN}-replace-deprecated-cpp.patch + "${FILESDIR}"/${PN}-fix-build-flags.patch +) + +src_configure() { + local mycmakeargs=( + -DUSE_MINIZ=$(use miniz) + -DBUILD_SHARED_LIBS=ON + -DBUILD_TINYXML2=OFF + -DBUILD_TESTS=$(use test) + -DBUILD_DOCS=$(use doc) + ) + + cmake_src_configure +} + +src_compile() { + cmake_src_compile + + # Automatically exits if useflag docs is not set + docs_compile +} |