Просмотр исходного кода

Ports: Convert curl port to use CMake, remove two autoconf patches

This removes the shlib hack from the install step, which repackaged the
static library as the shared one. It also has the benefit of making the
port work with the Clang toolchain :^).
Andrew Kaster 3 лет назад
Родитель
Сommit
12c352dfc9

+ 19 - 4
Ports/curl/package.sh

@@ -5,10 +5,25 @@ useconfigure=true
 files="https://curl.se/download/curl-${version}.tar.bz2 curl-${version}.tar.bz2 1e7a38d7018ec060f1f16df839854f0889e94e122c4cfa5d3a37c2dc56f1e258"
 auth_type=sha256
 depends=("openssl" "zlib" "zstd")
-configopts=("--disable-ntlm-wb" "--with-openssl=${SERENITY_INSTALL_ROOT}/usr/local" "--disable-symbol-hiding")
+configopts=("-DCMAKE_TOOLCHAIN_FILE=${SERENITY_BUILD_DIR}/CMakeToolchain.txt")
+
+configure() {
+    mkdir -p curl-build
+    cmake -G Ninja \
+    -S curl-${version} \
+    -B curl-build \
+    "${configopts[@]}" \
+    -DCURL_USE_OPENSSL=ON \
+    -DCURL_ZSTD=ON \
+    -DCURL_DISABLE_NTLM=ON \
+    -DCURL_DISABLE_TESTS=ON \
+    -DCURL_HIDDEN_SYMBOLS=OFF
+}
+
+build() {
+    ninja -C curl-build
+}
 
 install() {
-    run make DESTDIR=${SERENITY_INSTALL_ROOT} "${installopts[@]}" install
-    ${CC} -shared -o ${SERENITY_INSTALL_ROOT}/usr/local/lib/libcurl.so -Wl,-soname,libcurl.so -Wl,--whole-archive ${SERENITY_INSTALL_ROOT}/usr/local/lib/libcurl.a -Wl,--no-whole-archive -lzstd
-    rm -f ${SERENITY_INSTALL_ROOT}/usr/local/lib/libcurl.la
+    ninja -C curl-build install
 }

+ 0 - 63
Ports/curl/patches/disable-prototype-mismatch-check.patch

@@ -1,63 +0,0 @@
---- curl-7.81.0/configure.orig	2022-01-08 01:39:27.339369369 +0000
-+++ curl-7.81.0/configure	2022-01-08 01:40:30.218717020 +0000
-@@ -19836,50 +19836,8 @@
- rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
- 
- 
--    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler halts on function prototype mismatch" >&5
--printf %s "checking if compiler halts on function prototype mismatch... " >&6; }
--  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
--/* end confdefs.h.  */
- 
- 
--#     include <stdlib.h>
--      int rand(int n);
--      int rand(int n)
--      {
--        if(n)
--          return ++n;
--        else
--          return n;
--      }
--
--int main (void)
--{
--
--      int i[2]={0,0};
--      int j = rand(i[0]);
--      if(j)
--        return j;
--
-- ;
-- return 0;
--}
--
--_ACEOF
--if ac_fn_c_try_compile "$LINENO"
--then :
--
--    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
--printf "%s\n" "no" >&6; }
--    as_fn_error $? "compiler does not halt on function prototype mismatch." "$LINENO" 5
--
--else $as_nop
--
--    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
--printf "%s\n" "yes" >&6; }
--
--fi
--rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
--
- 
-       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler supports hiding library internal symbols" >&5
- printf %s "checking if compiler supports hiding library internal symbols... " >&6; }
---- curl-7.81.0/configure.ac.orig	2022-01-08 01:42:45.505315507 +0000
-+++ curl-7.81.0/configure.ac	2022-01-08 01:42:47.917290542 +0000
-@@ -420,7 +420,6 @@
- 
- CURL_CHECK_COMPILER_HALT_ON_ERROR
- CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
--CURL_CHECK_COMPILER_PROTOTYPE_MISMATCH
- CURL_CHECK_COMPILER_SYMBOL_HIDING
- 
- CURL_CHECK_CURLDEBUG

+ 0 - 11
Ports/curl/patches/fix-autoconf.patch

@@ -1,11 +0,0 @@
---- curl-7.81.0/config.sub.orig	2022-01-08 01:37:56.256315591 +0000
-+++ curl-7.81.0/config.sub	2022-01-08 01:38:02.352252211 +0000
-@@ -1368,7 +1368,7 @@
- 	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
- 	      | -sym* | -kopensolaris* | -plan9* \
- 	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
--	      | -aos* | -aros* | -cloudabi* | -sortix* \
-+	      | -aos* | -aros* | -cloudabi* | -sortix* | -serenity* \
- 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- 	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- 	      | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \