From 78d87c71f68259c9c8714db5ab68c8418ae9d4d0 Mon Sep 17 00:00:00 2001 From: Bernd Riederer <20151553+briederer@users.noreply.github.com> Date: Fri, 22 Apr 2022 23:43:44 +0200 Subject: Uncrustify package: add versions up to 0.74 (#27621) --- .../repos/builtin/packages/uncrustify/package.py | 33 ++++++++++++++++++++-- .../packages/uncrustify/uncrustify-includes.patch | 26 +++++++++++++++++ 2 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 var/spack/repos/builtin/packages/uncrustify/uncrustify-includes.patch diff --git a/var/spack/repos/builtin/packages/uncrustify/package.py b/var/spack/repos/builtin/packages/uncrustify/package.py index 7221cdbcab..f465939ea4 100644 --- a/var/spack/repos/builtin/packages/uncrustify/package.py +++ b/var/spack/repos/builtin/packages/uncrustify/package.py @@ -10,12 +10,30 @@ class Uncrustify(Package): """Source Code Beautifier for C, C++, C#, ObjectiveC, Java, and others.""" homepage = "http://uncrustify.sourceforge.net/" - url = "http://downloads.sourceforge.net/project/uncrustify/uncrustify/uncrustify-0.61/uncrustify-0.61.tar.gz" - - version('0.67', sha256='54f15c8ebddef120522db21f38fac1dd3b0a285fbf60a8b71f9e333e96cf6ddc') + git = "https://github.com/uncrustify/uncrustify" + url = "https://sourceforge.net/projects/uncrustify/files/uncrustify/uncrustify-0.69/uncrustify-0.69.tar.gz" + + maintainers = ['gmaurel'] + + version('master', branch='master') + version('0.74', commit='62048b') + version('0.73', commit='25b765') + version('0.72', commit='1d3d8f') + version('0.71', commit='64d82f') + version('0.70', commit='51f64d') + version('0.69', commit='a7a8fb') + version('0.68', commit='86bc34') + version('0.67', commit='00321a') + version('0.66', commit='80f549') + version('0.65', commit='905676') + version('0.64', commit='1d7d97') + version('0.63', commit='44ce0f') + version('0.62', commit='5987f2') version('0.61', sha256='1df0e5a2716e256f0a4993db12f23d10195b3030326fdf2e07f8e6421e172df9') depends_on('cmake', type='build', when='@0.64:') + depends_on('automake', type='build', when='@0.63') + depends_on('autoconf', type='build', when='@0.63') @when('@0.64:') def install(self, spec, prefix): @@ -24,8 +42,17 @@ class Uncrustify(Package): make() make('install') + @when('@0.63') + def install(self, spec, prefix): + which('bash')('autogen.sh') + configure('--prefix={0}'.format(self.prefix)) + make() + make('install') + @when('@:0.62') def install(self, spec, prefix): configure('--prefix={0}'.format(self.prefix)) make() make('install') + + patch('uncrustify-includes.patch', when='@0.73') diff --git a/var/spack/repos/builtin/packages/uncrustify/uncrustify-includes.patch b/var/spack/repos/builtin/packages/uncrustify/uncrustify-includes.patch new file mode 100644 index 0000000000..54470f8feb --- /dev/null +++ b/var/spack/repos/builtin/packages/uncrustify/uncrustify-includes.patch @@ -0,0 +1,26 @@ +diff -Naur spack-src/src/output.cpp spack-src.patched/src/output.cpp +--- spack-src/src/output.cpp 2021-11-23 17:28:36.000000000 +0100 ++++ spack-src.patched/src/output.cpp 2021-11-23 18:26:42.000000000 +0100 +@@ -20,9 +20,7 @@ + #include + #include + +-#ifdef WIN32 + #include // to get std::map +-#endif // WIN32 + + + constexpr static auto LCURRENT = LOUTPUT; +diff -Naur spack-src/src/tokenize.cpp spack-src.patched/src/tokenize.cpp +--- spack-src/src/tokenize.cpp 2021-11-23 17:28:36.000000000 +0100 ++++ spack-src.patched/src/tokenize.cpp 2021-11-23 18:26:30.000000000 +0100 +@@ -17,9 +17,7 @@ + + #include + +-#ifdef WIN32 + #include // to get std::stack +-#endif // WIN32 + + + #define LE_COUNT(x) cpd.le_counts[static_cast(LE_ ## x)] -- cgit v1.2.3-70-g09d2