summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2021-12-24 05:22:03 +0330
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-12-24 17:01:10 +0330
commitf7b399da442f03822da7d61a02bf2f879ad6d417 (patch)
tree614c0fe20ce134945ae844a64b4d26f3742e8fd9
parent49749e279aeab4a3da0e6e94333aaa8125ecb1a4 (diff)
downloadserenity-f7b399da442f03822da7d61a02bf2f879ad6d417.zip
Ports: Fix the conflicting types issue in the cmake port
This patch is pending upstream, but until then, let's keep it locally to make the port work :^)
-rw-r--r--Ports/cmake/patches/0001-cmnghttp2-check-for-HAVE_SIZEOF_SSIZE_T-and-not-HAVE.patch37
-rw-r--r--Ports/cmake/patches/ReadMe.md10
2 files changed, 47 insertions, 0 deletions
diff --git a/Ports/cmake/patches/0001-cmnghttp2-check-for-HAVE_SIZEOF_SSIZE_T-and-not-HAVE.patch b/Ports/cmake/patches/0001-cmnghttp2-check-for-HAVE_SIZEOF_SSIZE_T-and-not-HAVE.patch
new file mode 100644
index 0000000000..0880831021
--- /dev/null
+++ b/Ports/cmake/patches/0001-cmnghttp2-check-for-HAVE_SIZEOF_SSIZE_T-and-not-HAVE.patch
@@ -0,0 +1,37 @@
+From b36d25744e2db7989352ad48e00f4c7e87ed65c2 Mon Sep 17 00:00:00 2001
+From: Ali Mohammad Pur <ali.mpfard@gmail.com>
+Date: Fri, 24 Dec 2021 05:13:08 +0330
+Subject: [PATCH] cmnghttp2: check for HAVE_SIZEOF_SSIZE_T and not HAVE_SSIZE_T
+
+The `check_size_type(ssize_t SIZEOF_SSIZE_T` call in cmcurl (referenced
+by the comment above, which also references some other variables that
+no longer seem to be used) defines HAVE_SIZEOF_SSIZE_T and not
+HAVE_SSIZE_T.
+The HAVE_SSIZE_T variable *does* get defined, but via the
+`CHECK_SIZE_TYPE(ssize_t SSIZE_T)` call in cmlibarchive, which gets
+configured *after* cmnghttp2, and so the first configure leads to an
+invalid cmnghttp2/config.h file.
+---
+ Utilities/cmnghttp2/CMakeLists.txt | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/Utilities/cmnghttp2/CMakeLists.txt b/Utilities/cmnghttp2/CMakeLists.txt
+index 3bc2778e..7e8bf99b 100644
+--- a/Utilities/cmnghttp2/CMakeLists.txt
++++ b/Utilities/cmnghttp2/CMakeLists.txt
+@@ -7,10 +7,8 @@ elseif(CMAKE_C_COMPILER_ID STREQUAL "PathScale")
+ endif()
+
+ # Re-use some check result cache entries from cmcurl:
+-# * HAVE_ARPA_INET_H
+-# * HAVE_NETINET_IN_H
+-# * HAVE_SSIZE_T
+-if(NOT HAVE_SSIZE_T)
++# * HAVE_SIZEOF_SSIZE_T
++if(NOT HAVE_SIZEOF_SSIZE_T)
+ set(ssize_t KWIML_INT_intptr_t)
+ endif()
+ configure_file(cmakeconfig.h.in config.h)
+--
+2.34.1
+
diff --git a/Ports/cmake/patches/ReadMe.md b/Ports/cmake/patches/ReadMe.md
index fa92ec0439..9018ea2e6b 100644
--- a/Ports/cmake/patches/ReadMe.md
+++ b/Ports/cmake/patches/ReadMe.md
@@ -1,5 +1,15 @@
# Patches for CMake (and submodules) on SerenityOS
+## `0001-cmnghttp2-check-for-HAVE_SIZEOF_SSIZE_T-and-not-HAVE.patch`
+
+Fixes an issue where the first configure of cmake would generate an invalid config.h file somewhere, leading to the first run of `./package.sh` failing due to what `0016-conflicting-0.patch` and `0017-conflicting-1.patch` attempt to fix.
+
+### Status
+- [ ] Local?
+- [X] Should be merged to upstream?
+- [ ] Resolves issues(s) with our side of things
+- [ ] Hack
+
## `0010-don-t-use-siginfo.patch`
We don't support SIGINFO. This patch removes uses of SIGINFO.