mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-30 11:50:06 +00:00
syncstorage-rs: add dbBackend argument for PostgreSQL support
This commit is contained in:
@@ -6,10 +6,13 @@
|
||||
python3,
|
||||
cmake,
|
||||
libmysqlclient,
|
||||
libpq,
|
||||
openssl,
|
||||
makeBinaryWrapper,
|
||||
lib,
|
||||
nix-update-script,
|
||||
nixosTests,
|
||||
dbBackend ? "mysql",
|
||||
}:
|
||||
|
||||
let
|
||||
@@ -46,9 +49,26 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
||||
python3
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
libmysqlclient
|
||||
];
|
||||
buildInputs =
|
||||
lib.optional (dbBackend == "mysql") libmysqlclient
|
||||
++ lib.optionals (dbBackend == "postgresql") [
|
||||
libpq
|
||||
openssl
|
||||
];
|
||||
|
||||
buildNoDefaultFeatures = true;
|
||||
# The syncserver "postgres" feature only enables syncstorage-db/postgres.
|
||||
# tokenserver-db/postgres must be enabled separately so the tokenserver
|
||||
# can also connect to PostgreSQL (it dispatches on the URL scheme at runtime).
|
||||
buildFeatures =
|
||||
let
|
||||
cargoFeature = if dbBackend == "postgresql" then "postgres" else dbBackend;
|
||||
in
|
||||
[
|
||||
cargoFeature
|
||||
"tokenserver-db/${cargoFeature}"
|
||||
"py_verifier"
|
||||
];
|
||||
|
||||
env = {
|
||||
SWAGGER_UI_DOWNLOAD_URL = "file://${swaggerUi}";
|
||||
|
||||
Reference in New Issue
Block a user