Add initial support for building with extensions

This commit is contained in:
2026-05-19 00:26:53 +09:00
parent 72b6cf722a
commit 9cd0e995bd
8 changed files with 281 additions and 29 deletions
+9 -6
View File
@@ -13,9 +13,10 @@
zlib,
icu,
amalgamate,
features,
featureFlags,
amalgamate ? true,
coreInitExt ? null,
features ? { },
featureFlags ? [ ],
enableInteractive ? false,
...
@@ -54,13 +55,15 @@ stdenv.mkDerivation (finalAttrs: {
"--${if static then "disable" else "enable"}-shared"
"--${if static then "enable" else "disable"}-static"
"--${if amalgamate then "enable" else "disable"}-amalgamation"
] ++ lib.optional features.ENABLE_ICU [
"--enable-icu-collations"
"--with-icu-config=${lib.getExe' icu.dev "icu-config"}"
];
env.NIX_CFLAGS_COMPILE = lib.concatStringsSep " " featureFlags;
env.NIX_CFLAGS_LINK = lib.optionalString features.ENABLE_FTS5 "-lm";
makeTarget = if static then "lib" else "so";
makeFlags = (coreInitExt.passthru.makeFlags or [ ]) ++ map (opt: "OPTIONS+=${lib.escapeShellArg opt}") featureFlags;
makeTarget = "sqlite3.la";
env.NIX_CFLAGS_LINK = lib.optionalString features.ENABLE_FTS5 "-lm";
env.NIX_LDFLAGS = lib.concatStringsSep " " (coreInitExt.passthru.extraLDFLAGS or [ ]);
})