2019-05-17 22:40:08 +02:00
|
|
|
{ stdenv, fetchurl, rustPlatform, darwin, openssl, libsodium, nettle, clang, libclang, pkgconfig }:
|
2017-03-20 08:19:05 +01:00
|
|
|
|
2019-11-20 04:22:22 +01:00
|
|
|
let
|
|
|
|
# nettle-sys=1.0.1 requires the des-compat.h header, but it was removed in
|
|
|
|
# nettle 3.5. See https://nest.pijul.com/pijul_org/pijul/discussions/416
|
|
|
|
# Remove with the next release
|
|
|
|
nettle_34 = nettle.overrideAttrs (_oldAttrs: rec {
|
|
|
|
version = "3.4.1";
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://gnu/nettle/nettle-${version}.tar.gz";
|
|
|
|
sha256 = "1bcji95n1iz9p9vsgdgr26v6s7zhpsxfbjjwpqcihpfd6lawyhgr";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
in rustPlatform.buildRustPackage rec {
|
2019-08-31 13:41:23 +02:00
|
|
|
pname = "pijul";
|
2019-05-17 22:40:08 +02:00
|
|
|
version = "0.12.0";
|
2017-03-20 08:19:05 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-31 13:41:23 +02:00
|
|
|
url = "https://pijul.org/releases/${pname}-${version}.tar.gz";
|
2019-05-17 22:40:08 +02:00
|
|
|
sha256 = "1rm787kkh3ya8ix0rjvj7sbrg9armm0rnpkga6gjmsbg5bx20y4q";
|
2017-03-20 08:19:05 +01:00
|
|
|
};
|
|
|
|
|
2020-02-16 00:41:54 +01:00
|
|
|
cargoSha256 = "0rf8qmgzgyl718yznbskzafyg963ygibjmqncd93zdandgl9nj5v";
|
|
|
|
|
|
|
|
# N.B. The cargo depfile checker expects us to have unpacked the src tarball
|
|
|
|
# into the standard dirname "source".
|
|
|
|
cargoDepsHook = ''
|
|
|
|
ln -s ${pname}-${version} source
|
|
|
|
'';
|
|
|
|
|
|
|
|
# TODO: Delete once pijul fixes upstream:
|
|
|
|
# https://nest.pijul.com/pijul_org/pijul/discussions/447
|
2020-02-04 13:55:36 +01:00
|
|
|
postPatch = ''
|
2020-02-16 00:41:54 +01:00
|
|
|
pushd ../${pname}-${version}-vendor.tar.gz/thrussh/
|
2020-02-04 13:55:36 +01:00
|
|
|
patch -p1 < ${./thrussh-build-fix.patch}
|
|
|
|
substituteInPlace .cargo-checksum.json --replace \
|
|
|
|
9696ed2422a483cd8de48ac241178a0441be6636909c76174c536b8b1cba9d45 \
|
|
|
|
a199f2bba520d56e11607b77be4dde0cfae576c90badb9fbd39af4784e8120d1
|
|
|
|
popd
|
|
|
|
'';
|
|
|
|
|
2019-05-17 22:40:08 +02:00
|
|
|
nativeBuildInputs = [ pkgconfig clang ];
|
2018-10-28 11:39:35 +01:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share/{bash-completion/completions,zsh/site-functions,fish/vendor_completions.d}
|
|
|
|
$out/bin/pijul generate-completions --bash > $out/share/bash-completion/completions/pijul
|
|
|
|
$out/bin/pijul generate-completions --zsh > $out/share/zsh/site-functions/_pijul
|
|
|
|
$out/bin/pijul generate-completions --fish > $out/share/fish/vendor_completions.d/pijul.fish
|
|
|
|
'';
|
|
|
|
|
2019-05-17 22:40:08 +02:00
|
|
|
LIBCLANG_PATH = libclang + "/lib";
|
|
|
|
|
2019-11-20 04:22:22 +01:00
|
|
|
buildInputs = [ openssl libsodium nettle_34 libclang ] ++ stdenv.lib.optionals stdenv.isDarwin
|
2019-05-23 15:06:25 +02:00
|
|
|
(with darwin.apple_sdk.frameworks; [ CoreServices Security ]);
|
2017-03-20 08:19:05 +01:00
|
|
|
|
|
|
|
doCheck = false;
|
2017-06-07 10:24:44 +02:00
|
|
|
|
2017-03-20 08:19:05 +01:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A distributed version control system";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://pijul.org";
|
2017-03-20 08:19:05 +01:00
|
|
|
license = with licenses; [ gpl2Plus ];
|
|
|
|
maintainers = [ maintainers.gal_bolle ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|