diff --git a/checks/check-static-exts-cross-android.nix b/checks/check-static-exts-cross-android.nix new file mode 100644 index 0000000..a60d591 --- /dev/null +++ b/checks/check-static-exts-cross-android.nix @@ -0,0 +1,37 @@ +{ self, pkgs }: +let + pkgs' = pkgs.pkgsCross.aarch64-android; + + sqlite-example-exts-static = pkgs'.callPackage ./util/sqlite-example-exts-static.nix { }; + + sqlite-with-static-exts = self.mkSqlite { + pkgs = 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"; + } + { + library = "${sqlite-example-exts-static}/lib/libmultext.a"; + init = "sqlite3_multext_init"; + } + ]; + }; +in +pkgs'.runCommand "test-sqlite-with-static-exts-aarch64" { + nativeBuildInputs = [ sqlite-with-static-exts.sqlite-cli ]; + + passthru = { + inherit sqlite-example-exts-static; + inherit sqlite-with-static-exts; + }; +} '' + mkdir -p "$out" + sqlite3 :memory: <<<"SELECT myadd(1, 2), mysub(5, 3), mymult(4, 6);" | tee "$out/test.log" + grep -q -F "3|2|24" "$out/test.log" || (echo "Unexpected output from sqlite3 with static extensions" && exit 1) + '' diff --git a/flake.nix b/flake.nix index abd59ec..95a206e 100644 --- a/flake.nix +++ b/flake.nix @@ -44,6 +44,7 @@ checks = forAllSystems (system: pkgs: { checkStaticExts = import ./checks/check-static-exts.nix { inherit self pkgs; }; checkStaticExtsCross = import ./checks/check-static-exts-cross.nix { inherit self pkgs; }; + checkStaticExtsCrossAndroid = import ./checks/check-static-exts-cross-android.nix { inherit self pkgs; }; }); }; }