commit 6a66edba4cab6a8177232923a5f9d6e17859a85d
Author: Jakub Bogusz <qbo...@pld-linux.org>
Date:   Mon Apr 29 19:49:38 2024 +0200

    - updated to 1.0.1; now base package contains (optional) shared library, 
headers are in -devel

 GLM.spec  | 65 ++++++++++++++++++++++++++++++++++-----------------------------
 x32.patch | 42 ++++++++++++++++++++++++++++++-----------
 2 files changed, 66 insertions(+), 41 deletions(-)
---
diff --git a/GLM.spec b/GLM.spec
index e2aac7e..07a6a5e 100644
--- a/GLM.spec
+++ b/GLM.spec
@@ -1,67 +1,64 @@
 #
 # Conditional build:
 %bcond_without tests           # build without tests
-%bcond_with    p7zip           # plain p7zip (compatible with both rpm4/rpm5)
 #
-%define                gitref  47585fde0c49fa77a2bf2fb1d2ead06999fd4b6e
-%define                snap    20230818
-%define                rel     1
-
 Summary:       OpenGL Mathematics (GLM) - C++ mathematics library for GLSL
 Summary(pl.UTF-8):     OpenGL Mathematics (GLM) - biblioteka matematyczna C++ 
dla GLSL
 Name:          GLM
-Version:       0.9.9.9
-Release:       0.%{snap}.%{rel}
+Version:       1.0.1
+Release:       1
 License:       MIT
-Group:         Development/Libraries
+Group:         Libraries
 #Source0Download: https://github.com/g-truc/glm/releases
-Source0:       
https://github.com/g-truc/glm/archive/%{gitref}/%{name}-%{snap}.tar.gz
-# Source0-md5: b288cb704cca5d1cd46be724ce61f428
+Source0:       
https://github.com/g-truc/glm/archive/%{version}/glm-%{version}.tar.gz
+# Source0-md5: f824ac50e16310a95279032f82cbd341
 Patch0:                x32.patch
 URL:           https://glm.g-truc.net/
-BuildRequires: cmake >= 3.2
+BuildRequires: cmake >= 3.6
 %{?with_tests:BuildRequires:   libstdc++-devel}
 BuildRequires: rpmbuild(macros) >= 1.605
-%if %{with p7zip}
-BuildRequires: p7zip
-%else
-BuildRequires: p7zip-standalone
-BuildRequires: rpm-build >= 5
-%endif
 Requires:      libstdc++-devel
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define                _enable_debug_packages  0
-
 %description
 OpenGL Mathematics (GLM) is a C++ mathematics library for graphics
 software based on the OpenGL Shading Language (GLSL) specification.
 
-GLM is a header only library, there is nothing to build, just include
-it.
-
 %description -l pl.UTF-8
 OpenGL Mathematics (GLM) to biblioteka matematyczna C++ dla programów
 graficznych opartych na specyfikacji OpenGL Shading Language (GLSL).
 
+%package devel
+Summary:       OpenGL Mathematics (GLM) - C++ mathematics library for GLSL 
(header files)
+Summary(pl.UTF-8):     OpenGL Mathematics (GLM) - biblioteka matematyczna C++ 
dla GLSL (pliki nagłówkowe)
+Group:         Development/Libraries
+Requires:      libstdc++-devel
+# no base dependency - can be used as header-only library
+# not noarch due to paths in cmake configs
+
+%description devel
+OpenGL Mathematics (GLM) is a C++ mathematics library for graphics
+software based on the OpenGL Shading Language (GLSL) specification.
+
+%description devel -l pl.UTF-8
+OpenGL Mathematics (GLM) to biblioteka matematyczna C++ dla programów
+graficznych opartych na specyfikacji OpenGL Shading Language (GLSL).
+
 %prep
-%if %{with p7zip}
-%setup -q -c -T -n glm
-7z x %{SOURCE0} -o..
-%else
-%setup -q -n glm-%{gitref}
-%endif
+%setup -q -n glm-%{version}
 %patch0 -p1
 
 %build
 mkdir build
 cd build
