mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-21 21:23:06 +00:00
49 lines
1.2 KiB
Nix
49 lines
1.2 KiB
Nix
{ lib
|
|
, stdenv
|
|
, buildRustCrate
|
|
, defaultCrateOverrides
|
|
, fetchFromGitHub
|
|
, Security
|
|
, features ? [ ]
|
|
}:
|
|
|
|
let
|
|
version = "0.21.1";
|
|
src = fetchFromGitHub {
|
|
owner = "meilisearch";
|
|
repo = "MeiliSearch";
|
|
rev = "v${version}";
|
|
sha256 = "sha256-wyyhTNhVw8EJhahstLK+QuEhufQC68rMpw/ngK8FL8Y=";
|
|
};
|
|
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;
|
|
}
|