From e5cad404aa6e28c2b676cfdcca203ac6a943e1d9 Mon Sep 17 00:00:00 2001 From: SaltyFruit Date: Wed, 26 Apr 2023 11:59:22 +0800 Subject: [PATCH] Fix clang build error --- fix-clang-build-error.patch | 16 ++++++++++++++++ ftgl.spec | 14 +++++++------- 2 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 fix-clang-build-error.patch diff --git a/fix-clang-build-error.patch b/fix-clang-build-error.patch new file mode 100644 index 0000000..82cf31f --- /dev/null +++ b/fix-clang-build-error.patch @@ -0,0 +1,16 @@ +diff -up ftgl-2.1.3~rc5/demo/simple.cpp.orig2 ftgl-2.1.3~rc5/demo/simple.cpp +--- ftgl-2.1.3~rc5/demo/simple.cpp.orig2 2023-04-26 11:10:21.474356415 +0800 ++++ ftgl-2.1.3~rc5/demo/simple.cpp 2023-04-26 11:27:30.028163183 +0800 +@@ -105,9 +105,9 @@ static void RenderScene(void) + float t2 = sin(n / 50 + 1); + float t3 = sin(n / 30 + 2); + +- float ambient[4] = { (t1 + 2.0) / 3, +- (t2 + 2.0) / 3, +- (t3 + 2.0) / 3, 0.3 }; ++ float ambient[4] = {static_cast((t1 + 2.0) / 3), ++ static_cast((t2 + 2.0) / 3), ++ static_cast((t3 + 2.0) / 3, 0.3) }; + float diffuse[4] = { 1.0, 0.9, 0.9, 1.0 }; + float specular[4] = { 1.0, 0.7, 0.7, 1.0 }; + float position[4] = { 100.0, 100.0, 0.0, 1.0 }; diff --git a/ftgl.spec b/ftgl.spec index fc8b941..bd53e86 100644 --- a/ftgl.spec +++ b/ftgl.spec @@ -1,6 +1,6 @@ Name: ftgl Version: 2.1.3 -Release: 0.21.rc1%{?dist} +Release: 0.21.rc2%{?dist} Summary: OpenGL frontend to Freetype 2 License: LGPLv2 @@ -8,6 +8,7 @@ URL: http://ftgl.wiki.sourceforge.net/ Source0: http://downloads.sourceforge.net/ftgl/ftgl-%{version}-rc5.tar.bz2 Patch0: ftgl-2.1.3-rc5-ttf_font.patch Patch1: ftgl-2.1.3-rc5-ldflags.patch +Patch2: fix-clang-build-error.patch BuildRequires: gcc-c++ BuildRequires: doxygen @@ -49,11 +50,7 @@ This package contains documentation files for %{name}. %prep -%setup -q -n ftgl-%{version}~rc5 -%patch0 -p1 -b .destdir -%patch1 -p1 -b .ldflags - - +%autosetup -p1 -n ftgl-%{version}~rc5 %build %configure \ @@ -99,6 +96,9 @@ rm -rf $RPM_BUILD_ROOT%{_datadir}/doc %doc __doc/* -%ChangeLog +%changelog +* Wed Apr 26 2023 Xiaoya Huang - 2.1.3-0.21.rc2 +- Fix clang build error + * Sat May 16 2020 Hubble Zhu - 2.1.3-0.21.rc1 - Init package -- Gitee