-CXXFLAGS="%{rpmcxxflags} -fno-ipa-modref" \
+# change CMAKE_INSTALL_DATAROOTDIR to arch-dependent (files contain 
arch-dependent libglm.so paths)
 %cmake .. \
+       -DCMAKE_INSTALL_DATAROOTDIR=%{_libdir}/cmake \
        -DGLM_TEST_ENABLE:BOOL=%{!?with_tests:OFF}%{?with_tests:ON}
 
-%if %{with tests}
 %{__make}
+
+%if %{with tests}
 %{__make} test
 %endif
 
@@ -74,8 +71,16 @@ rm -rf $RPM_BUILD_ROOT
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post  -p /sbin/ldconfig
+%postun        -p /sbin/ldconfig
+
 %files
 %defattr(644,root,root,755)
 %doc manual.md readme.md
+%attr(755,root,root) %{_libdir}/libglm.so
+
+%files devel
+%defattr(644,root,root,755)
+%doc manual.md readme.md
 %{_includedir}/glm
 %{_libdir}/cmake/glm
diff --git a/x32.patch b/x32.patch
index 00f7665..8cf9fdf 100644
--- a/x32.patch
+++ b/x32.patch
@@ -1,17 +1,37 @@
---- glm/test/core/core_setup_message.cpp.orig  2020-03-19 23:36:32.000000000 
+0100
-+++ glm/test/core/core_setup_message.cpp       2020-03-19 23:43:46.417701188 
+0100
-@@ -155,7 +155,13 @@
+--- glm-1.0.1/test/core/core_setup_message.cpp.orig    2024-02-27 
18:19:47.000000000 +0100
++++ glm-1.0.1/test/core/core_setup_message.cpp 2024-04-29 17:54:10.823524118 
+0200
+@@ -223,8 +223,14 @@ static int test_compiler()
+ static int test_model()
  {
        int Error = 0;
-       
+-      
 -      Error += ((sizeof(void*) == 4) && (GLM_MODEL == GLM_MODEL_32)) || 
((sizeof(void*) == 8) && (GLM_MODEL == GLM_MODEL_64)) ? 0 : 1;
-+      Error += 
-+              ((sizeof(void*) == 4) && (GLM_MODEL == GLM_MODEL_32)) || 
-+              ((sizeof(void*) == 8) && (GLM_MODEL == GLM_MODEL_64))
-+#ifdef __ILP32__
-+              || ((sizeof(void*) == 4) && (GLM_MODEL == GLM_MODEL_64))
++
++      bool supported64 =
++#if defined(__x86_64__) && defined(__ILP32__)
++              true;
++#else
++              (sizeof(void*) == 8);
 +#endif
-+              ? 0 : 1;
++      Error += ((sizeof(void*) == 4) && (GLM_MODEL == GLM_MODEL_32)) || 
(supported64 && (GLM_MODEL == GLM_MODEL_64)) ? 0 : 1;
        
-       if(GLM_MODEL == GLM_MODEL_32)
+ #     if GLM_MODEL == GLM_MODEL_32
                std::printf("GLM_MODEL_32\n");
+--- glm-1.0.1/glm/gtx/string_cast.inl.orig     2024-02-27 18:19:47.000000000 
+0100
++++ glm-1.0.1/glm/gtx/string_cast.inl  2024-04-29 17:54:31.413345096 +0200
+@@ -58,7 +58,6 @@ namespace detail
+               GLM_FUNC_QUALIFIER static char const * value() {return "%f";}
+       };
+ 
+-#     if GLM_MODEL == GLM_MODEL_32 && GLM_COMPILER && GLM_COMPILER_VC
+       template<>
+       struct literal<uint64_t, false>
+       {
+@@ -70,7 +69,6 @@ namespace detail
+       {
+               GLM_FUNC_QUALIFIER static char const * value() {return "%lld";}
+       };
+-#     endif//GLM_MODEL == GLM_MODEL_32 && GLM_COMPILER && GLM_COMPILER_VC
+ 
+       template<typename T>
+       struct prefix{};
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/GLM.git/commitdiff/6a66edba4cab6a8177232923a5f9d6e17859a85d

_______________________________________________
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to