Skip to content

Commit 79f644d

Browse files
committed
Bump SQLite from 3.48.0 to 3.49.0
Close: #19
1 parent 24fa800 commit 79f644d

File tree

2 files changed

+243
-11
lines changed

2 files changed

+243
-11
lines changed

Formula/sqlb-sqlite.rb

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
class SqlbSqlite < Formula
22
desc "Command-line interface for SQLite"
33
homepage "https://sqlite.org/index.html"
4-
url "https://www.sqlite.org/2025/sqlite-autoconf-3480000.tar.gz"
5-
version "3.48.0"
6-
sha256 "ac992f7fca3989de7ed1fe99c16363f848794c8c32a158dafd4eb927a2e02fd5"
4+
url "https://www.sqlite.org/2025/sqlite-autoconf-3490000.tar.gz"
5+
version "3.49.0"
6+
sha256 "4d8bfa0b55e36951f6e5a9fb8c99f3b58990ab785c57b4f84f37d163a0672759"
77
license "blessing"
88
env :std
99

1010
bottle do
1111
root_url "https://nightlies.sqlitebrowser.org/homebrew_bottles"
1212
rebuild 1
13-
sha256 cellar: :any, arm64_sonoma: "e6b03a12f5d0392595b99b1564dbbc027f4517fcc578517be2b0641985f4a9e9"
13+
sha256 cellar: :any, arm64_sonoma: "9436a0ca1e59bc451ae5dcb682947d1c009f8203443b99d5eb4882cf798ae4c2"
1414
end
1515

1616
livecheck do
@@ -25,6 +25,13 @@ class SqlbSqlite < Formula
2525

2626
depends_on arch: :arm64
2727

28+
# Fix bugs occuring in SQLite version 3.9.0
29+
# Upstream discussion: https://sqlite.org/forum/forumpost/a179331cbb
30+
patch do
31+
url "https://raw.githubusercontent.com/sqlitebrowser/homebrew-tap/refs/heads/main/Patches/sqlb-sqlite_3.9.0_autoconf-fix.patch"
32+
sha256 "88186f292c2739ba1905d6493ec3ef0211f63760dcbade37a14d6112899ba9cf"
33+
end
34+
2835
def install
2936
# Determine the minimum macOS version.
3037
# Match the required version of the DB Browser for SQLite app.
@@ -57,15 +64,15 @@ def install
5764
-DSQLITE_USE_URI=1
5865
].join(" ")
5966

