commit: bbb69c0f35c0fc985c50282bd5fb7c9b98d9080b Author: Alfredo Tupone <tupone <AT> gentoo <DOT> org> AuthorDate: Thu Jan 25 06:49:34 2024 +0000 Commit: Alfredo Tupone <tupone <AT> gentoo <DOT> org> CommitDate: Thu Jan 25 06:49:55 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bbb69c0f
media-libs/glm: add 1.0.0 Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org> media-libs/glm/Manifest | 1 + media-libs/glm/files/glm-1.0.0-clang.patch | 19 +++++++++ media-libs/glm/glm-1.0.0.ebuild | 62 ++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+) diff --git a/media-libs/glm/Manifest b/media-libs/glm/Manifest index b2981f94c415..b9db1fa2e0bf 100644 --- a/media-libs/glm/Manifest +++ b/media-libs/glm/Manifest @@ -1 +1,2 @@ DIST glm-0.9.9.8.tar.gz 4368032 BLAKE2B 41e4d4a9fbd75c6c6717e43b6a6ae09bb7da3b4b2ee7c5b04308f3aa875b306638b638aca3e457c039845c489fcf0716a080ec2166bf5e9db93c25944f4ba81a SHA512 9484b0c12175414237c5b9486a2990099b1cb727e442f25ecda18b081aa661f7e92a44481f642989553cd3da7992a773441ee5688991bd539ce19fb66a5ce9e8 +DIST glm-1.0.0.tar.gz 4523789 BLAKE2B 66c26067085bd5878dc1f6e473c1c8449d2a609351ababd8f893010983b9e20dae8e7cb2c9a4469b7e46592b7d350fda75e2975676b8696288065a7b776a21a5 SHA512 62e22002a6369a54e1f0ee2885a65f2780af7d2a446573e5387b81518f5dc7e8076053837cb99ae850a0166ce8b0f077bed009e8986d9884d01c456ce467553f diff --git a/media-libs/glm/files/glm-1.0.0-clang.patch b/media-libs/glm/files/glm-1.0.0-clang.patch new file mode 100644 index 000000000000..0223129f6c04 --- /dev/null +++ b/media-libs/glm/files/glm-1.0.0-clang.patch @@ -0,0 +1,19 @@ +--- a/CMakeLists.txt 2024-01-25 07:39:25.528947981 +0100 ++++ b/CMakeLists.txt 2024-01-25 07:39:45.377618695 +0100 +@@ -241,7 +241,7 @@ + endif() + + if(NOT GLM_DISABLE_AUTO_DETECTION) +- add_compile_options(-Werror -Weverything) ++ add_compile_options(-Weverything) + endif() + # add_compile_options(-Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-c++11-long-long -Wno-padded -Wno-gnu-anonymous-struct -Wno-nested-anon-types) + # add_compile_options(-Wno-undefined-reinterpret-cast -Wno-sign-conversion -Wno-unused-variable -Wno-missing-prototypes -Wno-unreachable-code -Wno-missing-variable-declarations -Wno-sign-compare -Wno-global-constructors -Wno-unused-macros -Wno-format-nonliteral -Wno-float-equal) +@@ -252,7 +252,6 @@ + endif() + + if(NOT GLM_DISABLE_AUTO_DETECTION) +- add_compile_options(-Werror) + # add_compile_options(-Wpedantic) + # add_compile_options(-Wall) + # add_compile_options(-Wextra) diff --git a/media-libs/glm/glm-1.0.0.ebuild b/media-libs/glm/glm-1.0.0.ebuild new file mode 100644 index 000000000000..5138d21e6371 --- /dev/null +++ b/media-libs/glm/glm-1.0.0.ebuild @@ -0,0 +1,62 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake flag-o-matic + +DESCRIPTION="OpenGL Mathematics" +HOMEPAGE="http://glm.g-truc.net/" +SRC_URI="https://github.com/g-truc/glm/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="|| ( HappyBunny MIT )" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86" +IUSE="test cpu_flags_x86_sse2 cpu_flags_x86_sse3 cpu_flags_x86_avx cpu_flags_x86_avx2" +RESTRICT="!test? ( test )" + +PATCHES=( + "${FILESDIR}"/${PN}-0.9.9.6-simd.patch + "${FILESDIR}"/${P}-clang.patch + "${FILESDIR}"/${PN}-0.9.9.8-big-endian-tests.patch +) + +src_configure() { + # Header-only library + if use test; then + # See https://github.com/g-truc/glm/pull/1087 + # https://bugs.gentoo.org/818235 + test-flag-CXX -fno-ipa-modref && append-cxxflags -fno-ipa-modref + + local mycmakeargs=( + -DGLM_TEST_ENABLE=ON + -DGLM_TEST_ENABLE_SIMD_SSE2="$(usex cpu_flags_x86_sse2 ON OFF)" + -DGLM_TEST_ENABLE_SIMD_SSE3="$(usex cpu_flags_x86_sse3 ON OFF)" + -DGLM_TEST_ENABLE_SIMD_AVX="$(usex cpu_flags_x86_avx ON OFF)" + -DGLM_TEST_ENABLE_SIMD_AVX2="$(usex cpu_flags_x86_avx2 ON OFF)" + ) + cmake_src_configure + fi + + sed \ + -e "s:@CMAKE_INSTALL_PREFIX@:${EPREFIX}/usr:" \ + -e "s:@GLM_VERSION@:$(ver_cut 1-3):" \ + "${FILESDIR}"/glm.pc.in \ + > "${BUILD_DIR}/glm.pc" || die +} + +src_compile() { + # Header-only library + if use test; then + cmake_src_compile + fi +} + +src_install() { + doheader -r glm + insinto /usr/share/pkgconfig + doins "${BUILD_DIR}/glm.pc" + insinto /usr/share + doins -r cmake + dodoc readme.md manual.md +}