0003-libselinux-set-CFLAGS-for-pip-installation.patch 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. From c9b3cbb654ca1e834d47f52af9f170b9f38c857a Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgzones@googlemail.com>
  3. Date: Thu, 20 Apr 2023 18:27:00 +0200
  4. Subject: [PATCH] libselinux: set CFLAGS for pip installation
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Explicitly set CFLAGS for the pip install command, similar to calling
  9. setup.py, to ignore known compiler warnings treated as errors, e.g.:
  10. selinuxswig_python_wrap.c:3593:19: error: 'sidget' is deprecated [-Werror,-Wdeprecated-declarations]
  11. result = (int)sidget(arg1);
  12. ^
  13. selinuxswig_python_wrap.c:15024:1: error: no previous prototype for function 'PyInit__selinux' [-Werror,-Wmissing-prototypes]
  14. SWIG_init(void) {
  15. ^
  16. Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
  17. Acked-by: Petr Lautrbach <lautrbach@redhat.com>
  18. Upstream: https://github.com/SELinuxProject/selinux/commit/c9b3cbb654ca1e834d47f52af9f170b9f38c857a
  19. [yann.morin.1998@free.fr: backport from upstream]
  20. Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
  21. ---
  22. libselinux/src/Makefile | 2 +-
  23. 1 file changed, 1 insertion(+), 1 deletion(-)
  24. diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile
  25. index 36d57122..f9a1e5f5 100644
  26. --- a/src/Makefile
  27. +++ b/src/Makefile
  28. @@ -187,7 +187,7 @@ install: all
  29. ln -sf --relative $(DESTDIR)$(SHLIBDIR)/$(LIBSO) $(DESTDIR)$(LIBDIR)/$(TARGET)
  30. install-pywrap: pywrap
  31. - $(PYTHON) -m pip install --prefix=$(PREFIX) `test -n "$(DESTDIR)" && echo --root $(DESTDIR) --ignore-installed --no-deps` $(PYTHON_SETUP_ARGS) .
  32. + CFLAGS="$(CFLAGS) $(SWIG_CFLAGS)" $(PYTHON) -m pip install --prefix=$(PREFIX) `test -n "$(DESTDIR)" && echo --root $(DESTDIR) --ignore-installed --no-deps` $(PYTHON_SETUP_ARGS) .
  33. install -m 644 $(SWIGPYOUT) $(DESTDIR)$(PYTHONLIBDIR)/selinux/__init__.py
  34. ln -sf --relative $(DESTDIR)$(PYTHONLIBDIR)/selinux/_selinux$(PYCEXT) $(DESTDIR)$(PYTHONLIBDIR)/_selinux$(PYCEXT)
  35. --
  36. 2.25.1