diff options
| author | Guilherme Amadio <amadio@gentoo.org> | 2024-01-30 08:50:29 +0100 |
|---|---|---|
| committer | Guilherme Amadio <amadio@gentoo.org> | 2024-01-30 09:23:57 +0100 |
| commit | d97e7ae35c6151cfd854860b9ae03aa0e9b5f91c (patch) | |
| tree | 35ef06f00d46279a6330cc7404a6515b4f89e7b2 /dev-cpp/jwt-cpp/jwt-cpp-0.7.0.ebuild | |
| parent | 2a1b5b12cae92e28d456ede0ff394e98b3ac3b48 (diff) | |
| download | gentoo-d97e7ae35c6151cfd854860b9ae03aa0e9b5f91c.tar.gz gentoo-d97e7ae35c6151cfd854860b9ae03aa0e9b5f91c.tar.bz2 gentoo-d97e7ae35c6151cfd854860b9ae03aa0e9b5f91c.zip | |
dev-cpp/jwt-cpp: add 0.7.0
Signed-off-by: Guilherme Amadio <amadio@gentoo.org>
Diffstat (limited to 'dev-cpp/jwt-cpp/jwt-cpp-0.7.0.ebuild')
| -rw-r--r-- | dev-cpp/jwt-cpp/jwt-cpp-0.7.0.ebuild | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/dev-cpp/jwt-cpp/jwt-cpp-0.7.0.ebuild b/dev-cpp/jwt-cpp/jwt-cpp-0.7.0.ebuild new file mode 100644 index 000000000000..64f36db0f7dd --- /dev/null +++ b/dev-cpp/jwt-cpp/jwt-cpp-0.7.0.ebuild @@ -0,0 +1,80 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake + +if [[ ${PV} == *9999* ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/Thalhammer/jwt-cpp.git" +else + SRC_URI="https://github.com/Thalhammer/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64 ~x86" +fi + +DESCRIPTION="header only library for creating and validating JSON Web Tokens in C++11" +HOMEPAGE="https://thalhammer.github.io/jwt-cpp/" + +LICENSE="MIT" +SLOT="0" +IUSE="doc +picojson test" + +DEPEND=" + dev-cpp/nlohmann_json + dev-libs/openssl + picojson? ( dev-cpp/picojson ) +" +RDEPEND="${DEPEND}" +BDEPEND=" + doc? ( app-text/doxygen[dot] ) + test? ( dev-cpp/gtest ) +" +RESTRICT=" + !picojson? ( test ) + !test? ( test ) +" + +DOCS=( README.md docs/{faqs,ssl,traits}.md ) + +src_prepare() { + # Unbundle dev-cpp/nlohmann_json. + rm -vrf include/nhlomann || die + # Unbundle dev-cpp/picojson and fix include paths. + # See also: https://github.com/Thalhammer/jwt-cpp/issues/213 + rm -vrf include/picojson || die + find -name '*.h' -type f -print0 | xargs -0 sed -r -e "s:picojson/picojson\.h:picojson.h:g" -i || die + # Prevent installation of bundled dev-cpp/picojson. + sed -i -e 's:^\s*install.*picojson/picojson\.h.*$::' CMakeLists.txt || die + cmake_src_prepare +} + +src_configure() { + local mycmakeargs=( + -DJWT_DISABLE_PICOJSON="$(usex !picojson)" + # Not useful for now, asks for non-existent CMake module. + #-DJWT_EXTERNAL_PICOJSON="$(usex picojson)" + # Examples are not installed and for development only. + -DJWT_BUILD_EXAMPLES=NO + -DJWT_BUILD_TESTS="$(usex test)" + -DJWT_CMAKE_FILES_INSTALL_DIR="${EPREFIX}"/usr/share/cmake + ) + cmake_src_configure +} + +src_compile() { + cmake_src_compile + if use doc; then + doxygen || die + fi +} + +src_test() { + "${BUILD_DIR}"/tests/jwt-cpp-test || die +} + +src_install() { + cmake_src_install + use doc && local HTML_DOCS=(doxy/html/.) + einstalldocs +} |
