diff options
author | Conrad Pankoff <deoxxa@fknsrs.biz> | 2019-08-05 00:47:30 +1000 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-08-04 18:54:12 +0200 |
commit | cd235ce27d6346ae37ffd6cf200b355f34669a61 (patch) | |
tree | 7ea7734fc7c12735b41a00f65046f3dbc0cc5619 /Ports | |
parent | c0ba6f69f08277b835e566ee125f5a2d7fd2daad (diff) | |
download | serenity-cd235ce27d6346ae37ffd6cf200b355f34669a61.zip |
Ports: mbedtls
This is a very basic mbedtls port. I've disabled the networking bits,
since they want some macros that we don't have defined. We might not even
want the networking functions anyway, since they wouldn't play very nice
with CEventLoop and friends.
Diffstat (limited to 'Ports')
-rw-r--r-- | Ports/mbedtls/add-missing-includes.patch | 22 | ||||
-rwxr-xr-x | Ports/mbedtls/mbedtls.sh | 25 | ||||
-rw-r--r-- | Ports/mbedtls/remove-net-from-config.patch | 12 |
3 files changed, 59 insertions, 0 deletions
diff --git a/Ports/mbedtls/add-missing-includes.patch b/Ports/mbedtls/add-missing-includes.patch new file mode 100644 index 0000000000..70918bc2a8 --- /dev/null +++ b/Ports/mbedtls/add-missing-includes.patch @@ -0,0 +1,22 @@ +diff -u -r mbedtls/library/ssl_tls.c mbedtls-patched/library/ssl_tls.c +--- mbedtls/library/ssl_tls.c 2019-06-18 23:23:28.000000000 +1000 ++++ mbedtls-patched/library/ssl_tls.c 2019-08-05 00:36:37.049255960 +1000 +@@ -49,6 +49,7 @@ + #include "mbedtls/platform_util.h" + + #include <string.h> ++#include <stdint.h> + + #if defined(MBEDTLS_X509_CRT_PARSE_C) + #include "mbedtls/oid.h" +diff -u -r mbedtls/library/x509_crt.c mbedtls-patched/library/x509_crt.c +--- mbedtls/library/x509_crt.c 2019-06-18 23:23:28.000000000 +1000 ++++ mbedtls-patched/library/x509_crt.c 2019-08-05 00:24:22.606023827 +1000 +@@ -75,6 +75,7 @@ + #include <sys/types.h> + #include <sys/stat.h> + #include <dirent.h> ++#include <unistd.h> + #endif /* !_WIN32 || EFIX64 || EFI32 */ + #endif + diff --git a/Ports/mbedtls/mbedtls.sh b/Ports/mbedtls/mbedtls.sh new file mode 100755 index 0000000000..b2c5593170 --- /dev/null +++ b/Ports/mbedtls/mbedtls.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +PORT_DIR=mbedtls + +fetch() { + run_fetch_web "https://tls.mbed.org/download/mbedtls-2.16.2-apache.tgz" + run_patch remove-net-from-config.patch -p1 + run_patch add-missing-includes.patch -p1 +} + +configure() { + echo "move along, nothing to see here" +} + +build() { + run_export_env CC i686-pc-serenity-gcc + run_make clean + run_make CFLAGS=-DPLATFORM_UTIL_USE_GMTIME +} + +install() { + run_make_install DESTDIR="$SERENITY_ROOT"/Root +} + +. ../.port_include.sh diff --git a/Ports/mbedtls/remove-net-from-config.patch b/Ports/mbedtls/remove-net-from-config.patch new file mode 100644 index 0000000000..15a225e09b --- /dev/null +++ b/Ports/mbedtls/remove-net-from-config.patch @@ -0,0 +1,12 @@ +diff -u -r mbedtls/include/mbedtls/config.h mbedtls-patched/include/mbedtls/config.h +--- mbedtls/include/mbedtls/config.h 2019-06-18 23:23:28.000000000 +1000 ++++ mbedtls-patched/include/mbedtls/config.h 2019-08-05 00:27:17.322830039 +1000 +@@ -2460,7 +2460,7 @@ + * + * This module provides networking routines. + */ +-#define MBEDTLS_NET_C ++//#define MBEDTLS_NET_C + + /** + * \def MBEDTLS_OID_C |