Merge staging-next into staging

This commit is contained in:
github-actions[bot] 2021-09-04 06:01:40 +00:00 committed by GitHub
commit c82a5087e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 11787 additions and 339 deletions

View file

@ -195,9 +195,9 @@ rec {
};
terraform_1_0 = mkTerraform {
version = "1.0.5";
sha256 = "0nhxrlnwg76iiqs9hj6ls54176df78ys3356nxmd9ip8jx9ix47v";
vendorSha256 = "08fvp6w8xsv42jjgpr73kyah20g3979rf84ysrq5whvfmrbpzm2f";
version = "1.0.6";
sha256 = "1i1f2gmiv49ia6d4yi137s705vrxdc3rqxanjgwzysif11j6iwwc";
vendorSha256 = "00cl42w1mzsi9qd09wydfvp5f2h7lxaay6s2dv0mf47k6h7prf42";
patches = [ ./provider-path-0_15.patch ];
passthru = { inherit plugins; };
};

View file

@ -4,313 +4,347 @@
# This can be useful for deploying packages with NixOps, and to share
# binary dependencies between projects.
{ lib, stdenv, defaultCrateOverrides, fetchCrate, pkgsBuildBuild, rustc, rust
, cargo, jq }:
{ lib
, stdenv
, defaultCrateOverrides
, fetchCrate
, pkgsBuildBuild
, rustc
, rust
, cargo
, jq
, libiconv
}:
let
# Create rustc arguments to link against the given list of dependencies
# and renames.
#
# See docs for crateRenames below.
mkRustcDepArgs = dependencies: crateRenames:
lib.concatMapStringsSep " " (dep:
# Create rustc arguments to link against the given list of dependencies
# and renames.
#
# See docs for crateRenames below.
mkRustcDepArgs = dependencies: crateRenames:
lib.concatMapStringsSep " "
(dep:
let
normalizeName = lib.replaceStrings ["-"] ["_"];
normalizeName = lib.replaceStrings [ "-" ] [ "_" ];
extern = normalizeName dep.libName;
# Find a choice that matches in name and optionally version.
findMatchOrUseExtern = choices:
lib.findFirst (choice:
(!(choice ? version)
|| choice.version == dep.version or ""))
{ rename = extern; }
choices;
name = if lib.hasAttr dep.crateName crateRenames then
let choices = crateRenames.${dep.crateName};
in
normalizeName (
if builtins.isList choices
then (findMatchOrUseExtern choices).rename
else choices
)
else
extern;
in (if lib.any (x: x == "lib" || x == "rlib") dep.crateType then
" --extern ${name}=${dep.lib}/lib/lib${extern}-${dep.metadata}.rlib"
else
" --extern ${name}=${dep.lib}/lib/lib${extern}-${dep.metadata}${stdenv.hostPlatform.extensions.sharedLibrary}")
) dependencies;
lib.findFirst
(choice:
(!(choice ? version)
|| choice.version == dep.version or ""))
{ rename = extern; }
choices;
name =
if lib.hasAttr dep.crateName crateRenames then
let choices = crateRenames.${dep.crateName};
in
normalizeName (
if builtins.isList choices
then (findMatchOrUseExtern choices).rename
else choices
)
else
extern;
in
(if lib.any (x: x == "lib" || x == "rlib") dep.crateType then
" --extern ${name}=${dep.lib}/lib/lib${extern}-${dep.metadata}.rlib"
else
" --extern ${name}=${dep.lib}/lib/lib${extern}-${dep.metadata}${stdenv.hostPlatform.extensions.sharedLibrary}")
)
dependencies;
# Create feature arguments for rustc.
mkRustcFeatureArgs = lib.concatMapStringsSep " " (f: ''--cfg feature=\"${f}\"'');
# Create feature arguments for rustc.
mkRustcFeatureArgs = lib.concatMapStringsSep " " (f: ''--cfg feature=\"${f}\"'');
inherit (import ./log.nix { inherit lib; }) noisily echo_colored;
inherit (import ./log.nix { inherit lib; }) noisily echo_colored;
configureCrate = import ./configure-crate.nix {
inherit lib stdenv rust echo_colored noisily mkRustcDepArgs mkRustcFeatureArgs;
};
configureCrate = import ./configure-crate.nix {
inherit lib stdenv rust echo_colored noisily mkRustcDepArgs mkRustcFeatureArgs;
};
buildCrate = import ./build-crate.nix {
inherit lib stdenv mkRustcDepArgs mkRustcFeatureArgs rust;
};
buildCrate = import ./build-crate.nix {
inherit lib stdenv mkRustcDepArgs mkRustcFeatureArgs rust;
};
installCrate = import ./install-crate.nix { inherit stdenv; };
installCrate = import ./install-crate.nix { inherit stdenv; };
# Allow access to the rust attribute set from inside buildRustCrate, which
# has a parameter that shadows the name.
rustAttrs = rust;
# Allow access to the rust attribute set from inside buildRustCrate, which
# has a parameter that shadows the name.
rustAttrs = rust;
in
/* The overridable pkgs.buildRustCrate function.
*
* Any unrecognized parameters will be passed as to
* the underlying stdenv.mkDerivation.
*/
crate_: lib.makeOverridable (
# The rust compiler to use.
#
# Default: pkgs.rustc
{ rust
# Whether to build a release version (`true`) or a debug
# version (`false`). Debug versions are faster to build
# but might be much slower at runtime.
, release
# Whether to print rustc invocations etc.
#
# Example: false
# Default: true
, verbose
# A list of rust/cargo features to enable while building the crate.
# Example: [ "std" "async" ]
, features
# Additional native build inputs for building this crate.
, nativeBuildInputs
# Additional build inputs for building this crate.
#
# Example: [ pkgs.openssl ]
, buildInputs
# Allows to override the parameters to buildRustCrate
# for any rust dependency in the transitive build tree.
#
# Default: pkgs.defaultCrateOverrides
#
# Example:
#
# pkgs.defaultCrateOverrides // {
# hello = attrs: { buildInputs = [ openssl ]; };
# }
, crateOverrides
# Rust library dependencies, i.e. other libaries that were built
# with buildRustCrate.
, dependencies
# Rust build dependencies, i.e. other libaries that were built
# with buildRustCrate and are used by a build script.
, buildDependencies
# Specify the "extern" name of a library if it differs from the library target.
# See above for an extended explanation.
#
# Default: no renames.
#
# Example:
#
# `crateRenames` supports two formats.
#
# The simple version is an attrset that maps the
# `crateName`s of the dependencies to their alternative
# names.
#
# ```nix
# {
# my_crate_name = "my_alternative_name";
# # ...
# }
# ```
#
# The extended version is also keyed by the `crateName`s but allows
# different names for different crate versions:
#
# ```nix
# {
# my_crate_name = [
# { version = "1.2.3"; rename = "my_alternative_name01"; }
# { version = "3.2.3"; rename = "my_alternative_name03"; }
# ]
# # ...
# }
# ```
#
# This roughly corresponds to the following snippet in Cargo.toml:
#
# ```toml
# [dependencies]
# my_alternative_name01 = { package = "my_crate_name", version = "0.1" }
# my_alternative_name03 = { package = "my_crate_name", version = "0.3" }
# ```
#
# Dependencies which use the lib target name as extern name, do not need
# to be specified in the crateRenames, even if their crate name differs.
#
# Including multiple versions of a crate is very popular during
# ecosystem transitions, e.g. from futures 0.1 to futures 0.3.
, crateRenames
# A list of extra options to pass to rustc.
#
# Example: [ "-Z debuginfo=2" ]
# Default: []
, extraRustcOpts
# Whether to enable building tests.
# Use true to enable.
# Default: false
, buildTests
# Passed to stdenv.mkDerivation.
, preUnpack
# Passed to stdenv.mkDerivation.
, postUnpack
# Passed to stdenv.mkDerivation.
, prePatch
# Passed to stdenv.mkDerivation.
, patches
# Passed to stdenv.mkDerivation.
, postPatch
# Passed to stdenv.mkDerivation.
, preConfigure
# Passed to stdenv.mkDerivation.
, postConfigure
# Passed to stdenv.mkDerivation.
, preBuild
# Passed to stdenv.mkDerivation.
, postBuild
# Passed to stdenv.mkDerivation.
, preInstall
# Passed to stdenv.mkDerivation.
, postInstall
}:
/* The overridable pkgs.buildRustCrate function.
*
* Any unrecognized parameters will be passed as to
* the underlying stdenv.mkDerivation.
*/
crate_: lib.makeOverridable
(
# The rust compiler to use.
#
# Default: pkgs.rustc
{ rust
# Whether to build a release version (`true`) or a debug
# version (`false`). Debug versions are faster to build
# but might be much slower at runtime.
, release
# Whether to print rustc invocations etc.
#
# Example: false
# Default: true
, verbose
# A list of rust/cargo features to enable while building the crate.
# Example: [ "std" "async" ]
, features
# Additional native build inputs for building this crate.
, nativeBuildInputs
# Additional build inputs for building this crate.
#
# Example: [ pkgs.openssl ]
, buildInputs
# Allows to override the parameters to buildRustCrate
# for any rust dependency in the transitive build tree.
#
# Default: pkgs.defaultCrateOverrides
#
# Example:
#
# pkgs.defaultCrateOverrides // {
# hello = attrs: { buildInputs = [ openssl ]; };
# }
, crateOverrides
# Rust library dependencies, i.e. other libaries that were built
# with buildRustCrate.
, dependencies
# Rust build dependencies, i.e. other libaries that were built
# with buildRustCrate and are used by a build script.
, buildDependencies
# Specify the "extern" name of a library if it differs from the library target.
# See above for an extended explanation.
#
# Default: no renames.
#
# Example:
#
# `crateRenames` supports two formats.
#
# The simple version is an attrset that maps the
# `crateName`s of the dependencies to their alternative
# names.
#
# ```nix
# {
# my_crate_name = "my_alternative_name";
# # ...
# }
# ```
#
# The extended version is also keyed by the `crateName`s but allows
# different names for different crate versions:
#
# ```nix
# {
# my_crate_name = [
# { version = "1.2.3"; rename = "my_alternative_name01"; }
# { version = "3.2.3"; rename = "my_alternative_name03"; }
# ]
# # ...
# }
# ```
#
# This roughly corresponds to the following snippet in Cargo.toml:
#
# ```toml
# [dependencies]
# my_alternative_name01 = { package = "my_crate_name", version = "0.1" }
# my_alternative_name03 = { package = "my_crate_name", version = "0.3" }
# ```
#
# Dependencies which use the lib target name as extern name, do not need
# to be specified in the crateRenames, even if their crate name differs.
#
# Including multiple versions of a crate is very popular during
# ecosystem transitions, e.g. from futures 0.1 to futures 0.3.
, crateRenames
# A list of extra options to pass to rustc.
#
# Example: [ "-Z debuginfo=2" ]
# Default: []
, extraRustcOpts
# Whether to enable building tests.
# Use true to enable.
# Default: false
, buildTests
# Passed to stdenv.mkDerivation.
, preUnpack
# Passed to stdenv.mkDerivation.
, postUnpack
# Passed to stdenv.mkDerivation.
, prePatch
# Passed to stdenv.mkDerivation.
, patches
# Passed to stdenv.mkDerivation.
, postPatch
# Passed to stdenv.mkDerivation.
, preConfigure
# Passed to stdenv.mkDerivation.
, postConfigure
# Passed to stdenv.mkDerivation.
, preBuild
# Passed to stdenv.mkDerivation.
, postBuild
# Passed to stdenv.mkDerivation.
, preInstall
# Passed to stdenv.mkDerivation.
, postInstall
}:
let crate = crate_ // (lib.attrByPath [ crate_.crateName ] (attr: {}) crateOverrides crate_);
dependencies_ = dependencies;
buildDependencies_ = buildDependencies;
processedAttrs = [
"src" "nativeBuildInputs" "buildInputs" "crateBin" "crateLib" "libName" "libPath"
"buildDependencies" "dependencies" "features" "crateRenames"
"crateName" "version" "build" "authors" "colors" "edition"
"buildTests"
];
extraDerivationAttrs = builtins.removeAttrs crate processedAttrs;
nativeBuildInputs_ = nativeBuildInputs;
buildInputs_ = buildInputs;
extraRustcOpts_ = extraRustcOpts;
buildTests_ = buildTests;
let
crate = crate_ // (lib.attrByPath [ crate_.crateName ] (attr: { }) crateOverrides crate_);
dependencies_ = dependencies;
buildDependencies_ = buildDependencies;
processedAttrs = [
"src"
"nativeBuildInputs"
"buildInputs"
"crateBin"
"crateLib"
"libName"
"libPath"
"buildDependencies"
"dependencies"
"features"
"crateRenames"
"crateName"
"version"
"build"
"authors"
"colors"
"edition"
"buildTests"
];
extraDerivationAttrs = builtins.removeAttrs crate processedAttrs;
nativeBuildInputs_ = nativeBuildInputs;
buildInputs_ = buildInputs;
extraRustcOpts_ = extraRustcOpts;
buildTests_ = buildTests;
# crate2nix has a hack for the old bash based build script that did split
# entries at `,`. No we have to work around that hack.
# https://github.com/kolloch/crate2nix/blame/5b19c1b14e1b0e5522c3e44e300d0b332dc939e7/crate2nix/templates/build.nix.tera#L89
crateBin = lib.filter (bin: !(bin ? name && bin.name == ",")) (crate.crateBin or []);
hasCrateBin = crate ? crateBin;
in
stdenv.mkDerivation (rec {
# crate2nix has a hack for the old bash based build script that did split
# entries at `,`. No we have to work around that hack.
# https://github.com/kolloch/crate2nix/blame/5b19c1b14e1b0e5522c3e44e300d0b332dc939e7/crate2nix/templates/build.nix.tera#L89
crateBin = lib.filter (bin: !(bin ? name && bin.name == ",")) (crate.crateBin or [ ]);
hasCrateBin = crate ? crateBin;
in
stdenv.mkDerivation (rec {
inherit (crate) crateName;
inherit
preUnpack
postUnpack
prePatch
patches
postPatch
preConfigure
postConfigure
preBuild
postBuild
preInstall
postInstall
buildTests
;
inherit (crate) crateName;
inherit
preUnpack
postUnpack
prePatch
patches
postPatch
preConfigure
postConfigure
preBuild
postBuild
preInstall
postInstall
buildTests
;
src = crate.src or (fetchCrate { inherit (crate) crateName version sha256; });
name = "rust_${crate.crateName}-${crate.version}${lib.optionalString buildTests_ "-test"}";
version = crate.version;
depsBuildBuild = [ pkgsBuildBuild.stdenv.cc ];
nativeBuildInputs = [ rust stdenv.cc cargo jq ] ++ (crate.nativeBuildInputs or []) ++ nativeBuildInputs_;
buildInputs = (crate.buildInputs or []) ++ buildInputs_;
dependencies = map lib.getLib dependencies_;
buildDependencies = map lib.getLib buildDependencies_;
src = crate.src or (fetchCrate { inherit (crate) crateName version sha256; });
name = "rust_${crate.crateName}-${crate.version}${lib.optionalString buildTests_ "-test"}";
version = crate.version;
depsBuildBuild = [ pkgsBuildBuild.stdenv.cc ];
nativeBuildInputs = [ rust stdenv.cc cargo jq ] ++ (crate.nativeBuildInputs or [ ]) ++ nativeBuildInputs_;
buildInputs = lib.optionals stdenv.isDarwin [ libiconv ] ++ (crate.buildInputs or [ ]) ++ buildInputs_;
dependencies = map lib.getLib dependencies_;
buildDependencies = map lib.getLib buildDependencies_;
completeDeps = lib.unique (dependencies ++ lib.concatMap (dep: dep.completeDeps) dependencies);
completeBuildDeps = lib.unique (
buildDependencies
++ lib.concatMap (dep: dep.completeBuildDeps ++ dep.completeDeps) buildDependencies
);
completeDeps = lib.unique (dependencies ++ lib.concatMap (dep: dep.completeDeps) dependencies);
completeBuildDeps = lib.unique (
buildDependencies
++ lib.concatMap (dep: dep.completeBuildDeps ++ dep.completeDeps) buildDependencies
);
# Create a list of features that are enabled by the crate itself and
# through the features argument of buildRustCrate. Exclude features
# with a forward slash, since they are passed through to dependencies.
crateFeatures = lib.optionals (crate ? features)
(builtins.filter (f: !lib.hasInfix "/" f) (crate.features ++ features));
# Create a list of features that are enabled by the crate itself and
# through the features argument of buildRustCrate. Exclude features
# with a forward slash, since they are passed through to dependencies.
crateFeatures = lib.optionals (crate ? features)
(builtins.filter (f: !lib.hasInfix "/" f) (crate.features ++ features));
libName = if crate ? libName then crate.libName else crate.crateName;
libPath = if crate ? libPath then crate.libPath else "";
libName = if crate ? libName then crate.libName else crate.crateName;
libPath = if crate ? libPath then crate.libPath else "";
# Seed the symbol hashes with something unique every time.
# https://doc.rust-lang.org/1.0.0/rustc/metadata/loader/index.html#frobbing-symbols
metadata = let
depsMetadata = lib.foldl' (str: dep: str + dep.metadata) "" (dependencies ++ buildDependencies);
hashedMetadata = builtins.hashString "sha256"
(crateName + "-" + crateVersion + "___" + toString (mkRustcFeatureArgs crateFeatures) +
"___" + depsMetadata + "___" + rustAttrs.toRustTarget stdenv.hostPlatform);
in lib.substring 0 10 hashedMetadata;
# Seed the symbol hashes with something unique every time.
# https://doc.rust-lang.org/1.0.0/rustc/metadata/loader/index.html#frobbing-symbols
metadata =
let
depsMetadata = lib.foldl' (str: dep: str + dep.metadata) "" (dependencies ++ buildDependencies);
hashedMetadata = builtins.hashString "sha256"
(crateName + "-" + crateVersion + "___" + toString (mkRustcFeatureArgs crateFeatures) +
"___" + depsMetadata + "___" + rustAttrs.toRustTarget stdenv.hostPlatform);
in
lib.substring 0 10 hashedMetadata;
build = crate.build or "";
# Either set to a concrete sub path to the crate root
# or use `null` for auto-detect.
workspace_member = crate.workspace_member or ".";
crateVersion = crate.version;
crateDescription = crate.description or "";
crateAuthors = if crate ? authors && lib.isList crate.authors then crate.authors else [];
crateHomepage = crate.homepage or "";
crateType =
if lib.attrByPath ["procMacro"] false crate then ["proc-macro"] else
if lib.attrByPath ["plugin"] false crate then ["dylib"] else
(crate.type or ["lib"]);
colors = lib.attrByPath [ "colors" ] "always" crate;
extraLinkFlags = lib.concatStringsSep " " (crate.extraLinkFlags or []);
edition = crate.edition or null;
extraRustcOpts =
lib.optionals (crate ? extraRustcOpts) crate.extraRustcOpts
++ extraRustcOpts_
++ (lib.optional (edition != null) "--edition ${edition}");
build = crate.build or "";
# Either set to a concrete sub path to the crate root
# or use `null` for auto-detect.
workspace_member = crate.workspace_member or ".";
crateVersion = crate.version;
crateDescription = crate.description or "";
crateAuthors = if crate ? authors && lib.isList crate.authors then crate.authors else [ ];
crateHomepage = crate.homepage or "";
crateType =
if lib.attrByPath [ "procMacro" ] false crate then [ "proc-macro" ] else
if lib.attrByPath [ "plugin" ] false crate then [ "dylib" ] else
(crate.type or [ "lib" ]);
colors = lib.attrByPath [ "colors" ] "always" crate;
extraLinkFlags = lib.concatStringsSep " " (crate.extraLinkFlags or [ ]);
edition = crate.edition or null;
extraRustcOpts =
lib.optionals (crate ? extraRustcOpts) crate.extraRustcOpts
++ extraRustcOpts_
++ (lib.optional (edition != null) "--edition ${edition}");
configurePhase = configureCrate {
inherit crateName buildDependencies completeDeps completeBuildDeps crateDescription
crateFeatures crateRenames libName build workspace_member release libPath crateVersion
extraLinkFlags extraRustcOpts
crateAuthors crateHomepage verbose colors;
};
buildPhase = buildCrate {
inherit crateName dependencies
crateFeatures crateRenames libName release libPath crateType
metadata hasCrateBin crateBin verbose colors
extraRustcOpts buildTests;
};
installPhase = installCrate crateName metadata buildTests;
configurePhase = configureCrate {
inherit crateName buildDependencies completeDeps completeBuildDeps crateDescription
crateFeatures crateRenames libName build workspace_member release libPath crateVersion
extraLinkFlags extraRustcOpts
crateAuthors crateHomepage verbose colors;
};
buildPhase = buildCrate {
inherit crateName dependencies
crateFeatures crateRenames libName release libPath crateType
metadata hasCrateBin crateBin verbose colors
extraRustcOpts buildTests;
};
installPhase = installCrate crateName metadata buildTests;
# depending on the test setting we are either producing something with bins
# and libs or just test binaries
outputs = if buildTests then [ "out" ] else [ "out" "lib" ];
outputDev = if buildTests then [ "out" ] else [ "lib" ];
# depending on the test setting we are either producing something with bins
# and libs or just test binaries
outputs = if buildTests then [ "out" ] else [ "out" "lib" ];
outputDev = if buildTests then [ "out" ] else [ "lib" ];
} // extraDerivationAttrs
)) {
} // extraDerivationAttrs
)
)
{
rust = rustc;
release = crate_.release or true;
verbose = crate_.verbose or true;
extraRustcOpts = [];
features = [];
nativeBuildInputs = [];
buildInputs = [];
extraRustcOpts = [ ];
features = [ ];
nativeBuildInputs = [ ];
buildInputs = [ ];
crateOverrides = defaultCrateOverrides;
preUnpack = crate_.preUnpack or "";
postUnpack = crate_.postUnpack or "";
prePatch = crate_.prePatch or "";
patches = crate_.patches or [];
patches = crate_.patches or [ ];
postPatch = crate_.postPatch or "";
preConfigure = crate_.preConfigure or "";
postConfigure = crate_.postConfigure or "";
@ -318,8 +352,8 @@ stdenv.mkDerivation (rec {
postBuild = crate_.postBuild or "";
preInstall = crate_.preInstall or "";
postInstall = crate_.postInstall or "";
dependencies = crate_.dependencies or [];
buildDependencies = crate_.buildDependencies or [];
crateRenames = crate_.crateRenames or {};
dependencies = crate_.dependencies or [ ];
buildDependencies = crate_.buildDependencies or [ ];
crateRenames = crate_.crateRenames or { };
buildTests = crate_.buildTests or false;
}

View file

@ -1,7 +1,29 @@
{ lib, stdenv, pkg-config, curl, darwin, libiconv, libgit2, libssh2,
openssl, sqlite, zlib, dbus, dbus-glib, gdk-pixbuf, cairo, python3,
libsodium, postgresql, gmp, foundationdb, capnproto, nettle, clang,
llvmPackages, linux-pam, ... }:
{ lib
, stdenv
, pkg-config
, curl
, darwin
, libgit2
, libssh2
, openssl
, sqlite
, zlib
, dbus
, dbus-glib
, gdk-pixbuf
, cairo
, python3
, libsodium
, postgresql
, gmp
, foundationdb
, capnproto
, nettle
, clang
, llvmPackages
, linux-pam
, ...
}:
let
inherit (darwin.apple_sdk.frameworks) CoreFoundation Security;
@ -17,20 +39,20 @@ in
cargo = attrs: {
buildInputs = [ openssl zlib curl ]
++ lib.optionals stdenv.isDarwin [ CoreFoundation Security libiconv ];
++ lib.optionals stdenv.isDarwin [ CoreFoundation Security ];
};
libz-sys = attrs: {
nativeBuildInputs = [ pkg-config ];
buildInputs = [ zlib ];
extraLinkFlags = ["-L${zlib.out}/lib"];
extraLinkFlags = [ "-L${zlib.out}/lib" ];
};
curl-sys = attrs: {
nativeBuildInputs = [ pkg-config ];
buildInputs = [ zlib curl ];
propagatedBuildInputs = [ curl zlib ];
extraLinkFlags = ["-L${zlib.out}/lib"];
extraLinkFlags = [ "-L${zlib.out}/lib" ];
};
dbus = attrs: {
@ -115,7 +137,7 @@ in
rink = attrs: {
buildInputs = [ gmp ];
crateBin = [ { name = "rink"; path = "src/bin/rink.rs"; } ];
crateBin = [{ name = "rink"; path = "src/bin/rink.rs"; }];
};
security-framework-sys = attr: {

View file

@ -64,10 +64,10 @@ stdenv.mkDerivation rec {
# fix build with gcc9, can be removed after bumping to current version
NIX_CFLAGS_COMPILE = [ "-Wno-error" ];
preConfigure = ''
rm aws-cpp-sdk-core-tests/aws/auth/AWSCredentialsProviderTest.cpp
rm aws-cpp-sdk-core-tests/aws/client/AWSClientTest.cpp
'';
# aws-cpp-sdk-core-tests/aws/auth/AWSCredentialsProviderTest.cpp
# aws-cpp-sdk-core-tests/aws/client/AWSClientTest.cpp
# seem to have a datarace
enableParallelChecking = false;
postFixupHooks = [
# This bodge is necessary so that the file that the generated -config.cmake file

View file

@ -2,16 +2,16 @@
buildGoModule rec {
pname = "pack";
version = "0.18.0";
version = "0.20.0";
src = fetchFromGitHub {
owner = "buildpacks";
repo = pname;
rev = "v${version}";
sha256 = "sha256-+fYw5dIDJJKGQKBL6RQh1SCQufbAkKeuJpPlywzbbnM=";
sha256 = "sha256-G1tnk0SlQVX4bEifmuZahazNv3bbdgmcr1V0dN9dlKc=";
};
vendorSha256 = "sha256-fSUTl5W/DyloCuCpEqA5z4bhB7wYxzPt6E0SfjorfQ0=";
vendorSha256 = "sha256-jeOK4k1W/5LvqB52LriKD5jNvZa/nc2ypRowrem2y30=";
nativeBuildInputs = [ installShellFiles ];

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,13 @@
{
"actix-cors 0.6.0-beta.1 (git+https://github.com/MarinPostma/actix-extras.git?rev=2dac1a4#2dac1a421619bf7b386dea63d3ae25a3bc4abc43)": "0ny03ibf8vvdvcmcvzlvngx80rvmh47bx517iqc5wh74yzdmdlsn",
"actix-web-static-files 3.0.5 (git+https://github.com/MarinPostma/actix-web-static-files.git?rev=6db8c3e#6db8c3e2940d61659581492b5e9c9b9062567613)": "1q00s1w2ry6kl7j4bn4q1xqpdn90sc3icjm2wml8fn4rszamhnqy",
"assert-json-diff 1.0.1 (git+https://github.com/qdequele/assert-json-diff?branch=master#9012a0c8866d0f2db0ef9a6242e4a19d1e8c67e4)": "1inv5y75acrw0vhpsc32rh5h0701vnm7c4lcsqcdzd8sdy76cisl",
"grenad 0.1.0 (git+https://github.com/Kerollmops/grenad.git?rev=3adcb26#3adcb267dcbc590c7da10eb5f887a254865b3dbe)": "03zzi59yk2rgasdzsf7rgz26vpk5060vlfskls9cb556wiizh6cl",
"heed 0.12.0 (git+https://github.com/Kerollmops/heed?tag=v0.12.1#8e5dc6d71c8166a8d7d0db059e6e51478942b551)": "09h9i693jiy3ybvc5acj8giszsv3kchpaxs4ld2ha81zxcmmfkrw",
"heed-traits 0.7.0 (git+https://github.com/Kerollmops/heed?tag=v0.12.1#8e5dc6d71c8166a8d7d0db059e6e51478942b551)": "09h9i693jiy3ybvc5acj8giszsv3kchpaxs4ld2ha81zxcmmfkrw",
"heed-types 0.7.2 (git+https://github.com/Kerollmops/heed?tag=v0.12.1#8e5dc6d71c8166a8d7d0db059e6e51478942b551)": "09h9i693jiy3ybvc5acj8giszsv3kchpaxs4ld2ha81zxcmmfkrw",
"lmdb-rkv-sys 0.15.0 (git+https://github.com/meilisearch/lmdb-rs#d0b50d02938ee84e4e4372697ea991fe2a4cae3b)": "0pqar429y4qzxmyr6daw32syvggm4dk7cs7g01lp6f8a6cvbbwkc",
"meilisearch-tokenizer 0.2.5 (git+https://github.com/meilisearch/tokenizer.git?tag=v0.2.5#c0b5cf741ed9485147f2cbe523f2214d4fa4c395)": "0hvf92z24adqwhh81r9arirhrvgyp1wva9g2wsrir4xqvaqdzdr5",
"milli 0.10.2 (git+https://github.com/meilisearch/milli.git?tag=v0.10.2#879d5e8799836d93f8995810965b6797be4f69d1)": "09gdf4mwrn3ka1iqh3h33b86p68c8ichkkkd4231igl11wxj91d1",
"pest 2.1.3 (git+https://github.com/pest-parser/pest.git?rev=51fd1d49f1041f7839975664ef71fe15c7dcaf67#51fd1d49f1041f7839975664ef71fe15c7dcaf67)": "1l2ixz723f58ksdm0j12z9zw5cnap0fhcd5kbhbz5ndazy8sn5rf"
}

View file

@ -1,29 +1,48 @@
{ lib, stdenv
, rustPlatform
{ lib
, stdenv
, buildRustCrate
, defaultCrateOverrides
, fetchFromGitHub
, IOKit
, Security
, features ? [ ]
}:
rustPlatform.buildRustPackage rec {
pname = "meilisearch";
version = "0.9.0";
let
version = "0.21.1";
src = fetchFromGitHub {
owner = "meilisearch";
repo = "MeiliSearch";
rev = "v${version}";
sha256 = "00i5vsbcyrbsvhr5n1b3pxa87v0kfw6pg931i2kzyf4wh021k6sw";
sha256 = "sha256-wyyhTNhVw8EJhahstLK+QuEhufQC68rMpw/ngK8FL8Y=";
};
cargoSha256 = "1icxpragn69c95i5gyx0b07gw4h82r8fsv0nvns0v8dxqisz877k";
buildInputs = lib.optionals stdenv.isDarwin [ IOKit Security ];
meta = with lib; {
description = "Ultra relevant and instant full-text search API";
homepage = "https://meilisearch.com/";
license = licenses.mit;
maintainers = with maintainers; [ Br1ght0ne ];
customBuildRustCrateForPkgs = pkgs: buildRustCrate.override {
defaultCrateOverrides = defaultCrateOverrides // {
meilisearch-http = attrs: {
src = "${src}/meilisearch-http";
buildInputs = lib.optionals stdenv.isDarwin [ Security ];
};
meilisearch-error = attrs: {
src = "${src}/meilisearch-error";
};
};
};
cargo_nix = import ./Cargo.nix {
nixpkgs = ../../../..;
buildRustCrateForPkgs = customBuildRustCrateForPkgs;
};
meilisearch-http = cargo_nix.workspaceMembers."meilisearch-http".build.override {
inherit features;
};
in
stdenv.mkDerivation {
pname = "meilisearch";
inherit version src;
dontUnpack = true;
dontBuild = true;
installPhase = ''
mkdir -p $out/bin
cp ${meilisearch-http}/bin/meilisearch $out/bin/meilisearch
'';
dontCheck = true;
dontFixup = true;
}

View file

@ -0,0 +1,74 @@
diff --git a/Cargo.lock b/Cargo.lock
index e92c0ed0..63bb0996 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1700,7 +1700,7 @@ dependencies = [
"obkv",
"once_cell",
"ordered-float",
- "pest 2.1.3 (git+https://github.com/pest-parser/pest.git?rev=51fd1d49f1041f7839975664ef71fe15c7dcaf67)",
+ "pest",
"pest_derive",
"rayon",
"roaring",
@@ -1939,15 +1939,6 @@ version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
-[[package]]
-name = "pest"
-version = "2.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53"
-dependencies = [
- "ucd-trie",
-]
-
[[package]]
name = "pest"
version = "2.1.3"
@@ -1962,7 +1953,7 @@ version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "833d1ae558dc601e9a60366421196a8d94bc0ac980476d0b67e1d0988d72b2d0"
dependencies = [
- "pest 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pest",
"pest_generator",
]
@@ -1972,7 +1963,7 @@ version = "2.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55"
dependencies = [
- "pest 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pest",
"pest_meta",
"proc-macro2 1.0.27",
"quote 1.0.9",
@@ -1986,7 +1977,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "54be6e404f5317079812fc8f9f5279de376d8856929e21c184ecf6bbd692a11d"
dependencies = [
"maplit",
- "pest 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pest",
"sha-1 0.8.2",
]
diff --git a/Cargo.toml b/Cargo.toml
index a1dca038..405f210a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,8 +1,9 @@
[workspace]
-members = [
- "meilisearch-http",
- "meilisearch-error",
-]
+members = ["meilisearch-http", "meilisearch-error"]
+resolver = "2"
[profile.release]
debug = true
+
+[patch.crates-io]
+pest = { git = "https://github.com/pest-parser/pest.git", rev = "51fd1d49f1041f7839975664ef71fe15c7dcaf67" }

View file

@ -2,16 +2,16 @@
rustPlatform.buildRustPackage rec {
pname = "shadowenv";
version = "2.0.4";
version = "2.0.5";
src = fetchFromGitHub {
owner = "Shopify";
repo = pname;
rev = version;
sha256 = "sha256-BXCIb91EOpu/GUVvmFZbycuWYAS1n5Sxg5OiYx5rlPA=";
sha256 = "sha256-MPky0ZB7yfl/gOPThx1BpRoTgvY7mkLaoqnvGKPvSPo=";
};
cargoSha256 = "sha256-Hn+128ZQljTroebDQBBNynSq7WTZLpB5sdA2Gz54pOU=";
cargoSha256 = "sha256-reVw8YkKi+EMDk0Bva2Ugp72VhAYB6axHonkr9Kdos4=";
nativeBuildInputs = [ installShellFiles ];

View file

@ -0,0 +1,48 @@
{ lib
, stdenv
, fetchFromGitHub
, perlPackages
}:
stdenv.mkDerivation rec {
pname = "triehash";
version = "0.3";
src = fetchFromGitHub {
owner = "julian-klode";
repo = pname;
rev = "debian/0.3-3";
hash = "sha256-LxVcYj2WKHbhNu5x/DFkxQPOYrVkNvwiE/qcODq52Lc=";
};
nativeBuildInputs = [
perlPackages.perl
];
postPatch = ''
patchShebangs triehash.pl
'';
dontConfigure = true;
dontBuild = true;
installPhase = ''
runHook preInstall
install -d $out/bin $out/share/doc/${pname}/ $out/share/${pname}/
install triehash.pl $out/bin/triehash
install README.md $out/share/doc/${pname}/
cp -r tests/ $out/share/${pname}/tests/
runHook postInstall
'';
meta = with lib; {
homepage = "https://github.com/julian-klode/triehash";
description = "Order-preserving minimal perfect hash function generator";
license = with licenses; mit;
maintainers = with maintainers; [ AndersonTorres ];
platforms = perlPackages.perl.meta.platforms;
};
}

View file

@ -1,50 +1,84 @@
{ stdenv, lib, fetchurl, pkg-config, cmake, perlPackages, curl, gtest
, gnutls, libtasn1, xz, bzip2, lz4, zstd, libseccomp, udev
, db, dpkg, libxslt, docbook_xsl, docbook_xml_dtd_45
# used when WITH_DOC=ON
, w3m
, doxygen
# used when WITH_NLS=ON
, gettext
# opts
, withDocs ? true
, withNLS ? true
{ lib
, stdenv
, fetchurl
, bzip2
, cmake
, curl
, db
, docbook_xml_dtd_45
, docbook_xsl
, dpkg
, gnutls
, gtest
, libgcrypt
, libseccomp
, libtasn1
, libxslt
, lz4
, perlPackages
, pkg-config
, triehash
, udev
, xxHash
, xz
, zstd
, withDocs ? true , w3m, doxygen
, withNLS ? true , gettext
}:
stdenv.mkDerivation rec {
pname = "apt";
version = "1.8.4";
version = "2.3.8";
src = fetchurl {
url = "mirror://debian/pool/main/a/apt/apt_${version}.tar.xz";
sha256 = "0gn4srqaaym85gc8nldqkv01477kdwr136an2nlpbdrsbx3y83zl";
hash = "sha256-SFrxQwx14xWLcV5EJNv5bRtWQdxNzMUPVxssd5qDfyw=";
};
nativeBuildInputs = [ pkg-config cmake gtest libxslt.bin ];
nativeBuildInputs = [
cmake
gtest
libxslt.bin
pkg-config
triehash
];
buildInputs = [
perlPackages.perl curl gnutls libtasn1 xz bzip2 lz4 zstd libseccomp udev db dpkg
bzip2
curl
db
dpkg
gnutls
libgcrypt
libseccomp
libtasn1
lz4
perlPackages.perl
udev
xxHash
xz
zstd
] ++ lib.optionals withDocs [
doxygen perlPackages.Po4a w3m docbook_xml_dtd_45
docbook_xml_dtd_45
doxygen
perlPackages.Po4a
w3m
] ++ lib.optionals withNLS [
gettext
];
cmakeFlags = [
"-DBERKELEY_DB_INCLUDE_DIRS=${db.dev}/include"
"-DGNUTLS_INCLUDE_DIR=${gnutls.dev}/include"
"-DBERKELEY_INCLUDE_DIRS=${db.dev}/include"
"-DDOCBOOK_XSL=${docbook_xsl}/share/xml/docbook-xsl"
"-DGNUTLS_INCLUDE_DIR=${gnutls.dev}/include"
"-DROOT_GROUP=root"
"-DWITH_DOC=${if withDocs then "ON" else "OFF"}"
"-DUSE_NLS=${if withNLS then "ON" else "OFF"}"
"-DWITH_DOC=${if withDocs then "ON" else "OFF"}"
];
meta = with lib; {
description = "Command-line package management tools used on Debian-based systems";
homepage = "https://salsa.debian.org/apt-team/apt";
description = "Command-line package management tools used on Debian-based systems";
license = licenses.gpl2Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ cstrahan ];

View file

@ -6632,7 +6632,7 @@ with pkgs;
};
meilisearch = callPackage ../servers/search/meilisearch {
inherit (darwin.apple_sdk.frameworks) IOKit Security;
inherit (darwin.apple_sdk.frameworks) Security;
};
memtester = callPackage ../tools/system/memtester { };
@ -19040,6 +19040,8 @@ with pkgs;
tremor = callPackage ../development/libraries/tremor { };
triehash = callPackage ../tools/misc/triehash { };
trillian = callPackage ../tools/misc/trillian {
buildGoModule = buildGo115Module;
};
@ -30996,6 +30998,8 @@ with pkgs;
emu2 = callPackage ../misc/emulators/emu2 { };
apt = callPackage ../tools/package-management/apt { };
dpkg = callPackage ../tools/package-management/dpkg { };
dumb = callPackage ../misc/dumb { };