From d5e64feaddf032f52cd7b96e7d20e0500bf00a1a Mon Sep 17 00:00:00 2001 From: Christoph Junghans Date: Sat, 12 Aug 2017 10:58:35 -0600 Subject: [PATCH] tweaks for epel7 --- c99.patch | 29 +++++++++++++++++++++++++++++ libaec.spec | 6 ++++-- 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 c99.patch diff --git a/c99.patch b/c99.patch new file mode 100644 index 0000000..c18cf95 --- /dev/null +++ b/c99.patch @@ -0,0 +1,29 @@ +From a3d42317b104f7dc12dd9821293ddd079df352d4 Mon Sep 17 00:00:00 2001 +From: Christoph Junghans +Date: Sat, 12 Aug 2017 10:36:24 -0600 +Subject: [PATCH] cmake: require c99 standard + +Some files, e.g. encode_accessors.c, use loop initial declarations +that are only allowed in C99 mode. Newer compilers enable that mode +automatically, but olders might fail. CMAKE_C_STANDARD got add in +CMake-3.1, so let's increase the minimal version by 0.1. + +Signed-off-by: Christoph Junghans +--- + CMakeLists.txt | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e8b0e93..22f24e0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,5 @@ +-cmake_minimum_required(VERSION 3.0.0) ++cmake_minimum_required(VERSION 3.1) ++set(CMAKE_C_STANDARD 99) + include(CheckIncludeFiles) + include(TestBigEndian) + include(CheckCSourceCompiles) +-- +2.13.0 + diff --git a/libaec.spec b/libaec.spec index 6dd1432..99bf9db 100644 --- a/libaec.spec +++ b/libaec.spec @@ -5,8 +5,9 @@ Summary: Adaptive Entropy Coding library License: BSD Url: https://gitlab.dkrz.de/k202009/libaec Source: https://gitlab.dkrz.de/k202009/libaec/repository/archive.tar.gz?ref=v%{version}/%{name}-%{version}.tar.gz +Patch0: c99.patch -BuildRequires: cmake +BuildRequires: %{?fedora:cmake >= 3.1}%{?rhel:cmake3 >= 3.1} %description Libaec provides fast loss-less compression of 1 up to 32 bit wide @@ -33,11 +34,12 @@ Devel files for libaec (Adaptive Entropy Coding library). %prep %setup -q -T -a 0 -c mv %{name}-v%{version}-*/* . +%patch0 -p1 %build mkdir build pushd build -%cmake .. +%{?fedora:%{cmake}}%{?rhel:%{cmake3}} .. %make_build popd