nixpkgs/pkgs/servers/syncstorage-rs/default.nix
pennae a97a75a7b7 syncstorage-rs: make linux-only
doesn't build on darwin, and apparently never has.
2022-12-21 10:29:25 +01:00

65 lines
1.2 KiB
Nix

{ fetchFromGitHub
, rustPlatform
, pkg-config
, python3
, openssl
, cmake
, libmysqlclient
, makeBinaryWrapper
, lib
}:
let
pyFxADeps = python3.withPackages (p: [
p.setuptools # imports pkg_resources
# remainder taken from requirements.txt
p.pyfxa
p.tokenlib
p.cryptography
]);
in
rustPlatform.buildRustPackage rec {
pname = "syncstorage-rs";
version = "0.13.1";
src = fetchFromGitHub {
owner = "mozilla-services";
repo = pname;
rev = version;
hash = "sha256-aRLTuP5He8rHsi4Qw+CptyGhp2JdQwL/jLNmHUPcYBU=";
};
nativeBuildInputs = [
cmake
makeBinaryWrapper
pkg-config
python3
];
buildInputs = [
libmysqlclient
openssl
];
preFixup = ''
wrapProgram $out/bin/syncserver \
--prefix PATH : ${lib.makeBinPath [ pyFxADeps ]}
'';
cargoSha256 = "sha256-95wK0jFbuu1xFacOAJFAQitm/tlvMUIny2As49QukQE=";
buildFeatures = [ "grpcio/openssl" ];
# almost all tests need a DB to test against
doCheck = false;
meta = {
description = "Mozilla Sync Storage built with Rust";
homepage = "https://github.com/mozilla-services/syncstorage-rs";
license = lib.licenses.mpl20;
maintainers = with lib.maintainers; [ pennae ];
platforms = lib.platforms.linux;
};
}