2023-10-16 21:48:57 +02:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitea
|
|
|
|
, fetchpatch
|
|
|
|
, openssl
|
|
|
|
, pkg-config
|
|
|
|
, protobuf
|
|
|
|
, cacert
|
|
|
|
, Security
|
|
|
|
, garage
|
|
|
|
, nixosTests
|
|
|
|
}:
|
2022-10-15 22:40:34 +02:00
|
|
|
let
|
2022-12-30 15:10:26 +01:00
|
|
|
generic = { version, sha256, cargoSha256, eol ? false, broken ? false }: rustPlatform.buildRustPackage {
|
2022-10-15 22:40:34 +02:00
|
|
|
pname = "garage";
|
|
|
|
inherit version;
|
2022-02-09 03:32:43 +01:00
|
|
|
|
2022-10-15 22:40:34 +02:00
|
|
|
src = fetchFromGitea {
|
|
|
|
domain = "git.deuxfleurs.fr";
|
|
|
|
owner = "Deuxfleurs";
|
|
|
|
repo = "garage";
|
|
|
|
rev = "v${version}";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
2022-04-10 12:05:20 +02:00
|
|
|
|
2024-01-17 16:21:47 +01:00
|
|
|
postPatch = ''
|
|
|
|
# Starting in 0.9.x series, Garage is using mold in local development
|
|
|
|
# and this leaks in this packaging, we remove it to use the default linker.
|
|
|
|
rm .cargo/config.toml || true
|
|
|
|
'';
|
|
|
|
|
2022-10-15 22:40:34 +02:00
|
|
|
inherit cargoSha256;
|
2022-02-09 03:32:43 +01:00
|
|
|
|
2022-10-15 22:40:34 +02:00
|
|
|
nativeBuildInputs = [ protobuf pkg-config ];
|
2022-08-09 11:46:05 +02:00
|
|
|
|
2022-10-15 22:40:34 +02:00
|
|
|
buildInputs = [
|
|
|
|
openssl
|
|
|
|
] ++ lib.optional stdenv.isDarwin Security;
|
2022-08-09 11:46:05 +02:00
|
|
|
|
2023-02-28 17:56:58 +01:00
|
|
|
checkInputs = [
|
|
|
|
cacert
|
|
|
|
];
|
|
|
|
|
2022-10-15 22:40:34 +02:00
|
|
|
OPENSSL_NO_VENDOR = true;
|
2022-08-09 11:46:05 +02:00
|
|
|
|
2023-03-14 10:06:43 +01:00
|
|
|
# See https://git.deuxfleurs.fr/Deuxfleurs/garage/src/tag/v0.8.2/nix/compile.nix#L192-L198
|
2022-10-15 22:40:34 +02:00
|
|
|
# on version changes for checking if changes are required here
|
|
|
|
buildFeatures = [
|
|
|
|
"kubernetes-discovery"
|
|
|
|
"bundled-libs"
|
|
|
|
"sled"
|
|
|
|
"metrics"
|
|
|
|
"k2v"
|
|
|
|
"telemetry-otlp"
|
|
|
|
"lmdb"
|
|
|
|
"sqlite"
|
2023-02-28 17:56:58 +01:00
|
|
|
"consul-discovery"
|
2023-10-10 18:16:24 +02:00
|
|
|
];
|
2022-05-11 23:32:35 +02:00
|
|
|
|
2022-10-15 22:40:34 +02:00
|
|
|
# To make integration tests pass, we include the optional k2v feature here,
|
2023-02-28 17:56:58 +01:00
|
|
|
# but in buildFeatures only for version 0.8+, where it's enabled by default.
|
|
|
|
# See: https://garagehq.deuxfleurs.fr/documentation/reference-manual/k2v/
|
2022-10-15 22:40:34 +02:00
|
|
|
checkFeatures = [
|
|
|
|
"k2v"
|
|
|
|
"kubernetes-discovery"
|
|
|
|
"bundled-libs"
|
|
|
|
"sled"
|
|
|
|
"lmdb"
|
|
|
|
"sqlite"
|
2023-10-10 18:16:24 +02:00
|
|
|
];
|
2022-02-09 03:32:43 +01:00
|
|
|
|
2023-08-29 16:18:07 +02:00
|
|
|
passthru.tests = nixosTests.garage;
|
2022-10-15 22:40:34 +02:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "S3-compatible object store for small self-hosted geo-distributed deployments";
|
2024-01-17 16:27:41 +01:00
|
|
|
changelog = "https://git.deuxfleurs.fr/Deuxfleurs/garage/releases/tag/v${version}";
|
2022-10-15 22:40:34 +02:00
|
|
|
homepage = "https://garagehq.deuxfleurs.fr";
|
|
|
|
license = lib.licenses.agpl3Only;
|
|
|
|
maintainers = with lib.maintainers; [ nickcao _0x4A6F teutat3s raitobezarius ];
|
|
|
|
knownVulnerabilities = (lib.optional eol "Garage version ${version} is EOL");
|
2022-12-30 15:10:26 +01:00
|
|
|
inherit broken;
|
2023-11-23 22:09:35 +01:00
|
|
|
mainProgram = "garage";
|
2022-10-15 22:40:34 +02:00
|
|
|
};
|
2022-02-09 03:32:43 +01:00
|
|
|
};
|
2022-10-15 22:40:34 +02:00
|
|
|
in
|
2023-10-16 21:48:57 +02:00
|
|
|
rec {
|
|
|
|
# Until Garage hits 1.0, 0.7.3 is equivalent to 7.3.0 for now, therefore
|
|
|
|
# we have to keep all the numbers in the version to handle major/minor/patch level.
|
|
|
|
# for <1.0.
|
2022-10-15 22:40:34 +02:00
|
|
|
|
2024-01-17 16:20:44 +01:00
|
|
|
garage_0_8_5 = generic {
|
|
|
|
version = "0.8.5";
|
|
|
|
sha256 = "sha256-YRxkjETSmI1dcHP9qTPLcOMqXx9B2uplVR3bBjJWn3I=";
|
|
|
|
cargoSha256 = "sha256-VOcymlvqqQRdT1MFzRcMuD+Xo3fc3XTuRA12tW7ZjdI=";
|
2024-01-18 04:05:06 +01:00
|
|
|
broken = stdenv.isDarwin;
|
2023-10-16 21:48:57 +02:00
|
|
|
};
|
2022-10-15 22:40:34 +02:00
|
|
|
|
2024-01-17 16:20:44 +01:00
|
|
|
garage_0_8 = garage_0_8_5;
|
2022-10-15 22:40:34 +02:00
|
|
|
|
2024-01-17 16:21:47 +01:00
|
|
|
garage_0_9_1 = generic {
|
|
|
|
version = "0.9.1";
|
|
|
|
sha256 = "sha256-AXLaifVmZU4j5D/wKn/0TzhjHZBzZW1+tMyhsAo2eBU=";
|
|
|
|
cargoSha256 = "sha256-4/+OsM73TroBB1TGqare2xASO5KhqVyNkkss0Y0JZXg=";
|
|
|
|
};
|
2023-10-10 18:17:12 +02:00
|
|
|
|
2024-01-17 16:21:47 +01:00
|
|
|
garage_0_9 = garage_0_9_1;
|
2023-10-10 18:17:12 +02:00
|
|
|
|
2023-10-16 21:56:27 +02:00
|
|
|
garage = garage_0_9;
|
2023-10-16 21:48:57 +02:00
|
|
|
}
|