From c1e11cb88270749701641124e3892166f47f1d27 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Fri, 6 Nov 2020 20:40:47 -0800 Subject: [PATCH] flatpak: Fix build Add patches and dependencies needed to build the development version of GIMP. Also switches the in-tree manifest to using the nightly branch of the GNOME SDK and meson as the buildsystem. --- build/flatpak/org.gimp.GIMP-nightly.json | 23 +++++-- ...availability-of-flags-in-cmake-compi.patch | 68 +++++++++++++++++++ ...02-fix_solaris_stack_protection_0.27.patch | 25 +++++++ ..._compiler_flags-instead-of-C-version.patch | 36 ++++++++++ 4 files changed, 146 insertions(+), 6 deletions(-) create mode 100644 build/flatpak/patches/exiv2-0001-Properly-detect-availability-of-flags-in-cmake-compi.patch create mode 100644 build/flatpak/patches/exiv2-0002-fix_solaris_stack_protection_0.27.patch create mode 100644 build/flatpak/patches/exiv2-0003-Use-check_cxx_compiler_flags-instead-of-C-version.patch diff --git a/build/flatpak/org.gimp.GIMP-nightly.json b/build/flatpak/org.gimp.GIMP-nightly.json index ed946acc4f5..702823741ae 100644 --- a/build/flatpak/org.gimp.GIMP-nightly.json +++ b/build/flatpak/org.gimp.GIMP-nightly.json @@ -2,7 +2,7 @@ "app-id": "org.gimp.GIMP", "branch": "master", "runtime": "org.gnome.Platform", - "runtime-version": "3.36", + "runtime-version": "master", "sdk": "org.gnome.Sdk", "command": "gimp-2.99", "separate-locales": false, @@ -207,7 +207,7 @@ ] }, { - /* Copy of "shared-modules/intltool/intltool-0.51.json" (avoiding submodules on dev repo). */ + /* Copy from shared-modules to avoid submodules on dev repo. */ "name": "intltool", "cleanup": [ "*" ], "sources": [ @@ -406,6 +406,16 @@ } ] }, + { + "name": "xmu", + "sources": [ + { + "type": "archive", + "url": "https://xorg.freedesktop.org/releases/individual/lib/libXmu-1.1.3.tar.bz2", + "sha256": "9c343225e7c3dc0904f2122b562278da5fed639b1b5e880d25111561bac5b731" + } + ] + }, { "name": "babl", "buildsystem": "meson", @@ -433,11 +443,12 @@ }, { "name": "gimp", - "config-opts": [ "--disable-docs", "--disable-gtk-doc", "--disable-gtk-doc-html", - "--with-icc-directory=/run/host/usr/share/color/icc/", - "--with-build-id=org.gimp.GIMP.flatpak.nightly", - "--disable-check-update" ], + "config-opts": [ "-Dgtk-doc=false", + "-Dicc-directory=/run/host/usr/share/color/icc/", + "-Dbuild-id=org.gimp.GIMP.flatpak.nightly", + "-Dcheck-update=false" ], "cleanup": [ "/bin/gimptool-2.99", "/bin/gimp-console-2.99" ], + "buildsystem": "meson", "sources": [ { "type": "git", diff --git a/build/flatpak/patches/exiv2-0001-Properly-detect-availability-of-flags-in-cmake-compi.patch b/build/flatpak/patches/exiv2-0001-Properly-detect-availability-of-flags-in-cmake-compi.patch new file mode 100644 index 00000000000..a515a749dc4 --- /dev/null +++ b/build/flatpak/patches/exiv2-0001-Properly-detect-availability-of-flags-in-cmake-compi.patch @@ -0,0 +1,68 @@ +From bbe0b70840cf28b7dd8c0b7e9bb1b741aeda2efd Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Mon, 10 Aug 2020 19:28:49 +0200 +Subject: [PATCH] Properly detect availability of flags in + cmake/compilerFlags.cmake (#1252) + +Instead of relying on fragile and complex logic to decide if a +compiler flag is available or not, use the check_c_compiler_flag() +macro provided by the CMake standard library. + +This for example avoids using -fcf-protection on architectures that +don't support this option. + +Signed-off-by: Thomas Petazzoni + +(cherry picked from commit dd2d181755a6e642c0a8e3225ef5407fff49eb3a) + +When resolving the conflict from applying the patch, I also took the liberty +of re-indenting the snippet correcly and fixing mismatching +HAS_FCF_PROTECTION and HAS_FSTACK_PROTECTOR_STRONG variables +(the conditionals used GCC_ prefix but the variables were definded without it). + +Signed-off-by: Jan Tojnar +--- + cmake/compilerFlags.cmake | 21 ++++++++++++--------- + 1 file changed, 12 insertions(+), 9 deletions(-) + +diff --git a/cmake/compilerFlags.cmake b/cmake/compilerFlags.cmake +index 0418aa61..28472e4a 100644 +--- a/cmake/compilerFlags.cmake ++++ b/cmake/compilerFlags.cmake +@@ -1,4 +1,5 @@ + # These flags applies to exiv2lib, the applications, and to the xmp code ++include(CheckCCompilerFlag) + + if ( MINGW OR UNIX OR MSYS ) # MINGW, Linux, APPLE, CYGWIN + if (${CMAKE_CXX_COMPILER_ID} STREQUAL GNU) +@@ -22,16 +23,18 @@ if ( MINGW OR UNIX OR MSYS ) # MINGW, Linux, APPLE, CYGWIN + + + if (COMPILER_IS_GCC OR COMPILER_IS_CLANG) +- +- # This fails under Fedora, MinGW GCC 8.3.0 and CYGWIN/MSYS 9.3.0 +- if (NOT (MINGW OR CMAKE_HOST_SOLARIS OR CYGWIN OR MSYS) ) +- if (COMPILER_IS_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0) +- add_compile_options(-fstack-clash-protection -fcf-protection) ++ # This fails under Fedora - MinGW - Gcc 8.3 ++ if (NOT MINGW) ++ check_c_compiler_flag(-fstack-clash-protection HAS_FSTACK_CLASH_PROTECTION) ++ check_c_compiler_flag(-fcf-protection HAS_FCF_PROTECTION) ++ check_c_compiler_flag(-fstack-protector-strong HAS_FSTACK_PROTECTOR_STRONG) ++ if(HAS_FSTACK_CLASH_PROTECTION) ++ add_compile_options(-fstack-clash-protection) + endif() +- +- if( (COMPILER_IS_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 5.0) # Not in GCC 4.8 +- OR (COMPILER_IS_CLANG AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 3.7) # Not in Clang 3.4.2 +- ) ++ if(HAS_FCF_PROTECTION) ++ add_compile_options(-fcf-protection) ++ endif() ++ if(HAS_FSTACK_PROTECTOR_STRONG) + add_compile_options(-fstack-protector-strong) + endif() + endif() +-- +2.25.4 + diff --git a/build/flatpak/patches/exiv2-0002-fix_solaris_stack_protection_0.27.patch b/build/flatpak/patches/exiv2-0002-fix_solaris_stack_protection_0.27.patch new file mode 100644 index 00000000000..f613aee55cd --- /dev/null +++ b/build/flatpak/patches/exiv2-0002-fix_solaris_stack_protection_0.27.patch @@ -0,0 +1,25 @@ +From 0005edf2f97537af47af966829d73a4b120a86e0 Mon Sep 17 00:00:00 2001 +From: Robin Mills +Date: Wed, 9 Sep 2020 17:23:02 +0100 +Subject: [PATCH] fix_solaris_stack_protection_0.27 + +--- + cmake/compilerFlags.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cmake/compilerFlags.cmake b/cmake/compilerFlags.cmake +index 28472e4a..63075421 100644 +--- a/cmake/compilerFlags.cmake ++++ b/cmake/compilerFlags.cmake +@@ -24,7 +24,7 @@ if ( MINGW OR UNIX OR MSYS ) # MINGW, Linux, APPLE, CYGWIN + + if (COMPILER_IS_GCC OR COMPILER_IS_CLANG) + # This fails under Fedora - MinGW - Gcc 8.3 +- if (NOT MINGW) ++ if (NOT (MINGW OR CMAKE_HOST_SOLARIS)) + check_c_compiler_flag(-fstack-clash-protection HAS_FSTACK_CLASH_PROTECTION) + check_c_compiler_flag(-fcf-protection HAS_FCF_PROTECTION) + check_c_compiler_flag(-fstack-protector-strong HAS_FSTACK_PROTECTOR_STRONG) +-- +2.25.4 + diff --git a/build/flatpak/patches/exiv2-0003-Use-check_cxx_compiler_flags-instead-of-C-version.patch b/build/flatpak/patches/exiv2-0003-Use-check_cxx_compiler_flags-instead-of-C-version.patch new file mode 100644 index 00000000000..24a462dfd72 --- /dev/null +++ b/build/flatpak/patches/exiv2-0003-Use-check_cxx_compiler_flags-instead-of-C-version.patch @@ -0,0 +1,36 @@ +From bfd0e0593bcb1ae4735f8178f047c05d58969bb4 Mon Sep 17 00:00:00 2001 +From: Luis Diaz Mas +Date: Wed, 16 Sep 2020 10:24:46 +0200 +Subject: [PATCH] Use check_cxx_compiler_flags instead of C version + +--- + cmake/compilerFlags.cmake | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/cmake/compilerFlags.cmake b/cmake/compilerFlags.cmake +index 63075421..fb9baf38 100644 +--- a/cmake/compilerFlags.cmake ++++ b/cmake/compilerFlags.cmake +@@ -1,5 +1,5 @@ + # These flags applies to exiv2lib, the applications, and to the xmp code +-include(CheckCCompilerFlag) ++include(CheckCXXCompilerFlag) + + if ( MINGW OR UNIX OR MSYS ) # MINGW, Linux, APPLE, CYGWIN + if (${CMAKE_CXX_COMPILER_ID} STREQUAL GNU) +@@ -25,9 +25,9 @@ if ( MINGW OR UNIX OR MSYS ) # MINGW, Linux, APPLE, CYGWIN + if (COMPILER_IS_GCC OR COMPILER_IS_CLANG) + # This fails under Fedora - MinGW - Gcc 8.3 + if (NOT (MINGW OR CMAKE_HOST_SOLARIS)) +- check_c_compiler_flag(-fstack-clash-protection HAS_FSTACK_CLASH_PROTECTION) +- check_c_compiler_flag(-fcf-protection HAS_FCF_PROTECTION) +- check_c_compiler_flag(-fstack-protector-strong HAS_FSTACK_PROTECTOR_STRONG) ++ check_cxx_compiler_flag(-fstack-clash-protection HAS_FSTACK_CLASH_PROTECTION) ++ check_cxx_compiler_flag(-fcf-protection HAS_FCF_PROTECTION) ++ check_cxx_compiler_flag(-fstack-protector-strong HAS_FSTACK_PROTECTOR_STRONG) + if(HAS_FSTACK_CLASH_PROTECTION) + add_compile_options(-fstack-clash-protection) + endif() +-- +2.25.4 + -- GitLab