2021-09-13 06:40:45 +01:00
|
|
|
{ pkgs
|
|
|
|
, lib
|
2021-09-02 06:34:47 +01:00
|
|
|
, stdenv
|
|
|
|
, buildRustCrate
|
|
|
|
, defaultCrateOverrides
|
2020-04-07 09:13:52 +01:00
|
|
|
, fetchFromGitHub
|
|
|
|
, Security
|
2021-09-02 06:34:47 +01:00
|
|
|
, features ? [ ]
|
2020-04-07 09:13:52 +01:00
|
|
|
}:
|
|
|
|
|
2021-09-02 06:34:47 +01:00
|
|
|
let
|
2021-09-03 04:39:22 +01:00
|
|
|
version = "0.21.1";
|
2020-04-07 09:13:52 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "meilisearch";
|
|
|
|
repo = "MeiliSearch";
|
2021-09-03 04:39:22 +01:00
|
|
|
rev = "v${version}";
|
2021-09-02 06:34:47 +01:00
|
|
|
sha256 = "sha256-wyyhTNhVw8EJhahstLK+QuEhufQC68rMpw/ngK8FL8Y=";
|
2020-04-07 09:13:52 +01:00
|
|
|
};
|
2021-09-03 04:39:22 +01:00
|
|
|
customBuildRustCrateForPkgs = pkgs: buildRustCrate.override {
|
2021-09-02 06:34:47 +01:00
|
|
|
defaultCrateOverrides = defaultCrateOverrides // {
|
|
|
|
meilisearch-http = attrs: {
|
|
|
|
src = "${src}/meilisearch-http";
|
2021-09-03 04:39:22 +01:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ Security ];
|
2021-09-02 06:34:47 +01:00
|
|
|
};
|
|
|
|
meilisearch-error = attrs: {
|
|
|
|
src = "${src}/meilisearch-error";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
cargo_nix = import ./Cargo.nix {
|
2021-09-13 06:40:45 +01:00
|
|
|
inherit pkgs;
|
2021-09-03 04:39:22 +01:00
|
|
|
buildRustCrateForPkgs = customBuildRustCrateForPkgs;
|
|
|
|
};
|
|
|
|
meilisearch-http = cargo_nix.workspaceMembers."meilisearch-http".build.override {
|
|
|
|
inherit features;
|
2020-04-07 09:13:52 +01:00
|
|
|
};
|
2021-09-02 06:34:47 +01:00
|
|
|
in
|
2021-09-03 04:39:22 +01:00
|
|
|
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;
|
2020-04-07 09:13:52 +01:00
|
|
|
}
|