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 { terraform_1_0 = mkTerraform {
version = "1.0.5"; version = "1.0.6";
sha256 = "0nhxrlnwg76iiqs9hj6ls54176df78ys3356nxmd9ip8jx9ix47v"; sha256 = "1i1f2gmiv49ia6d4yi137s705vrxdc3rqxanjgwzysif11j6iwwc";
vendorSha256 = "08fvp6w8xsv42jjgpr73kyah20g3979rf84ysrq5whvfmrbpzm2f"; vendorSha256 = "00cl42w1mzsi9qd09wydfvp5f2h7lxaay6s2dv0mf47k6h7prf42";
patches = [ ./provider-path-0_15.patch ]; patches = [ ./provider-path-0_15.patch ];
passthru = { inherit plugins; }; passthru = { inherit plugins; };
}; };

View file

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

View file

@ -1,7 +1,29 @@
{ lib, stdenv, pkg-config, curl, darwin, libiconv, libgit2, libssh2, { lib
openssl, sqlite, zlib, dbus, dbus-glib, gdk-pixbuf, cairo, python3, , stdenv
libsodium, postgresql, gmp, foundationdb, capnproto, nettle, clang, , pkg-config
llvmPackages, linux-pam, ... }: , 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 let
inherit (darwin.apple_sdk.frameworks) CoreFoundation Security; inherit (darwin.apple_sdk.frameworks) CoreFoundation Security;
@ -17,20 +39,20 @@ in
cargo = attrs: { cargo = attrs: {
buildInputs = [ openssl zlib curl ] buildInputs = [ openssl zlib curl ]
++ lib.optionals stdenv.isDarwin [ CoreFoundation Security libiconv ]; ++ lib.optionals stdenv.isDarwin [ CoreFoundation Security ];
}; };
libz-sys = attrs: { libz-sys = attrs: {
nativeBuildInputs = [ pkg-config ]; nativeBuildInputs = [ pkg-config ];
buildInputs = [ zlib ]; buildInputs = [ zlib ];
extraLinkFlags = ["-L${zlib.out}/lib"]; extraLinkFlags = [ "-L${zlib.out}/lib" ];
}; };
curl-sys = attrs: { curl-sys = attrs: {
nativeBuildInputs = [ pkg-config ]; nativeBuildInputs = [ pkg-config ];
buildInputs = [ zlib curl ]; buildInputs = [ zlib curl ];
propagatedBuildInputs = [ curl zlib ]; propagatedBuildInputs = [ curl zlib ];
extraLinkFlags = ["-L${zlib.out}/lib"]; extraLinkFlags = [ "-L${zlib.out}/lib" ];
}; };
dbus = attrs: { dbus = attrs: {
@ -115,7 +137,7 @@ in
rink = attrs: { rink = attrs: {
buildInputs = [ gmp ]; buildInputs = [ gmp ];
crateBin = [ { name = "rink"; path = "src/bin/rink.rs"; } ]; crateBin = [{ name = "rink"; path = "src/bin/rink.rs"; }];
}; };
security-framework-sys = attr: { 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 # fix build with gcc9, can be removed after bumping to current version
NIX_CFLAGS_COMPILE = [ "-Wno-error" ]; NIX_CFLAGS_COMPILE = [ "-Wno-error" ];
preConfigure = '' # aws-cpp-sdk-core-tests/aws/auth/AWSCredentialsProviderTest.cpp
rm aws-cpp-sdk-core-tests/aws/auth/AWSCredentialsProviderTest.cpp # aws-cpp-sdk-core-tests/aws/client/AWSClientTest.cpp
rm aws-cpp-sdk-core-tests/aws/client/AWSClientTest.cpp # seem to have a datarace
''; enableParallelChecking = false;
postFixupHooks = [ postFixupHooks = [
# This bodge is necessary so that the file that the generated -config.cmake file # This bodge is necessary so that the file that the generated -config.cmake file

View file

@ -2,16 +2,16 @@
buildGoModule rec { buildGoModule rec {
pname = "pack"; pname = "pack";
version = "0.18.0"; version = "0.20.0";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "buildpacks"; owner = "buildpacks";
repo = pname; repo = pname;
rev = "v${version}"; rev = "v${version}";
sha256 = "sha256-+fYw5dIDJJKGQKBL6RQh1SCQufbAkKeuJpPlywzbbnM="; sha256 = "sha256-G1tnk0SlQVX4bEifmuZahazNv3bbdgmcr1V0dN9dlKc=";
}; };
vendorSha256 = "sha256-fSUTl5W/DyloCuCpEqA5z4bhB7wYxzPt6E0SfjorfQ0="; vendorSha256 = "sha256-jeOK4k1W/5LvqB52LriKD5jNvZa/nc2ypRowrem2y30=";
nativeBuildInputs = [ installShellFiles ]; 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 { lib
, rustPlatform , stdenv
, buildRustCrate
, defaultCrateOverrides
, fetchFromGitHub , fetchFromGitHub
, IOKit
, Security , Security
, features ? [ ]
}: }:
rustPlatform.buildRustPackage rec { let
pname = "meilisearch"; version = "0.21.1";
version = "0.9.0";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "meilisearch"; owner = "meilisearch";
repo = "MeiliSearch"; repo = "MeiliSearch";
rev = "v${version}"; rev = "v${version}";
sha256 = "00i5vsbcyrbsvhr5n1b3pxa87v0kfw6pg931i2kzyf4wh021k6sw"; sha256 = "sha256-wyyhTNhVw8EJhahstLK+QuEhufQC68rMpw/ngK8FL8Y=";
}; };
customBuildRustCrateForPkgs = pkgs: buildRustCrate.override {
cargoSha256 = "1icxpragn69c95i5gyx0b07gw4h82r8fsv0nvns0v8dxqisz877k"; defaultCrateOverrides = defaultCrateOverrides // {
meilisearch-http = attrs: {
buildInputs = lib.optionals stdenv.isDarwin [ IOKit Security ]; src = "${src}/meilisearch-http";
buildInputs = lib.optionals stdenv.isDarwin [ Security ];
meta = with lib; { };
description = "Ultra relevant and instant full-text search API"; meilisearch-error = attrs: {
homepage = "https://meilisearch.com/"; src = "${src}/meilisearch-error";
license = licenses.mit; };
maintainers = with maintainers; [ Br1ght0ne ]; };
}; };
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 { rustPlatform.buildRustPackage rec {
pname = "shadowenv"; pname = "shadowenv";
version = "2.0.4"; version = "2.0.5";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "Shopify"; owner = "Shopify";
repo = pname; repo = pname;
rev = version; rev = version;
sha256 = "sha256-BXCIb91EOpu/GUVvmFZbycuWYAS1n5Sxg5OiYx5rlPA="; sha256 = "sha256-MPky0ZB7yfl/gOPThx1BpRoTgvY7mkLaoqnvGKPvSPo=";
}; };
cargoSha256 = "sha256-Hn+128ZQljTroebDQBBNynSq7WTZLpB5sdA2Gz54pOU="; cargoSha256 = "sha256-reVw8YkKi+EMDk0Bva2Ugp72VhAYB6axHonkr9Kdos4=";
nativeBuildInputs = [ installShellFiles ]; 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 { lib
, gnutls, libtasn1, xz, bzip2, lz4, zstd, libseccomp, udev , stdenv
, db, dpkg, libxslt, docbook_xsl, docbook_xml_dtd_45 , fetchurl
, bzip2
# used when WITH_DOC=ON , cmake
, w3m , curl
, doxygen , db
, docbook_xml_dtd_45
# used when WITH_NLS=ON , docbook_xsl
, gettext , dpkg
, gnutls
# opts , gtest
, withDocs ? true , libgcrypt
, withNLS ? true , libseccomp
, libtasn1
, libxslt
, lz4
, perlPackages
, pkg-config
, triehash
, udev
, xxHash
, xz
, zstd
, withDocs ? true , w3m, doxygen
, withNLS ? true , gettext
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "apt"; pname = "apt";
version = "1.8.4"; version = "2.3.8";
src = fetchurl { src = fetchurl {
url = "mirror://debian/pool/main/a/apt/apt_${version}.tar.xz"; 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 = [ 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 [ ] ++ lib.optionals withDocs [
doxygen perlPackages.Po4a w3m docbook_xml_dtd_45 docbook_xml_dtd_45
doxygen
perlPackages.Po4a
w3m
] ++ lib.optionals withNLS [ ] ++ lib.optionals withNLS [
gettext gettext
]; ];
cmakeFlags = [ cmakeFlags = [
"-DBERKELEY_DB_INCLUDE_DIRS=${db.dev}/include" "-DBERKELEY_INCLUDE_DIRS=${db.dev}/include"
"-DGNUTLS_INCLUDE_DIR=${gnutls.dev}/include"
"-DDOCBOOK_XSL=${docbook_xsl}/share/xml/docbook-xsl" "-DDOCBOOK_XSL=${docbook_xsl}/share/xml/docbook-xsl"
"-DGNUTLS_INCLUDE_DIR=${gnutls.dev}/include"
"-DROOT_GROUP=root" "-DROOT_GROUP=root"
"-DWITH_DOC=${if withDocs then "ON" else "OFF"}"
"-DUSE_NLS=${if withNLS then "ON" else "OFF"}" "-DUSE_NLS=${if withNLS then "ON" else "OFF"}"
"-DWITH_DOC=${if withDocs then "ON" else "OFF"}"
]; ];
meta = with lib; { meta = with lib; {
description = "Command-line package management tools used on Debian-based systems";
homepage = "https://salsa.debian.org/apt-team/apt"; homepage = "https://salsa.debian.org/apt-team/apt";
description = "Command-line package management tools used on Debian-based systems";
license = licenses.gpl2Plus; license = licenses.gpl2Plus;
platforms = platforms.linux; platforms = platforms.linux;
maintainers = with maintainers; [ cstrahan ]; maintainers = with maintainers; [ cstrahan ];

View file

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