Add initial support for building with extensions
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
enableDebug = [ true false ];
|
||||
enableInteractive = [ true false ];
|
||||
};
|
||||
in lib.mergeAttrsList (lib.mapCartesianProduct (args@{
|
||||
in lib.mergeAttrsList (lib.mapCartesianProduct ({
|
||||
enableMinimal,
|
||||
enableDebug,
|
||||
enableInteractive,
|
||||
@@ -35,11 +35,60 @@
|
||||
enableInteractive;
|
||||
};
|
||||
in {
|
||||
"sqlite${result.suffix}" = result.sqlite;
|
||||
"sqlite-amalgamation${result.suffix}" = result.amalgamation;
|
||||
"sqlite-cli${result.suffix}" = result.sqlite-cli;
|
||||
"sqlite-static${result.suffix}" = result.sqlite-static;
|
||||
"sqlite${result._suffix}" = result.sqlite;
|
||||
"sqlite-amalgamation${result._suffix}" = result.amalgamation;
|
||||
"sqlite-cli${result._suffix}" = result.sqlite-cli;
|
||||
"sqlite-static${result._suffix}" = result.sqlite-static;
|
||||
}) productVars));
|
||||
|
||||
checks = forAllSystems (system: pkgs: let
|
||||
sqlite-example-exts-static = pkgs.stdenv.mkDerivation {
|
||||
name = "sqlite-example-exts-static";
|
||||
src = ./sqlite-example-exts;
|
||||
|
||||
env.NIX_CFLAGS_COMPILE = "-DSQLITE_CORE";
|
||||
|
||||
buildInputs = with pkgs; [ sqlite.dev ];
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
"$CC" -c addext.c
|
||||
"$AR" rcs libaddext.a addext.o
|
||||
|
||||
"$CC" -c subext.c
|
||||
"$AR" rcs libsubext.a subext.o
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
install -Dm444 *.a -t "$out/lib"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
};
|
||||
|
||||
sqlite-with-static-exts = self.mkSqlite {
|
||||
inherit pkgs;
|
||||
|
||||
extensions = [
|
||||
{
|
||||
library = "${sqlite-example-exts-static}/lib/libaddext.a";
|
||||
init = "sqlite3_addext_init";
|
||||
}
|
||||
{
|
||||
library = "${sqlite-example-exts-static}/lib/libsubext.a";
|
||||
init = "sqlite3_subext_init";
|
||||
}
|
||||
];
|
||||
};
|
||||
in {
|
||||
inherit sqlite-example-exts-static;
|
||||
sqlite-with-static-ext = sqlite-with-static-exts.sqlite;
|
||||
sqlite-cli-with-static-ext = sqlite-with-static-exts.sqlite-cli;
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user