diff --git a/0001-Makefile.am-set-videoencoder_CPPFLAGS-not-videoencod.patch b/0001-Makefile.am-set-videoencoder_CPPFLAGS-not-videoencod.patch deleted file mode 100644 index 6300c02..0000000 --- a/0001-Makefile.am-set-videoencoder_CPPFLAGS-not-videoencod.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 0626b1a9085f80b4a162964376d1fdadf3e3dcdf Mon Sep 17 00:00:00 2001 -From: Adam Williamson -Date: Mon, 25 May 2020 12:08:23 -0700 -Subject: [PATCH] Makefile.am: set videoencoder_CPPFLAGS not - videoencoder_CFLAGS - -videoencoder is built as C++, not C, we should be setting -CPPFLAGS here, not CFLAGS. This is what we do for debugviewer and -snd2png. - -This broke build on Fedora Rawhide, because /usr/include/opencv2 -no longer exists there. There is /usr/include/opencv4/opencv2 and -this should be fine because we should get -I/usr/include/opencv4 -from OPENCV_CFLAGS, but because of this bug, that wasn't set -correctly and the build failed. With this change it works. - -Signed-off-by: Adam Williamson ---- - Makefile.am | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Makefile.am b/Makefile.am -index 61dbe1d2..57911b05 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -119,7 +119,7 @@ pkglibexec_FOLDERS = \ - pkglibexec_PROGRAMS = videoencoder - - videoencoder_SOURCES = videoencoder.cpp --videoencoder_CFLAGS = -O2 -Wall -W $(OPENCV_CFLAGS) -+videoencoder_CPPFLAGS = -O2 -Wall -W $(OPENCV_CFLAGS) - videoencoder_LDADD = $(OPENCV_LIBS) $(THEORAENC_LIBS) -lm - - EXTRA_DIST = \ --- -2.26.2 - diff --git a/0001-Makefiles-set-CXXFLAGS-not-CFLAGS-or-CPPFLAGS.patch b/0001-Makefiles-set-CXXFLAGS-not-CFLAGS-or-CPPFLAGS.patch new file mode 100644 index 0000000..158d8ff --- /dev/null +++ b/0001-Makefiles-set-CXXFLAGS-not-CFLAGS-or-CPPFLAGS.patch @@ -0,0 +1,71 @@ +From 5a2c3ffa7264319c52f0dfd30bcff5f0a86ec01d Mon Sep 17 00:00:00 2001 +From: Adam Williamson +Date: Mon, 25 May 2020 12:08:23 -0700 +Subject: [PATCH] Makefiles: set CXXFLAGS not CFLAGS or CPPFLAGS + +CFLAGS is for C compilation. CPPFLAGS is for the preprocessor. +CXXFLAGS is for C++ compilation, which is what we're actually +trying to apply the flags to in all three cases. CPPFLAGS happen +to be applied to the compile stage as well as the preprocessor +usually, so CPPFLAGS was working, but it wasn't correct. CFLAGS +is not applied to C++ compiles, so `videoencoder_CFLAGS` was +not being used at all. + +This broke build on Fedora Rawhide, because /usr/include/opencv2 +no longer exists there. There is /usr/include/opencv4/opencv2 and +this should be fine because we should get -I/usr/include/opencv4 +from OPENCV_CFLAGS, but because of this bug, that wasn't set +correctly and the build failed. With this change it works. + +Thanks to Orion Poplowski for reminding me of the CPPFLAGS vs. +CXXFLAGS distinction here. + +Signed-off-by: Adam Williamson +--- + Makefile.am | 2 +- + debugviewer/Makefile.am | 2 +- + snd2png/Makefile.am | 3 +-- + 3 files changed, 3 insertions(+), 4 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 61dbe1d2..a5b4fbf2 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -119,7 +119,7 @@ pkglibexec_FOLDERS = \ + pkglibexec_PROGRAMS = videoencoder + + videoencoder_SOURCES = videoencoder.cpp +-videoencoder_CFLAGS = -O2 -Wall -W $(OPENCV_CFLAGS) ++videoencoder_CXXFLAGS = -O2 -Wall -W $(OPENCV_CFLAGS) + videoencoder_LDADD = $(OPENCV_LIBS) $(THEORAENC_LIBS) -lm + + EXTRA_DIST = \ +diff --git a/debugviewer/Makefile.am b/debugviewer/Makefile.am +index 47d1d953..eea1de60 100644 +--- a/debugviewer/Makefile.am ++++ b/debugviewer/Makefile.am +@@ -2,6 +2,6 @@ bin_PROGRAMS = debugviewer + + debugviewer_SOURCES = debugviewer.cpp + +-AM_CPPFLAGS = $(OPENCV_CFLAGS) ++AM_CXXFLAGS = $(OPENCV_CFLAGS) + debugviewer_LDFLAGS = $(OPENCV_LIBS) + +diff --git a/snd2png/Makefile.am b/snd2png/Makefile.am +index 07bd084e..ec6f1840 100644 +--- a/snd2png/Makefile.am ++++ b/snd2png/Makefile.am +@@ -2,8 +2,7 @@ bin_PROGRAMS = snd2png + + snd2png_SOURCES = snd2png.cpp + +-AM_CXXFLAGS = -g3 -Wall -W +-AM_CPPFLAGS = $(OPENCV_CFLAGS) $(FFTW_CFLAGS) $(SNDFILE_CFLAGS) ++AM_CXXFLAGS = -g3 -Wall -W $(OPENCV_CFLAGS) $(FFTW_CFLAGS) $(SNDFILE_CFLAGS) + snd2png_LDFLAGS = $(OPENCV_LIBS) $(FFTW_LIBS) $(SNDFILE_LIBS) -lm + + check-local: +-- +2.26.2 + diff --git a/os-autoinst.spec b/os-autoinst.spec index 7743653..6c30346 100644 --- a/os-autoinst.spec +++ b/os-autoinst.spec @@ -46,7 +46,7 @@ Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{gith # https://github.com/os-autoinst/os-autoinst/pull/1419 # https://bugzilla.redhat.com/show_bug.cgi?id=1839616 # Fixes build when /usr/include/opencv2 compat symlink is removed -Patch0: 0001-Makefile.am-set-videoencoder_CPPFLAGS-not-videoencod.patch +Patch0: 0001-Makefiles-set-CXXFLAGS-not-CFLAGS-or-CPPFLAGS.patch # on SUSE this is conditional, for us it doesn't have to be but we # still use a macro just to keep build_requires similar for ease of