Force disable pkg-config for libsodum-sys and libzstd-sys

This commit is contained in:
Alex 2022-09-06 16:41:58 +02:00
parent 8d77a76df1
commit 7de53a4d66
Signed by untrusted user: lx
GPG key ID: 0E496D15096376BE

View file

@ -118,6 +118,10 @@ let
But we want to ship these additional features when we release Garage. But we want to ship these additional features when we release Garage.
In the end, we chose to exclude all features from debug builds while putting (all of) them in the release builds. In the end, we chose to exclude all features from debug builds while putting (all of) them in the release builds.
Currently, the only feature of Garage is kubernetes-discovery from the garage_rpc crate. Currently, the only feature of Garage is kubernetes-discovery from the garage_rpc crate.
[5] We don't want libsodium-sys and zstd-sys to try to use pkgconfig to build against a system library.
However the features to do so get activated for some reason (due to a bug in cargo2nix?),
so disable them manually here.
*/ */
(pkgs.rustBuilder.rustLib.makeOverride { (pkgs.rustBuilder.rustLib.makeOverride {
name = "garage"; name = "garage";
@ -183,6 +187,20 @@ let
name = "k2v-client"; name = "k2v-client";
overrideAttrs = drv: { /* [1] */ setBuildEnv = (buildEnv drv); }; overrideAttrs = drv: { /* [1] */ setBuildEnv = (buildEnv drv); };
}) })
(pkgs.rustBuilder.rustLib.makeOverride {
name = "libsodium-sys";
overrideArgs = old: {
features = [ ]; /* [5] */
};
})
(pkgs.rustBuilder.rustLib.makeOverride {
name = "zstd-sys";
overrideArgs = old: {
features = [ ]; /* [5] */
};
})
]; ];
packageFun = import ../Cargo.nix; packageFun = import ../Cargo.nix;