nix: direct-sqlcipher patch, openssl flag for android (#1011)

This commit is contained in:
Evgeny Poberezkin
2022-09-02 22:03:53 +01:00
committed by GitHub
parent 7999e88554
commit ddde821064
3 changed files with 31 additions and 19 deletions

View File

@@ -25,7 +25,7 @@
};
sha256map = import ./scripts/nix/sha256map.nix;
modules = [{
packages.direct-sqlite.patches = [ ./scripts/nix/direct-sqlite-2.3.26.patch ];
packages.direct-sqlcipher.patches = [ ./scripts/nix/direct-sqlcipher-2.3.27.patch ];
packages.entropy.patches = [ ./scripts/nix/entropy.patch ];
}
({ pkgs,lib, ... }: lib.mkIf (pkgs.stdenv.hostPlatform.isAndroid) {
@@ -91,7 +91,12 @@
> $out/nix-support/hydra-build-products
'';
};
"aarch64-android:lib:simplex-chat" = (drv androidPkgs).simplex-chat.components.library.override {
"aarch64-android:lib:simplex-chat" = (drv' {
pkgs' = androidPkgs;
extra-modules = [{
packages.direct-sqlcipher.flags.openssl = true;
}];
}).simplex-chat.components.library.override {
smallAddressSpace = true; enableShared = false;
# for android we build a shared library, passing these arguments is a bit tricky, as
# we want only the threaded rts (HSrts_thr) and ffi to be linked, but not fed into iserv for
@@ -138,7 +143,12 @@
> $out/nix-support/hydra-build-products
'';
};
"x86_64-android:lib:simplex-chat" = (drv androidPkgs).simplex-chat.components.library.override {
"x86_64-android:lib:simplex-chat" = (drv' {
pkgs' = androidPkgs;
extra-modules = [{
packages.direct-sqlcipher.flags.openssl = true;
}];
}).simplex-chat.components.library.override {
smallAddressSpace = true; enableShared = false;
# for android we build a shared library, passing these arguments is a bit tricky, as
# we want only the threaded rts (HSrts_thr) and ffi to be linked, but not fed into iserv for
@@ -185,7 +195,12 @@
> $out/nix-support/hydra-build-products
'';
};
"x86_64-linux:lib:simplex-chat" = (drv androidPkgs).simplex-chat.components.library.override {
"x86_64-linux:lib:simplex-chat" = (drv' {
pkgs' = androidPkgs;
extra-modules = [{
packages.direct-sqlcipher.flags.openssl = true;
}];
}).simplex-chat.components.library.override {
smallAddressSpace = true; enableShared = false;
# for android we build a shared library, passing these arguments is a bit tricky, as
# we want only the threaded rts (HSrts_thr) and ffi to be linked, but not fed into iserv for

View File

@@ -0,0 +1,12 @@
diff --git a/direct-sqlcipher.cabal b/direct-sqlcipher.cabal
index 728ba3e..c63745e 100644
--- a/direct-sqlcipher.cabal
+++ b/direct-sqlcipher.cabal
@@ -84,6 +84,8 @@ library
cc-options: -DSQLITE_TEMP_STORE=2
-DSQLITE_HAS_CODEC
+ extra-libraries: dl
+
if !os(windows) && !os(android)
extra-libraries: pthread

View File

@@ -1,15 +0,0 @@
diff --git a/direct-sqlite.cabal b/direct-sqlite.cabal
index 96f26b7..996198e 100644
--- a/direct-sqlite.cabal
+++ b/direct-sqlite.cabal
@@ -69,7 +69,9 @@ library
install-includes: sqlite3.h, sqlite3ext.h
include-dirs: cbits
- if !os(windows) && !os(android)
+ extra-libraries: dl
+
+ if !os(windows) && !os(android)
extra-libraries: pthread
if flag(fulltextsearch)