1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-18 00:10:04 +00:00

math/glm: update 0.9.9.8 → 1.0.1

Some parts of glm were retroactively marked as experimental, and using
now leads to a compile error - added override for this error to consumers
which need it.
This commit is contained in:
Dmitry Marakasov 2024-03-01 21:13:40 +03:00
parent ec9a6fbd48
commit b35bdcd8fa
14 changed files with 122 additions and 44 deletions

View File

@ -20,4 +20,6 @@ USE_QT= buildtools:build qmake:build core gui opengl widgets
CMAKE_ARGS= -DQT_VERSION:STRING=5
CXXFLAGS+= -DGLM_ENABLE_EXPERIMENTAL # GLM_GTX_transform is an experimental extension
.include <bsd.port.mk>

View File

@ -40,6 +40,8 @@ CMAKE_OFF= AQUARIA_INTERNAL_FREETYPE \
LDFLAGS+= -Wl,--as-needed # avoid overlinking (vorbis deps)
LDFLAGS_i386= -Wl,-z,notext -Wl,--no-check-dynamic-relocations
CXXFLAGS+= -DGLM_ENABLE_EXPERIMENTAL # GLM_GTX_transform is an experimental extension
DESKTOP_ENTRIES="${GH_PROJECT}" \
"" \
"${DATADIR}/${PORTNAME}.png" \

View File

@ -33,6 +33,8 @@ CONFIGURE_ENV= LOCALBASE="${LOCALBASE}"
LDFLAGS_i386= -Wl,-znotext
CXXFLAGS+= -DGLM_ENABLE_EXPERIMENTAL # GLM_GTX_rotate_vector is an experimental extension
PORTDOCS= *
PORTDATA= *

View File

@ -29,6 +29,8 @@ USE_SDL= sdl2 ttf2 image2
USE_GL= gl glu
USE_LDCONFIG= yes
CXXFLAGS+= -DGLM_ENABLE_EXPERIMENTAL # GLM_GTX_matrix_transform_2d is an experimental extension
OPTIONS_DEFINE= LUAJIT
OPTIONS_DEFAULT_amd64= LUAJIT
OPTIONS_DEFAULT_i386= LUAJIT

View File

@ -24,4 +24,6 @@ INSTALL_TARGET= install-strip
PLIST_SUB= VERSION=${PORTVERSION:R}
CXXFLAGS+= -DGLM_ENABLE_EXPERIMENTAL # uses experimental extensions when checking for glm in configure
.include <bsd.port.mk>

View File

