File tree Expand file tree Collapse file tree
pkgs/by-name/sy/syncstorage-rs Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 python3 ,
77 cmake ,
88 libmysqlclient ,
9+ libpq ,
10+ openssl ,
911 makeBinaryWrapper ,
1012 lib ,
1113 nix-update-script ,
1214 nixosTests ,
15+ dbBackend ? "mysql" ,
1316} :
1417
1518let
@@ -46,9 +49,26 @@ rustPlatform.buildRustPackage (finalAttrs: {
4649 python3
4750 ] ;
4851
49- buildInputs = [
50- libmysqlclient
51- ] ;
52+ buildInputs =
53+ lib . optional ( dbBackend == "mysql" ) libmysqlclient
54+ ++ lib . optionals ( dbBackend == "postgresql" ) [
55+ libpq
56+ openssl
57+ ] ;
58+
59+ buildNoDefaultFeatures = true ;
60+ # The syncserver "postgres" feature only enables syncstorage-db/postgres.
61+ # tokenserver-db/postgres must be enabled separately so the tokenserver
62+ # can also connect to PostgreSQL (it dispatches on the URL scheme at runtime).
63+ buildFeatures =
64+ let
65+ cargoFeature = if dbBackend == "postgresql" then "postgres" else dbBackend ;
66+ in
67+ [
68+ cargoFeature
69+ "tokenserver-db/${ cargoFeature } "
70+ "py_verifier"
71+ ] ;
5272
5373 env = {
5474 SWAGGER_UI_DOWNLOAD_URL = "file://${ swaggerUi } " ;
You can’t perform that action at this time.
0 commit comments