60-
args = %W[
61-
--prefix=#{prefix}
62-
--disable-dependency-tracking
63-
--enable-dynamic-extensions
64-
--disable-readline
65-
--disable-editline
67+
args = [
68+
"--disable-readline",
69+
"--disable-editline",
70+
"--enable-session",
71+
"--with-readline-cflags=-I#{Formula["readline"].opt_include}",
72+
"--with-readline-ldflags=-L#{Formula["readline"].opt_lib} -lreadline",
6673
]
6774

68-
system "./configure", *args
75+
system "./configure", *args, *std_configure_args
6976
system "make", "install"
7077

7178
# Avoid rebuilds of dependants that hardcode this path.
Lines changed: 225 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
From 58ef3022afe3e67eac22f65f14fb5fe7a02fa2f7 Mon Sep 17 00:00:00 2001
2+
From: Rui Chen <rui@chenrui.dev>
3+
Date: Fri, 7 Feb 2025 12:18:33 -0500
4+
Subject: [PATCH] chore: patch
5+
6+
Signed-off-by: Rui Chen <rui@chenrui.dev>
7+
---
8+
Makefile.in | 55 ++++++++++++++++++++++++++-----------
9+
auto.def | 3 +-
10+
autosetup/sqlite-config.tcl | 46 ++++++++++++++++++++++++++++++-
11+
3 files changed, 85 insertions(+), 19 deletions(-)
12+
13+
diff --git a/Makefile.in b/Makefile.in
14+
index 0c97f16..2f6d15e 100644
15+
--- a/Makefile.in
16+
+++ b/Makefile.in
17+
@@ -1,8 +1,17 @@
18+
########################################################################
19+
# This is a main makefile for the "autoconf" bundle of SQLite. This is
20+
# a trimmed-down version of the canonical makefile, devoid of most
21+
-# documentation. For the full docs, see 'main.mk' in the canonical
22+
+# documentation. For the full docs, see /main.mk in the canonical
23+
# source tree.
24+
+#
25+
+# Maintenance reminders:
26+
+#
27+
+# - To keep this working with an out-of-tree build, be sure to prefix
28+
+# input file names with $(TOP)/ where appropriate (which is most
29+
+# places).
30+
+#
31+
+# - The original/canonical recipes can be found in /main.mk in the
32+
+# canonical source tree.
33+
all:
34+
35+
TOP = @abs_top_srcdir@
36+
@@ -60,7 +69,6 @@ LDFLAGS.readline = @LDFLAGS_READLINE@
37+
CFLAGS.readline = @CFLAGS_READLINE@
38+
LDFLAGS.icu = @LDFLAGS_ICU@
39+
CFLAGS.icu = @CFLAGS_ICU@
40+
-LDFLAGS.libsqlite3.soname = @LDFLAGS_LIBSQLITE3_SONAME@
41+
42+
# When cross-compiling, we need to avoid the -s flag because it only
43+
# works on the build host's platform.
44+
@@ -78,7 +86,7 @@ install-dir.all = $(install-dir.bin) $(install-dir.include) \
45+
$(install-dir.lib) $(install-dir.man1) \
46+
$(install-dir.pkgconfig)
47+
$(install-dir.all):
48+
- $(INSTALL) -d "$@"
49+
+ @if [ ! -d "$@" ]; then $(INSTALL) -d "$@"; fi
50+
51+
52+
#
53+
@@ -115,23 +123,28 @@ SHELL_OPT ?= @OPT_SHELL@
54+
#
55+
OPT_FEATURE_FLAGS = @OPT_FEATURE_FLAGS@
56+
57+
+LDFLAGS.libsqlite3.soname = @LDFLAGS_LIBSQLITE3_SONAME@
58+
+# soname: see https://sqlite.org/src/forumpost/5a3b44f510df8ded
59+
+LDFLAGS.libsqlite3.os-specific = @LDFLAGS_MAC_CVERSION@
60+
+# os-specific: see https://sqlite.org/forum/forumpost/9dfd5b8fd525a5d7
61+
+
62+
LDFLAGS.libsqlite3 = \
63+
$(LDFLAGS.rpath) $(LDFLAGS.pthread) \
64+
$(LDFLAGS.math) $(LDFLAGS.dlopen) \
65+
$(LDFLAGS.zlib) $(LDFLAGS.icu) \
66+
$(LDFLAGS.configure)
67+
-LDFLAGS.libsqlite3.soname = @LDFLAGS_LIBSQLITE3_SONAME@
68+
CFLAGS.libsqlite3 = -I. $(CFLAGS.core) $(CFLAGS.icu) $(OPT_FEATURE_FLAGS)
69+
70+
-sqlite3.o: sqlite3.h sqlite3.c
71+
- $(CC) -c sqlite3.c -o $@ $(CFLAGS) $(CFLAGS.libsqlite3)
72+
+sqlite3.o: $(TOP)/sqlite3.h $(TOP)/sqlite3.c
73+
+ $(CC) -c $(TOP)/sqlite3.c -o $@ $(CFLAGS) $(CFLAGS.libsqlite3)
74+
75+
libsqlite3.LIB = libsqlite3$(T.lib)
76+
libsqlite3.SO = libsqlite3$(T.dll)
77+
78+
$(libsqlite3.SO): sqlite3.o
79+
$(CC) -o $@ sqlite3.o $(LDFLAGS.shlib) \
80+
- $(LDFLAGS) $(LDFLAGS.libsqlite3) $(LDFLAGS.libsqlite3.soname)
81+
+ $(LDFLAGS) $(LDFLAGS.libsqlite3) \
82+
+ $(LDFLAGS.libsqlite3.os-specific) $(LDFLAGS.libsqlite3.soname)
83+
all: $(libsqlite3.SO)
84+
85+
$(libsqlite3.LIB): sqlite3.o
86+
@@ -140,8 +153,16 @@ all: $(libsqlite3.LIB)
87+
88+
install-so-1: $(install-dir.lib) $(libsqlite3.SO)
89+
$(INSTALL) $(libsqlite3.SO) "$(install-dir.lib)"
90+
- @echo "Setting up $(libsqlite3.SO) symlinks..."; \
91+
- cd "$(install-dir.lib)" || exit $$?; \
92+
+ @echo "Setting up $(libsqlite3.SO) version symlinks..."; \
93+
+ cd "$(install-dir.lib)" || exit $$?; \
94+
+ if [ x.dylib = x$(T.dll) ]; then \
95+
+ rm -f libsqlite3.0$(T.dll) libsqlite3.$(PACKAGE_VERSION)$(T.dll) || exit $$?; \
96+
+ dllname=libsqlite3.$(PACKAGE_VERSION)$(T.dll); \
97+
+ mv $(libsqlite3.SO) $$dllname || exit $$?; \
98+
+ ln -s $$dllname $(libsqlite3.SO) || exit $$?; \
99+
+ ln -s $$dllname libsqlite3.0$(T.dll) || exit $$?; \
100+
+ ls -la $$dllname $(libsqlite3.SO) libsqlite3.0$(T.dll); \
101+
+ else \
102+
rm -f $(libsqlite3.SO).0 $(libsqlite3.SO).$(PACKAGE_VERSION) || exit $$?; \
103+
mv $(libsqlite3.SO) $(libsqlite3.SO).$(PACKAGE_VERSION) || exit $$?; \
104+
ln -s $(libsqlite3.SO).$(PACKAGE_VERSION) $(libsqlite3.SO) || exit $$?; \
105+
@@ -157,7 +178,9 @@ install-so-1: $(install-dir.lib) $(libsqlite3.SO)
106+
rm -f libsqlite3.la $(libsqlite3.SO).0.8.6 || exit $$?; \
107+
ln -s $(libsqlite3.SO).$(PACKAGE_VERSION) $(libsqlite3.SO).0.8.6 || exit $$?; \
108+
ls -la $(libsqlite3.SO).0.8.6; \
109+
- fi
110+
+ fi; \
111+
+ fi
112+
+
113+
install-so-0 install-so-:
114+
install-so: install-so-$(ENABLE_LIB_SHARED)
115+
install: install-so
116+
@@ -169,9 +192,9 @@ install-lib: install-lib-$(ENABLE_LIB_STATIC)
117+
install: install-lib
118+
119+
120+
-sqlite3$(T.exe): shell.c sqlite3.c
121+
+sqlite3$(T.exe): $(TOP)/shell.c $(TOP)/sqlite3.c
122+
$(CC) -o $@ \
123+
- shell.c sqlite3.c \
124+
+ $(TOP)/shell.c $(TOP)/sqlite3.c \
125+
-I. $(OPT_FEATURE_FLAGS) $(SHELL_OPT) \
126+
$(CFLAGS) $(CFLAGS.readline) $(CFLAGS.icu) \
127+
$(LDFLAGS) $(LDFLAGS.libsqlite3) $(LDFLAGS.readline)
128+
@@ -181,16 +204,16 @@ install-shell: sqlite3$(T.exe) $(install-dir.bin)
129+
$(INSTALL.strip) sqlite3$(T.exe) "$(install-dir.bin)"
130+
install: install-shell
131+
132+
-install-headers: sqlite3.h $(install-dir.include)
133+
- $(INSTALL.noexec) sqlite3.h sqlite3ext.h "$(install-dir.include)"
134+
+install-headers: $(TOP)/sqlite3.h $(install-dir.include)
135+
+ $(INSTALL.noexec) $(TOP)/sqlite3.h $(TOP)/sqlite3ext.h "$(install-dir.include)"
136+
install: install-headers
137+
138+
install-pc: sqlite3.pc $(install-dir.pkgconfig)
139+
$(INSTALL.noexec) sqlite3.pc "$(install-dir.pkgconfig)"
140+
install: install-pc
141+
142+
-install-man1: sqlite3.1 $(install-dir.man1)
143+
- $(INSTALL.noexec) sqlite3.1 "$(install-dir.man1)"
144+
+install-man1: $(TOP)/sqlite3.1 $(install-dir.man1)
145+
+ $(INSTALL.noexec) $(TOP)/sqlite3.1 "$(install-dir.man1)"
146+
install: install-man1
147+
148+
clean:
149+
diff --git a/auto.def b/auto.def
150+
index 12eb3d7..72f5009 100644
151+
--- a/auto.def
152+
+++ b/auto.def
153+
@@ -94,5 +94,4 @@ sqlite-handle-icu
154+
define ENABLE_LIB_SHARED [opt-bool shared]
155+
define ENABLE_LIB_STATIC [opt-bool static]
156+
157+
-sqlite-process-dot-in-files
158+
-sqlite-post-config-validation
159+
+sqlite-common-late-stage-config
160+
diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl
161+
index 9f300e3..cabb32a 100644
162+
--- a/autosetup/sqlite-config.tcl
163+
+++ b/autosetup/sqlite-config.tcl
164+
@@ -43,7 +43,10 @@ set sqliteConfig(is-cross-compiling) [proj-is-cross-compiling]
165+
166+
########################################################################
167+
# Runs some common initialization which must happen immediately after
168+
-# autosetup's [options] function is called.
169+
+# autosetup's [options] function is called. This is also a convenient
170+
+# place to put some generic pieces common to both the canonical
171+
+# top-level build and the "autoconf" build, but it's not intended to
172+
+# be a catch-all dumping ground for such.
173+
proc sqlite-post-options-init {} {
174+
#
175+
# Carry values from hidden --flag aliases over to their canonical
176+
@@ -861,6 +864,47 @@ proc sqlite-handle-math {} {
177+
}
178+
}
179+
180+
+########################################################################
181+
+# If this OS looks like a Mac, checks for the Mac-specific
182+
+# -current_version and -compatibility_version linker flags. Defines
183+
+# LDFLAGS_MAC_CVERSION to an empty string and returns 0 if they're not
184+
+# supported, else defines that to the linker flags and returns 1.
185+
+#
186+
+# We don't check this on non-Macs because this whole thing is a
187+
+# libtool compatibility kludge to account for a version stamp which
188+
+# libtool applied only on Mac platforms.
189+
+#
190+
+# Based on https://sqlite.org/forum/forumpost/9dfd5b8fd525a5d7.
191+
+proc sqlite-check-mac-cversion {} {
192+
+ define LDFLAGS_MAC_CVERSION ""
193+
+ set rc 0
194+
+ if {[proj-looks-like-mac]} {
195+
+ cc-with {} {
196+
+ # These version numbers are historical libtool-defined values, not
197+
+ # library-defined ones
198+
+ if {[cc-check-flags "-Wl,-current_version,9.6.0"]
199+
+ && [cc-check-flags "-Wl,-compatibility_version,9.0.0"]} {
200+
+ define LDFLAGS_MAC_CVERSION "-Wl,-compatibility_version,9.0.0 -Wl,-current_version,9.6.0"
201+
+ set rc 1
202+
+ } elseif {[cc-check-flags "-compatibility_version 9.0.0"]
203+
+ && [cc-check-flags "-current_version 9.6.0"]} {
204+
+ define LDFLAGS_MAC_CVERSION "-compatibility_version 9.0.0 -current_version 9.6.0"
205+
+ set rc 1
206+
+ }
207+
+ }
208+
+ }
209+
+ return $rc
210+
+}
211+
+
212+
+########################################################################
213+
+# Performs late-stage config steps common to both the canonical and
214+
+# autoconf bundle builds.
215+
+proc sqlite-common-late-stage-config {} {
216+
+ sqlite-check-mac-cversion
217+
+ sqlite-process-dot-in-files
218+
+ sqlite-post-config-validation
219+
+}
220+
+
221+
########################################################################
222+
# Perform some late-stage work and generate the configure-process
223+
# output file(s).
224+
--
225+
2.48.1

0 commit comments

Comments
 (0)