From 243aa916cfa6ba92b8d5f411d0d7216ed064a64d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Mon, 21 Dec 2020 12:43:04 +0100 Subject: [PATCH] DEB uncrustify: allow build on older distributions. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- .../uncrustify-trinity-0.72.0/debian/compat | 1 + .../uncrustify-trinity-0.72.0/debian/control | 4 +- .../003_allow_older_distributions.diff | 40 +++++++++++++++++++ .../debian/patches/series | 1 + .../debian/source/options | 3 ++ 5 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 debian/uncrustify-trinity/uncrustify-trinity-0.72.0/debian/compat create mode 100644 debian/uncrustify-trinity/uncrustify-trinity-0.72.0/debian/patches/003_allow_older_distributions.diff create mode 100644 debian/uncrustify-trinity/uncrustify-trinity-0.72.0/debian/source/options diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/debian/compat b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/debian/compat new file mode 100644 index 00000000..ec635144 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/debian/control b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/debian/control index 4d8a0bdf..cab8ba3a 100644 --- a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/debian/control +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/debian/control @@ -1,8 +1,8 @@ Source: uncrustify-trinity -Section: devel +Section: deps-r14/devel Priority: optional Maintainer: Alexander GQ Gerasiov -Build-Depends: debhelper-compat (= 12), cmake, python3 +Build-Depends: debhelper (>= 9~), cmake (>= 3.0~), python3 (>= 3.3~), gcc (>= 4:4.9~) Standards-Version: 4.5.0 Homepage: https://github.com/uncrustify/uncrustify Vcs-Git: https://salsa.debian.org/debian/uncrustify.git diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/debian/patches/003_allow_older_distributions.diff b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/debian/patches/003_allow_older_distributions.diff new file mode 100644 index 00000000..3781601a --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/debian/patches/003_allow_older_distributions.diff @@ -0,0 +1,40 @@ +Index: b/CMakeLists.txt +=================================================================== +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 3.2) ++cmake_minimum_required(VERSION 3.0) + + project(uncrustify-trinity) + +@@ -51,8 +51,12 @@ + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") + endif() + +-set(CMAKE_CXX_STANDARD 11) +-set(CMAKE_CXX_STANDARD_REQUIRED YES) ++if( ${CMAKE_VERSION} VERSION_LESS "3.1" ) ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") ++else() ++ set(CMAKE_CXX_STANDARD 11) ++ set(CMAKE_CXX_STANDARD_REQUIRED YES) ++endif() + + if(ENABLE_SANITIZER) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O1 -fno-omit-frame-pointer -fsanitize=${ENABLE_SANITIZER}") +@@ -139,8 +143,13 @@ + else() + # Add target to generate version header; + # do this every build to ensure git SHA is up to date ++ if( ${CMAKE_VERSION} VERSION_LESS "3.2" ) ++ set( VERSION_HEADER_BYPRODUCTS "" ) ++ else() ++ set( VERSION_HEADER_BYPRODUCTS "BYPRODUCTS" "${PROJECT_BINARY_DIR}/uncrustify_version.h" ) ++ endif() + add_custom_target(generate_version_header +- BYPRODUCTS "${PROJECT_BINARY_DIR}/uncrustify_version.h" ++ ${VERSION_HEADER_BYPRODUCTS} + COMMAND + ${CMAKE_COMMAND} + -D PYTHON_EXECUTABLE:STRING=${PYTHON_EXECUTABLE} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/debian/patches/series b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/debian/patches/series index 2e78ed20..0cc1885c 100644 --- a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/debian/patches/series +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/debian/patches/series @@ -1,2 +1,3 @@ 001_docs-remove-remote-images.patch 002_trinity_customization.diff +003_allow_older_distributions.diff diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/debian/source/options b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/debian/source/options new file mode 100644 index 00000000..d71748bb --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/debian/source/options @@ -0,0 +1,3 @@ +# Use xz instead of gzip +compression = "xz" +compression-level = 9