0001-Fix-build-for-GCC-13-make-GitHub-Actions-cover-build-with-GCC-13.patch 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. From 22b1e0897af977cc96af926c730ff948bd120bb5 Mon Sep 17 00:00:00 2001
  2. From: Sebastian Pipping <sebastian@pipping.org>
  3. Date: Fri, 31 Mar 2023 09:39:49 +0200
  4. Subject: [PATCH] Fix build for GCC 13 + make GitHub Actions cover build with
  5. GCC 13 (#586)
  6. * include missing <cstdint>
  7. gcc 13 moved some includes around and as a result <cstdint> is no
  8. longer transitively included [1]. Explicitly include it for
  9. uint8_t.
  10. [1] https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes
  11. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  12. * docker.yml: Cover openSUSE Tumbleweed with GCC 13+
  13. Based on scripts/docker/build_on_centos_8_2.Dockerfile .
  14. ---------
  15. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  16. Co-authored-by: Khem Raj <raj.khem@gmail.com>
  17. Upstream: https://github.com/USBGuard/usbguard/commit/22b1e0897af977cc96af926c730ff948bd120bb5
  18. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  19. ---
  20. .github/workflows/docker.yml | 1 +
  21. .../build_on_opensuse_tumbleweed.Dockerfile | 50 +++++++++++++++++++
  22. src/Library/Base64.cpp | 1 -
  23. src/Library/Base64.hpp | 1 +
  24. 4 files changed, 52 insertions(+), 1 deletion(-)
  25. create mode 100644 scripts/docker/build_on_opensuse_tumbleweed.Dockerfile
  26. diff --git a/scripts/docker/build_on_opensuse_tumbleweed.Dockerfile b/scripts/docker/build_on_opensuse_tumbleweed.Dockerfile
  27. new file mode 100644
  28. index 00000000..d0993d8c
  29. --- /dev/null
  30. +++ b/scripts/docker/build_on_opensuse_tumbleweed.Dockerfile
  31. @@ -0,0 +1,50 @@
  32. +##
  33. +## Copyright (c) 2023 Sebastian Pipping <sebastian@pipping.org>
  34. +##
  35. +## This program is free software; you can redistribute it and/or modify
  36. +## it under the terms of the GNU General Public License as published by
  37. +## the Free Software Foundation; either version 2 of the License, or
  38. +## (at your option) any later version.
  39. +##
  40. +## This program is distributed in the hope that it will be useful,
  41. +## but WITHOUT ANY WARRANTY; without even the implied warranty of
  42. +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  43. +## GNU General Public License for more details.
  44. +##
  45. +## You should have received a copy of the GNU General Public License
  46. +## along with this program. If not, see <http://www.gnu.org/licenses/>.
  47. +
  48. +FROM opensuse/tumbleweed:latest
  49. +RUN zypper --non-interactive install dnf rpm-repos-openSUSE-Tumbleweed \
  50. + && \
  51. + dnf install -y \
  52. + asciidoc \
  53. + autoconf \
  54. + automake \
  55. + dbus-1-glib-devel \
  56. + diffutils \
  57. + file \
  58. + gcc-c++ \
  59. + git \
  60. + libgcrypt-devel \
  61. + libqb-devel \
  62. + libsodium-devel \
  63. + libtool \
  64. + libxslt \
  65. + make \
  66. + polkit-devel \
  67. + protobuf-devel
  68. +ADD usbguard.tar usbguard/
  69. +ADD catch.tar usbguard/src/ThirdParty/Catch/
  70. +ADD pegtl.tar usbguard/src/ThirdParty/PEGTL/
  71. +WORKDIR usbguard
  72. +RUN git init &>/dev/null && ./autogen.sh
  73. +RUN ./configure --with-bundled-catch --with-bundled-pegtl || ! cat config.log
  74. +RUN make dist
  75. +RUN tar xf usbguard-*.tar.gz
  76. +RUN mv -v usbguard-*.*.*/ usbguard-release/
  77. +RUN mkdir usbguard-release/build/
  78. +WORKDIR usbguard-release/build/
  79. +RUN ../configure --with-bundled-catch --with-bundled-pegtl || ! cat config.log
  80. +RUN bash -c 'set -o pipefail; make V=1 "-j$(nproc)" |& tee build.log'
  81. +RUN ! grep -F 'include file not found' build.log
  82. diff --git a/src/Library/Base64.cpp b/src/Library/Base64.cpp
  83. index ddb28dce..0246a134 100644
  84. --- a/src/Library/Base64.cpp
  85. +++ b/src/Library/Base64.cpp
  86. @@ -22,7 +22,6 @@
  87. #include "Base64.hpp"
  88. #include <stdexcept>
  89. -#include <cstdint>
  90. namespace usbguard
  91. {
  92. diff --git a/src/Library/Base64.hpp b/src/Library/Base64.hpp
  93. index 0947f214..e0c745cb 100644
  94. --- a/src/Library/Base64.hpp
  95. +++ b/src/Library/Base64.hpp
  96. @@ -23,6 +23,7 @@
  97. #endif
  98. #include <string>
  99. +#include <cstdint>
  100. #include <cstddef>
  101. namespace usbguard