3 , postgresqlSupport ? true
19 assert lib.assertMsg (sqliteSupport == true || postgresqlSupport == true || mysqlSupport == true)
20 "support for at least one database must be enabled";
23 inherit (lib) optional optionals optionalString;
26 rustPlatform.buildRustPackage rec {
32 crateName = "diesel_cli";
33 hash = "sha256-fpvC9C30DJy5ih+sFTTMoiykUHqG6OzDhF9jvix1Ctg=";
36 cargoHash = "sha256-nPmUCww8sOJwnG7+uIflLPgT87xPX0s7g0AcuDKhY2I=";
38 nativeBuildInputs = [ installShellFiles pkg-config ];
40 buildInputs = [ openssl ]
41 ++ optional stdenv.isDarwin Security
42 ++ optional (stdenv.isDarwin && mysqlSupport) libiconv
43 ++ optional sqliteSupport sqlite
44 ++ optional postgresqlSupport postgresql
45 ++ optionals mysqlSupport [ libmysqlclient zlib ];
47 buildNoDefaultFeatures = true;
48 buildFeatures = optional sqliteSupport "sqlite"
49 ++ optional postgresqlSupport "postgres"
50 ++ optional mysqlSupport "mysql";
54 '' + optionalString sqliteSupport ''
55 cargo check --features sqlite
56 '' + optionalString postgresqlSupport ''
57 cargo check --features postgres
58 '' + optionalString mysqlSupport ''
59 cargo check --features mysql
65 installShellCompletion --cmd diesel \
66 --bash <($out/bin/diesel completions bash) \
67 --fish <($out/bin/diesel completions fish) \
68 --zsh <($out/bin/diesel completions zsh)
71 # Fix the build with mariadb, which otherwise shows "error adding symbols:
72 # DSO missing from command line" errors for libz and libssl.
73 NIX_LDFLAGS = optionalString mysqlSupport "-lz -lssl -lcrypto";
76 description = "Database tool for working with Rust projects that use Diesel";
77 homepage = "https://github.com/diesel-rs/diesel/tree/master/diesel_cli";
78 license = with licenses; [ mit asl20 ];
79 maintainers = with maintainers; [ ];
80 mainProgram = "diesel";