2023-09-08 10:59:27 +01:00
|
|
|
{
|
|
|
|
rustPlatform,
|
|
|
|
fetchFromGitHub,
|
2023-09-14 16:56:17 +01:00
|
|
|
nasm,
|
|
|
|
withWebP ? true,
|
|
|
|
withAVIF ? true,
|
2023-09-08 10:59:27 +01:00
|
|
|
}: let
|
|
|
|
meta = builtins.fromJSON (builtins.readFile ../../meta.json);
|
|
|
|
rev = meta.proxy.rev;
|
|
|
|
in
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "piped-proxy";
|
|
|
|
version = "latest-${rev}";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "TeamPiped";
|
|
|
|
repo = "piped-proxy";
|
|
|
|
inherit rev;
|
|
|
|
sha256 = "${meta.proxy.sha256}";
|
|
|
|
};
|
|
|
|
|
2023-09-12 21:34:10 +01:00
|
|
|
buildNoDefaultFeatures = true;
|
2023-09-14 16:56:17 +01:00
|
|
|
buildFeatures =
|
|
|
|
[]
|
|
|
|
++ (
|
|
|
|
if withAVIF
|
|
|
|
then ["avif"]
|
|
|
|
else []
|
|
|
|
)
|
|
|
|
++ (
|
|
|
|
if withWebP
|
|
|
|
then ["webp"]
|
|
|
|
else []
|
|
|
|
);
|
2023-09-12 21:34:10 +01:00
|
|
|
|
2023-09-14 16:56:17 +01:00
|
|
|
nativeBuildInputs =
|
|
|
|
if withAVIF
|
|
|
|
then [nasm]
|
|
|
|
else [];
|
2023-09-12 21:34:10 +01:00
|
|
|
|
2023-09-08 10:59:27 +01:00
|
|
|
cargoLock = {lockFile = "${src}/Cargo.lock";};
|
|
|
|
doCheck = false;
|
|
|
|
}
|