@ -1,20 +1,20 @@
PORTNAME= glm
PORTVERSION= 0.9.9.8
PORTVERSION= 1.0.1
PORTEPOCH= 1
CATEGORIES= math graphics
MAINTAINER= amdmi3@FreeBSD.org
COMMENT= C++ mathematics library for software based on the OpenGL GLSL
WWW= https://glm.g-truc.net/
WWW= https://github.com/g-truc/glm
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/copying.txt
USES= cmake compiler:c++11-lang pkgconfig
USE_GITHUB= yes
GH_ACCOUNT= g-truc
NO_ARCH= yes
SUB_FILES= glm.pc
CMAKE_OFF= GLM_BUILD_LIBRARY
PORTDOCS= *
@ -22,18 +22,4 @@ OPTIONS_DEFINE= TEST DOCS
TEST_CMAKE_BOOL= GLM_TEST_ENABLE
TEST_TEST_TARGET= test
post-patch:
@${REINPLACE_CMD} -e '/printf/ s|EndTime - StartTime|static_cast<long>(&)|' \
${WRKSRC}/test/core/core_func_matrix.cpp
do-install:
@cd ${WRKSRC} && ${COPYTREE_SHARE} "glm" ${STAGEDIR}${PREFIX}/include \
"-not -name CMakeLists.txt"
@${MKDIR} ${STAGEDIR}${PREFIX}/lib/cmake/glm
${INSTALL_DATA} ${WRKSRC}/cmake/glm/*.cmake ${STAGEDIR}${PREFIX}/lib/cmake/glm
${INSTALL_DATA} ${WRKDIR}/glm.pc ${STAGEDIR}${PREFIX}/libdata/pkgconfig
do-install-DOCS-on:
@cd ${WRKSRC} && ${COPYTREE_SHARE} "doc *.md" ${STAGEDIR}${DOCSDIR}
.include <bsd.port.mk>

View File

@ -1,3 +1,3 @@
TIMESTAMP = 1615332075
SHA256 (g-truc-glm-0.9.9.8_GH0.tar.gz) = 7d508ab72cb5d43227a3711420f06ff99b0a0cb63ee2f93631b162bfe1fe9592
SIZE (g-truc-glm-0.9.9.8_GH0.tar.gz) = 4368032
TIMESTAMP = 1709055434
SHA256 (g-truc-glm-1.0.1_GH0.tar.gz) = 9f3174561fd26904b23f0db5e560971cbf9b3cbda0b280f04d5c379d03bf234c
SIZE (g-truc-glm-1.0.1_GH0.tar.gz) = 4567161

View File

@ -1,7 +0,0 @@
prefix=%%PREFIX%%
includedir=${prefix}/include
Name: GLM
Description: OpenGL Mathematics
Version: 0.9.8
Cflags: -I${includedir}

View File

@ -1,11 +0,0 @@
--- glm/ext/quaternion_common.inl.orig 2020-04-13 17:41:16 UTC
+++ glm/ext/quaternion_common.inl
@@ -104,7 +104,7 @@ namespace glm
{
// Graphics Gems III, page 96
T angle = acos(cosTheta);
- T phi = angle + k * glm::pi<T>();
+ T phi = angle + static_cast<T>(k) * glm::pi<T>();
return (sin(angle - a * phi)* x + sin(a * phi) * z) / sin(angle);
}
}

View File

@ -0,0 +1,60 @@
This is needed to fix x11-wm/gamescope with glm 1.0.1
https://github.com/g-truc/glm/issues/1269
--- glm/gtx/bit.hpp.orig 2024-02-27 17:19:47 UTC
+++ glm/gtx/bit.hpp
@@ -46,7 +46,7 @@ namespace glm
/// @see gtc_round
/// @see gtx_bit
template<typename genIUType>
- GLM_DEPRECATED GLM_FUNC_DECL genIUType powerOfTwoAbove(genIUType Value);
+ GLM_FUNC_DECL genIUType powerOfTwoAbove(genIUType Value);
/// Return the power of two number which value is just higher the input value.
/// Deprecated, use ceilPowerOfTwo from GTC_round instead
@@ -54,7 +54,7 @@ namespace glm
/// @see gtc_round
/// @see gtx_bit
template<length_t L, typename T, qualifier Q>
- GLM_DEPRECATED GLM_FUNC_DECL vec<L, T, Q> powerOfTwoAbove(vec<L, T, Q> const& value);
+ GLM_FUNC_DECL vec<L, T, Q> powerOfTwoAbove(vec<L, T, Q> const& value);
/// Return the power of two number which value is just lower the input value.
/// Deprecated, use floorPowerOfTwo from GTC_round instead
@@ -62,7 +62,7 @@ namespace glm
/// @see gtc_round
/// @see gtx_bit
template<typename genIUType>
- GLM_DEPRECATED GLM_FUNC_DECL genIUType powerOfTwoBelow(genIUType Value);
+ GLM_FUNC_DECL genIUType powerOfTwoBelow(genIUType Value);
/// Return the power of two number which value is just lower the input value.
/// Deprecated, use floorPowerOfTwo from GTC_round instead
@@ -70,7 +70,7 @@ namespace glm
/// @see gtc_round
/// @see gtx_bit
template<length_t L, typename T, qualifier Q>
- GLM_DEPRECATED GLM_FUNC_DECL vec<L, T, Q> powerOfTwoBelow(vec<L, T, Q> const& value);
+ GLM_FUNC_DECL vec<L, T, Q> powerOfTwoBelow(vec<L, T, Q> const& value);
/// Return the power of two number which value is the closet to the input value.
/// Deprecated, use roundPowerOfTwo from GTC_round instead
@@ -78,7 +78,7 @@ namespace glm
/// @see gtc_round
/// @see gtx_bit
template<typename genIUType>
- GLM_DEPRECATED GLM_FUNC_DECL genIUType powerOfTwoNearest(genIUType Value);
+ GLM_FUNC_DECL genIUType powerOfTwoNearest(genIUType Value);
/// Return the power of two number which value is the closet to the input value.
/// Deprecated, use roundPowerOfTwo from GTC_round instead
@@ -86,7 +86,7 @@ namespace glm
/// @see gtc_round
/// @see gtx_bit
template<length_t L, typename T, qualifier Q>
- GLM_DEPRECATED GLM_FUNC_DECL vec<L, T, Q> powerOfTwoNearest(vec<L, T, Q> const& value);
+ GLM_FUNC_DECL vec<L, T, Q> powerOfTwoNearest(vec<L, T, Q> const& value);
/// @}
} //namespace glm

View File

@ -0,0 +1,19 @@
--- test/CMakeLists.txt.orig 2024-02-27 17:19:47 UTC
+++ test/CMakeLists.txt
@@ -11,7 +11,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
endif()
if(NOT GLM_DISABLE_AUTO_DETECTION)
- add_compile_options(-Werror -Weverything)
+ add_compile_options(-Weverything)
endif()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
@@ -20,7 +20,6 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
endif()
if(NOT GLM_DISABLE_AUTO_DETECTION)
- add_compile_options(-Werror)
# add_compile_options(-Wpedantic)
# add_compile_options(-Wall)
# add_compile_options(-Wextra)

View File

@ -0,0 +1,11 @@
--- test/core/core_func_matrix.cpp.orig 2024-02-27 17:19:47 UTC
+++ test/core/core_func_matrix.cpp
@@ -392,7 +392,7 @@ static int test_inverse_perf(std::size_t Count, std::s
//glm::uint Ulp = 0;
//Ulp = glm::max(glm::float_distance(*Dst, *Src), Ulp);
- std::printf("inverse<%s>(%f): %lu\n", Message, static_cast<double>(Diff), EndTime - StartTime);
+ std::printf("inverse<%s>(%f): %lu\n", Message, static_cast<double>(Diff), (unsigned long)(EndTime - StartTime));
return 0;
}

View File

@ -6,6 +6,7 @@ include/glm/detail/_swizzle.hpp
include/glm/detail/_swizzle_func.hpp
include/glm/detail/_vectorize.hpp
include/glm/detail/compute_common.hpp
include/glm/detail/compute_vector_decl.hpp
include/glm/detail/compute_vector_relational.hpp
include/glm/detail/func_common.inl
include/glm/detail/func_common_simd.inl
@ -62,6 +63,7 @@ include/glm/detail/type_vec4.inl
include/glm/detail/type_vec4_simd.inl
include/glm/exponential.hpp
include/glm/ext.hpp
include/glm/ext/_matrix_vectorize.hpp
include/glm/ext/matrix_clip_space.hpp
include/glm/ext/matrix_clip_space.inl
include/glm/ext/matrix_common.hpp
@ -120,6 +122,8 @@ include/glm/ext/matrix_int4x3.hpp
include/glm/ext/matrix_int4x3_sized.hpp
include/glm/ext/matrix_int4x4.hpp
include/glm/ext/matrix_int4x4_sized.hpp
include/glm/ext/matrix_integer.hpp
include/glm/ext/matrix_integer.inl
include/glm/ext/matrix_projection.hpp
include/glm/ext/matrix_projection.inl
include/glm/ext/matrix_relational.hpp
@ -170,6 +174,8 @@ include/glm/ext/scalar_integer.hpp
include/glm/ext/scalar_integer.inl
include/glm/ext/scalar_packing.hpp
include/glm/ext/scalar_packing.inl
include/glm/ext/scalar_reciprocal.hpp
include/glm/ext/scalar_reciprocal.inl
include/glm/ext/scalar_relational.hpp
include/glm/ext/scalar_relational.inl
include/glm/ext/scalar_uint_sized.hpp
@ -213,6 +219,8 @@ include/glm/ext/vector_integer.hpp
include/glm/ext/vector_integer.inl
include/glm/ext/vector_packing.hpp
include/glm/ext/vector_packing.inl
include/glm/ext/vector_reciprocal.hpp
include/glm/ext/vector_reciprocal.inl
include/glm/ext/vector_relational.hpp
include/glm/ext/vector_relational.inl
include/glm/ext/vector_uint1.hpp
@ -227,6 +235,7 @@ include/glm/ext/vector_ulp.hpp
include/glm/ext/vector_ulp.inl
include/glm/fwd.hpp
include/glm/geometric.hpp
include/glm/glm.cppm
include/glm/glm.hpp
include/glm/gtc/bitfield.hpp
include/glm/gtc/bitfield.inl
@ -255,7 +264,6 @@ include/glm/gtc/quaternion_simd.inl
include/glm/gtc/random.hpp
include/glm/gtc/random.inl
include/glm/gtc/reciprocal.hpp
include/glm/gtc/reciprocal.inl
include/glm/gtc/round.hpp
include/glm/gtc/round.inl
include/glm/gtc/type_aligned.hpp
@ -344,11 +352,12 @@ include/glm/gtx/normal.inl
include/glm/gtx/normalize_dot.hpp
include/glm/gtx/normalize_dot.inl
include/glm/gtx/number_precision.hpp
include/glm/gtx/number_precision.inl
include/glm/gtx/optimum_pow.hpp
include/glm/gtx/optimum_pow.inl
include/glm/gtx/orthonormalize.hpp
include/glm/gtx/orthonormalize.inl
include/glm/gtx/pca.hpp
include/glm/gtx/pca.inl
include/glm/gtx/perpendicular.hpp
include/glm/gtx/perpendicular.inl
include/glm/gtx/polar_coordinates.hpp
@ -417,6 +426,5 @@ include/glm/vec2.hpp
include/glm/vec3.hpp
include/glm/vec4.hpp
include/glm/vector_relational.hpp
lib/cmake/glm/glmConfig-version.cmake
lib/cmake/glm/glmConfig.cmake
libdata/pkgconfig/glm.pc
%%DATADIR%%/glmConfig.cmake
%%DATADIR%%/glmConfigVersion.cmake

View File

@ -47,6 +47,8 @@ PLIST_FILES= bin/${PORTNAME} \
lib/libVkLayer_FROG_${PORTNAME}_wsi_${MESON_ARCH_FAMILY}.so \
share/vulkan/implicit_layer.d/VkLayer_FROG_${PORTNAME}_wsi.${MESON_ARCH_FAMILY}.json
CXXFLAGS+= -DGLM_ENABLE_EXPERIMENTAL # GLM_GTX_string_cast is an experimental extension
# https://github.com/freebsd/drm-kmod/issues/271
PORTSCOUT= ignore:1