From 9c141d0a876b5dc7660346d216e74b773e1656f6 Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Sat, 27 Mar 2021 12:38:07 +0100 Subject: [PATCH] Ports: Add SQLite --- Ports/AvailablePorts.md | 1 + Ports/sqlite/package.sh | 7 +++++++ Ports/sqlite/patches/config.sub.patch | 11 +++++++++++ Ports/sqlite/patches/shell.c.patch | 13 +++++++++++++ Ports/sqlite/patches/sqlite3.c.patch | 18 ++++++++++++++++++ 5 files changed, 50 insertions(+) create mode 100755 Ports/sqlite/package.sh create mode 100644 Ports/sqlite/patches/config.sub.patch create mode 100644 Ports/sqlite/patches/shell.c.patch create mode 100644 Ports/sqlite/patches/sqlite3.c.patch diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md index ba462df3e16..009c49dc0e6 100644 --- a/Ports/AvailablePorts.md +++ b/Ports/AvailablePorts.md @@ -73,6 +73,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^ | [`SDL2_ttf`](SDL2_ttf/) | SDL2\_ttf (TrueType Font add-on for SDL2) | 2.0.15 | https://www.libsdl.org/projects/SDL_ttf/ | | [`sed`](sed/) | GNU sed | 4.2.1 | https://www.gnu.org/software/sed/ | | [`sl`](sl/) | Steam Locomotive (SL) | | https://github.com/mtoyoda/sl | +| [`sqlite`](sqlite/) | SQLite | 3350300 | https://www.sqlite.org/ | | [`stress-ng`](stress-ng/) | stress-ng | 0.11.23 | https://github.com/ColinIanKing/stress-ng | | [`termcap`](termcap/) | GNU termcap | 1.3.1 | https://www.gnu.org/software/termutils/ | | [`tinycc`](tinycc/) | Tiny C Compiler (TinyCC) | dev | https://github.com/TinyCC/tinycc | diff --git a/Ports/sqlite/package.sh b/Ports/sqlite/package.sh new file mode 100755 index 00000000000..ee58c75633c --- /dev/null +++ b/Ports/sqlite/package.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env -S bash ../.port_include.sh +port=sqlite +useconfigure="true" +version="3350300" +files="https://www.sqlite.org/2021/sqlite-autoconf-${version}.tar.gz sqlite-autoconf-${version}.tar.gz" +workdir="sqlite-autoconf-${version}" +configopts="CFLAGS=-DHAVE_UTIME" diff --git a/Ports/sqlite/patches/config.sub.patch b/Ports/sqlite/patches/config.sub.patch new file mode 100644 index 00000000000..9695dc61807 --- /dev/null +++ b/Ports/sqlite/patches/config.sub.patch @@ -0,0 +1,11 @@ +--- sqlite-autoconf-3350300/config.sub 2021-03-26 15:25:02.000000000 +0100 ++++ sqlite-autoconf-port/config.sub 2021-03-26 23:31:42.457629453 +0100 +@@ -1366,7 +1366,7 @@ + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ +- | -sym* | -kopensolaris* | -plan9* \ ++ | -sym* | -kopensolaris* | -plan9* | -serenity* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ diff --git a/Ports/sqlite/patches/shell.c.patch b/Ports/sqlite/patches/shell.c.patch new file mode 100644 index 00000000000..776f182abe6 --- /dev/null +++ b/Ports/sqlite/patches/shell.c.patch @@ -0,0 +1,13 @@ +--- sqlite-autoconf-3350300/shell.c 2021-03-26 15:24:58.000000000 +0100 ++++ sqlite-autoconf-port/shell.c 2021-03-27 12:05:40.289547647 +0100 +@@ -2554,6 +2554,10 @@ + if( utimensat(AT_FDCWD, zFile, times, AT_SYMLINK_NOFOLLOW) ){ + return 1; + } ++#elif defined(HAVE_UTIME) ++ int rc = utime(zFile, NULL); ++ if (rc < 0) ++ return 1; + #else + /* Legacy unix */ + struct timeval times[2]; diff --git a/Ports/sqlite/patches/sqlite3.c.patch b/Ports/sqlite/patches/sqlite3.c.patch new file mode 100644 index 00000000000..d938013bb39 --- /dev/null +++ b/Ports/sqlite/patches/sqlite3.c.patch @@ -0,0 +1,18 @@ +--- sqlite-autoconf-3350300/sqlite3.c 2021-03-26 15:24:58.000000000 +0100 ++++ sqlite-autoconf-port/sqlite3.c 2021-03-27 12:30:47.197494792 +0100 +@@ -41852,6 +41852,7 @@ + ** array cannot be const. + */ + static sqlite3_vfs aVfs[] = { ++ UNIXVFS("unix-none", nolockIoFinder ), + #if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__) + UNIXVFS("unix", autolockIoFinder ), + #elif OS_VXWORKS +@@ -41859,7 +41860,6 @@ + #else + UNIXVFS("unix", posixIoFinder ), + #endif +- UNIXVFS("unix-none", nolockIoFinder ), + UNIXVFS("unix-dotfile", dotlockIoFinder ), + UNIXVFS("unix-excl", posixIoFinder ), + #if OS_VXWORKS