2021-01-17 09:17:16 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, rustPlatform, pkg-config, openssl, libsodium
|
2021-03-14 18:12:53 +00:00
|
|
|
, llvmPackages, clang, xz
|
2019-02-13 10:06:20 +00:00
|
|
|
, Security }:
|
2017-11-20 09:24:43 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2019-08-31 12:41:23 +01:00
|
|
|
pname = "rdedup";
|
2021-09-15 18:18:41 +01:00
|
|
|
version = "3.2.1";
|
2017-11-20 09:24:43 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dpc";
|
|
|
|
repo = "rdedup";
|
2021-09-15 18:18:41 +01:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-GEYP18CaCQShvCg8T7YTvlybH1LNO34KBxgmsTv2Lzs=";
|
2017-11-20 09:24:43 +00:00
|
|
|
};
|
|
|
|
|
2021-09-15 18:18:41 +01:00
|
|
|
cargoSha256 = "sha256-I6d3IyPBcUsrvlzF7W0hFM4hcXi4wWro9bCeP4eArHI=";
|
2017-11-20 09:24:43 +00:00
|
|
|
|
2021-01-17 09:17:16 +00:00
|
|
|
nativeBuildInputs = [ pkg-config llvmPackages.libclang clang ];
|
2021-03-14 18:12:53 +00:00
|
|
|
buildInputs = [ openssl libsodium xz ]
|
2021-01-15 09:19:50 +00:00
|
|
|
++ (lib.optional stdenv.isDarwin Security);
|
2019-02-13 10:06:20 +00:00
|
|
|
|
2018-07-30 11:50:51 +01:00
|
|
|
configurePhase = ''
|
llvmPackages: Multuple outputs for everythting
Also begin to start work on cross compilation, though that will have to
be finished later.
The patches are based on the first version of
https://reviews.llvm.org/D99484. It's very annoying to do the
back-porting but the review has uncovered nothing super major so I'm
fine sticking with what I've got.
Beyond making the outputs work, I also strove to re-sync the packages,
as they have been drifting pointlessly apart for some time.
----
Other misc notes, highly incomplete
- lvm-config-native and llvm-config are put in `dev` because they are
tools just for build time.
- Clang no longer has an lld dep. That was introduced in
db29857eb391ed002046090851a44c452b80bdbd, but if clang needs help
finding lld when it is used we should just pass it flags / put in the
resource dir. Providing it at build time increases critical path
length for no good reason.
----
A note on `nativeCC`:
`stdenv` takes tools from the previous stage, so:
1. `pkgsBuildBuild`: `(?1, x, x)`
2. `pkgsBuildBuild.stdenv.cc`: `(?0, ?1, x)`
while:
1. `pkgsBuildBuild`: `(?1, x, x)`
2. `pkgsBuildBuild.targetPackages`: `(x, x, ?2)`
3. `pkgsBuildBuild.targetPackages.stdenv.cc`: `(?1, x, x)`
2020-10-15 09:23:57 +01:00
|
|
|
export LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib"
|
2018-07-30 11:50:51 +01:00
|
|
|
'';
|
2017-11-20 09:24:43 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2017-11-20 09:24:43 +00:00
|
|
|
description = "Data deduplication with compression and public key encryption";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/dpc/rdedup";
|
2017-11-20 09:24:43 +00:00
|
|
|
license = licenses.mpl20;
|
|
|
|
maintainers = with maintainers; [ dywedir ];
|
2019-02-13 10:12:01 +00:00
|
|
|
broken = stdenv.isDarwin;
|
2017-11-20 09:24:43 +00:00
|
|
|
};
|
|
|
|
}
|