mirror of
https://github.com/void-linux/void-packages.git
synced 2025-09-06 03:53:18 +02:00
glm: update to 1.0.1.
This commit is contained in:
parent
d71570e1b0
commit
f399af49c4
6 changed files with 244 additions and 194 deletions
|
@ -1,7 +0,0 @@
|
||||||
prefix=/usr
|
|
||||||
includedir=${prefix}/include
|
|
||||||
|
|
||||||
Name: GLM
|
|
||||||
Description: OpenGL Mathematics
|
|
||||||
Version: 0.9.9.6
|
|
||||||
Cflags: -I${includedir}
|
|
|
@ -1,39 +1,21 @@
|
||||||
Taken from Adélie Linux.
|
diff --git a/glm/gtc/packing.inl b/glm/gtc/packing.inl
|
||||||
|
index 1792760..1c60f5a 100644
|
||||||
--- glm-0.9.9.0/test/gtc/gtc_packing.cpp
|
--- a/glm/gtc/packing.inl
|
||||||
+++ glm-0.9.9.0/test/gtc/gtc_packing.cpp
|
+++ b/glm/gtc/packing.inl
|
||||||
@@ -3,6 +3,7 @@
|
@@ -10,6 +10,10 @@
|
||||||
#include <glm/gtc/epsilon.hpp>
|
|
||||||
#include <cstdio>
|
|
||||||
#include <vector>
|
|
||||||
+#include <arpa/inet.h>
|
|
||||||
|
|
||||||
void print_bits(float const& s)
|
|
||||||
{
|
|
||||||
@@ -155,7 +156,7 @@
|
|
||||||
|
|
||||||
glm::u8vec4 const v0(0xff, 0x77, 0x0, 0x33);
|
|
||||||
glm::uint32 const p0 = *reinterpret_cast<glm::uint32 const*>(&v0[0]);
|
|
||||||
- glm::uint32 const r0 = 0x330077ff;
|
|
||||||
+ glm::uint32 const r0 = htonl(0xff770033);
|
|
||||||
|
|
||||||
Error += p0 == r0 ? 0 : 1;
|
|
||||||
|
|
||||||
--- glm-0.9.9.0/glm/gtc/packing.inl
|
|
||||||
+++ glm-0.9.9.0/glm/gtc/packing.inl
|
|
||||||
@@ -9,6 +9,9 @@
|
|
||||||
#include "../detail/type_half.hpp"
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
||||||
+extern "C" {
|
+extern "C" {
|
||||||
+#include <endian.h>
|
+#include <endian.h>
|
||||||
+}
|
+}
|
||||||
|
+
|
||||||
namespace glm{
|
namespace glm{
|
||||||
namespace detail
|
namespace detail
|
||||||
@@ -183,9 +186,15 @@
|
{
|
||||||
|
@@ -190,9 +194,15 @@ namespace detail
|
||||||
{
|
{
|
||||||
struct
|
struct Data
|
||||||
{
|
{
|
||||||
+#if BYTE_ORDER == LITTLE_ENDIAN
|
+#if BYTE_ORDER == LITTLE_ENDIAN
|
||||||
uint x : 3;
|
uint x : 3;
|
||||||
|
@ -47,9 +29,9 @@ Taken from Adélie Linux.
|
||||||
} data;
|
} data;
|
||||||
uint8 pack;
|
uint8 pack;
|
||||||
};
|
};
|
||||||
@@ -194,8 +203,13 @@
|
@@ -201,8 +211,13 @@ namespace detail
|
||||||
{
|
{
|
||||||
struct
|
struct Data
|
||||||
{
|
{
|
||||||
+#if BYTE_ORDER == LITTLE_ENDIAN
|
+#if BYTE_ORDER == LITTLE_ENDIAN
|
||||||
uint x : 4;
|
uint x : 4;
|
||||||
|
@ -61,9 +43,9 @@ Taken from Adélie Linux.
|
||||||
} data;
|
} data;
|
||||||
uint8 pack;
|
uint8 pack;
|
||||||
};
|
};
|
||||||
@@ -204,10 +218,17 @@
|
@@ -211,10 +226,17 @@ namespace detail
|
||||||
{
|
{
|
||||||
struct
|
struct Data
|
||||||
{
|
{
|
||||||
+#if BYTE_ORDER == LITTLE_ENDIAN
|
+#if BYTE_ORDER == LITTLE_ENDIAN
|
||||||
uint x : 4;
|
uint x : 4;
|
||||||
|
@ -79,9 +61,9 @@ Taken from Adélie Linux.
|
||||||
} data;
|
} data;
|
||||||
uint16 pack;
|
uint16 pack;
|
||||||
};
|
};
|
||||||
@@ -216,9 +237,15 @@
|
@@ -223,9 +245,15 @@ namespace detail
|
||||||
{
|
{
|
||||||
struct
|
struct Data
|
||||||
{
|
{
|
||||||
+#if BYTE_ORDER == LITTLE_ENDIAN
|
+#if BYTE_ORDER == LITTLE_ENDIAN
|
||||||
uint x : 5;
|
uint x : 5;
|
||||||
|
@ -95,9 +77,9 @@ Taken from Adélie Linux.
|
||||||
} data;
|
} data;
|
||||||
uint16 pack;
|
uint16 pack;
|
||||||
};
|
};
|
||||||
@@ -227,10 +254,17 @@
|
@@ -234,10 +262,17 @@ namespace detail
|
||||||
{
|
{
|
||||||
struct
|
struct Data
|
||||||
{
|
{
|
||||||
+#if BYTE_ORDER == LITTLE_ENDIAN
|
+#if BYTE_ORDER == LITTLE_ENDIAN
|
||||||
uint x : 5;
|
uint x : 5;
|
||||||
|
@ -113,9 +95,9 @@ Taken from Adélie Linux.
|
||||||
} data;
|
} data;
|
||||||
uint16 pack;
|
uint16 pack;
|
||||||
};
|
};
|
||||||
@@ -239,10 +273,17 @@
|
@@ -252,10 +287,17 @@ namespace detail
|
||||||
{
|
{
|
||||||
struct
|
struct Data
|
||||||
{
|
{
|
||||||
+#if BYTE_ORDER == LITTLE_ENDIAN
|
+#if BYTE_ORDER == LITTLE_ENDIAN
|
||||||
uint x : 10;
|
uint x : 10;
|
||||||
|
@ -131,9 +113,9 @@ Taken from Adélie Linux.
|
||||||
} data;
|
} data;
|
||||||
uint32 pack;
|
uint32 pack;
|
||||||
};
|
};
|
||||||
@@ -251,10 +292,17 @@
|
@@ -264,10 +306,17 @@ namespace detail
|
||||||
{
|
{
|
||||||
struct
|
struct Data
|
||||||
{
|
{
|
||||||
+#if BYTE_ORDER == LITTLE_ENDIAN
|
+#if BYTE_ORDER == LITTLE_ENDIAN
|
||||||
int x : 10;
|
int x : 10;
|
||||||
|
@ -149,9 +131,9 @@ Taken from Adélie Linux.
|
||||||
} data;
|
} data;
|
||||||
uint32 pack;
|
uint32 pack;
|
||||||
};
|
};
|
||||||
@@ -263,10 +311,17 @@
|
@@ -276,10 +325,17 @@ namespace detail
|
||||||
{
|
{
|
||||||
struct
|
struct Data
|
||||||
{
|
{
|
||||||
+#if BYTE_ORDER == LITTLE_ENDIAN
|
+#if BYTE_ORDER == LITTLE_ENDIAN
|
||||||
uint x : 9;
|
uint x : 9;
|
||||||
|
@ -167,3 +149,24 @@ Taken from Adélie Linux.
|
||||||
} data;
|
} data;
|
||||||
uint32 pack;
|
uint32 pack;
|
||||||
};
|
};
|
||||||
|
diff --git a/test/gtc/gtc_packing.cpp b/test/gtc/gtc_packing.cpp
|
||||||
|
index b3fd854..614c0e2 100644
|
||||||
|
--- a/test/gtc/gtc_packing.cpp
|
||||||
|
+++ b/test/gtc/gtc_packing.cpp
|
||||||
|
@@ -4,6 +4,7 @@
|
||||||
|
#include <glm/ext/vector_relational.hpp>
|
||||||
|
#include <cstdio>
|
||||||
|
#include <vector>
|
||||||
|
+#include <arpa/inet.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
static void print_bits(float const& s)
|
||||||
|
@@ -157,7 +158,7 @@ static int test_U3x10_1x2()
|
||||||
|
|
||||||
|
glm::u8vec4 const v0(0xff, 0x77, 0x0, 0x33);
|
||||||
|
glm::uint32 const p0 = *reinterpret_cast<glm::uint32 const*>(&v0[0]);
|
||||||
|
- glm::uint32 const r0 = 0x330077ff;
|
||||||
|
+ glm::uint32 const r0 = htonl(0xff770033);
|
||||||
|
|
||||||
|
Error += p0 == r0 ? 0 : 1;
|
||||||
|
|
||||||
|
|
20
srcpkgs/glm/patches/cmake.patch
Normal file
20
srcpkgs/glm/patches/cmake.patch
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
--- a/CMakeLists.txt
|
||||||
|
+++ b/CMakeLists.txt
|
||||||
|
@@ -263,7 +263,7 @@
|
||||||
|
install(
|
||||||
|
EXPORT glm
|
||||||
|
NAMESPACE glm::
|
||||||
|
- DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/glm"
|
||||||
|
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/glm"
|
||||||
|
FILE glmConfig.cmake
|
||||||
|
)
|
||||||
|
include(CMakePackageConfigHelpers)
|
||||||
|
@@ -273,7 +273,7 @@
|
||||||
|
)
|
||||||
|
install(
|
||||||
|
FILES "${CMAKE_CURRENT_BINARY_DIR}/glmConfigVersion.cmake"
|
||||||
|
- DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/glm"
|
||||||
|
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/glm"
|
||||||
|
)
|
||||||
|
|
||||||
|
configure_file(
|
25
srcpkgs/glm/patches/pkg-config.patch
Normal file
25
srcpkgs/glm/patches/pkg-config.patch
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
this is removed in 1.0, but it's still needed by anything trying to find this
|
||||||
|
with autotools
|
||||||
|
--- a/CMakeLists.txt
|
||||||
|
+++ b/CMakeLists.txt
|
||||||
|
@@ -32,6 +32,10 @@
|
||||||
|
option(GLM_ENABLE_CXX_17 "Enable C++ 17" OFF)
|
||||||
|
option(GLM_ENABLE_CXX_20 "Enable C++ 20" OFF)
|
||||||
|
|
||||||
|
+set(GLM_PC ${CMAKE_CURRENT_BINARY_DIR}/glm.pc)
|
||||||
|
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/glm.pc.in ${GLM_PC} @ONLY)
|
||||||
|
+install(FILES ${GLM_PC} DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig")
|
||||||
|
+
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
|
if(GLM_ENABLE_CXX_20)
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/glm.pc.in
|
||||||
|
@@ -0,0 +1,7 @@
|
||||||
|
+prefix=@CMAKE_INSTALL_PREFIX@
|
||||||
|
+includedir=${prefix}/include
|
||||||
|
+
|
||||||
|
+Name: GLM
|
||||||
|
+Description: OpenGL Mathematics
|
||||||
|
+Version: @GLM_VERSION@
|
||||||
|
+Cflags: -I${includedir}
|
25
srcpkgs/glm/patches/werror.patch
Normal file
25
srcpkgs/glm/patches/werror.patch
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
|
||||||
|
index 93abbfa..2ac0df3 100644
|
||||||
|
--- a/test/CMakeLists.txt
|
||||||
|
+++ b/test/CMakeLists.txt
|
||||||
|
@@ -11,7 +11,6 @@
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT GLM_DISABLE_AUTO_DETECTION)
|
||||||
|
- add_compile_options(-Werror -Weverything)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||||
|
@@ -20,12 +19,10 @@
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT GLM_DISABLE_AUTO_DETECTION)
|
||||||
|
- add_compile_options(-Werror)
|
||||||
|
# add_compile_options(-Wpedantic)
|
||||||
|
# add_compile_options(-Wall)
|
||||||
|
# add_compile_options(-Wextra)
|
||||||
|
endif()
|
||||||
|
- add_compile_options(-O2)
|
||||||
|
#add_compile_options(-Wno-long-long)
|
||||||
|
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
||||||
|
if(NOT GLM_QUIET)
|
|
@ -1,33 +1,17 @@
|
||||||
# Template file for 'glm'
|
# Template file for 'glm'
|
||||||
pkgname=glm
|
pkgname=glm
|
||||||
version=0.9.9.8
|
version=1.0.1
|
||||||
revision=2
|
revision=1
|
||||||
build_style=cmake
|
build_style=cmake
|
||||||
hostmakedepends="dos2unix unzip"
|
hostmakedepends="unzip"
|
||||||
short_desc="C++ mathematics library for graphics programming"
|
short_desc="C++ mathematics library for graphics programming"
|
||||||
maintainer="Orphaned <orphan@voidlinux.org>"
|
maintainer="Orphaned <orphan@voidlinux.org>"
|
||||||
license="MIT"
|
license="MIT"
|
||||||
homepage="http://glm.g-truc.net"
|
homepage="http://glm.g-truc.net"
|
||||||
distfiles="https://github.com/g-truc/glm/releases/download/${version}/glm-${version}.zip"
|
distfiles="https://github.com/g-truc/glm/releases/download/${version}/glm-${version}-light.zip"
|
||||||
checksum=37e2a3d62ea3322e43593c34bae29f57e3e251ea89f4067506c94043769ade4c
|
distfiles="https://github.com/g-truc/glm/archive/refs/tags/${version}.tar.gz"
|
||||||
|
checksum=9f3174561fd26904b23f0db5e560971cbf9b3cbda0b280f04d5c379d03bf234c
|
||||||
# No longer has install target
|
|
||||||
# Install manually
|
|
||||||
do_install() {
|
|
||||||
local i
|
|
||||||
vmkdir usr/include
|
|
||||||
vcopy glm usr/include
|
|
||||||
vmkdir usr/lib/cmake
|
|
||||||
vcopy cmake/glm usr/lib/cmake
|
|
||||||
vmkdir usr/share/pkgconfig
|
|
||||||
vinstall ${FILESDIR}/glm.pc 644 usr/share/pkgconfig
|
|
||||||
}
|
|
||||||
|
|
||||||
post_install() {
|
post_install() {
|
||||||
local f
|
|
||||||
for f in $(find ${DESTDIR}/usr/include -type f); do
|
|
||||||
dos2unix "$f"
|
|
||||||
done
|
|
||||||
rm "${DESTDIR}/usr/include/glm/CMakeLists.txt"
|
|
||||||
vlicense copying.txt LICENSE
|
vlicense copying.txt LICENSE
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue