pijul: 0.12.0 -> 1.0.0-alpha

This commit is contained in:
Vladyslav M 2020-11-09 14:03:31 +02:00
parent 72c424a968
commit 2e1400173b
No known key found for this signature in database
GPG key ID: 3B1AD98E3D65BD4D
2 changed files with 29 additions and 61 deletions

View file

@ -1,64 +1,44 @@
{ stdenv, fetchurl, rustPlatform, darwin, openssl, libsodium, nettle, clang, libclang, pkgconfig }:
{ stdenv
, fetchCrate
, rustPlatform
, pkg-config
, clang
, libclang
, libsodium
, openssl
, xxHash
, zstd
, darwin
, gitImportSupport ? true
, libgit2 ? null
}:
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 {
rustPlatform.buildRustPackage rec {
pname = "pijul";
version = "0.12.0";
version = "1.0.0-alpha";
src = fetchurl {
url = "https://pijul.org/releases/${pname}-${version}.tar.gz";
sha256 = "1rm787kkh3ya8ix0rjvj7sbrg9armm0rnpkga6gjmsbg5bx20y4q";
src = fetchCrate {
inherit version pname;
sha256 = "0dnw2cxsxb20my81szyqjsmmnkakxawvsk6cnd1fi88k4lr0z2xh";
};
cargoSha256 = "0rf8qmgzgyl718yznbskzafyg963ygibjmqncd93zdandgl9nj5v";
cargoSha256 = "130vryqs0g4a0328ivqafdylwqs64g4mp8vgmz6nz4c9l3h9wgcx";
# 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
postPatch = ''
pushd ../${pname}-${version}-vendor.tar.gz/thrussh/
patch -p1 < ${./thrussh-build-fix.patch}
substituteInPlace .cargo-checksum.json --replace \
9696ed2422a483cd8de48ac241178a0441be6636909c76174c536b8b1cba9d45 \
a199f2bba520d56e11607b77be4dde0cfae576c90badb9fbd39af4784e8120d1
popd
'';
nativeBuildInputs = [ pkgconfig clang ];
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
'';
LIBCLANG_PATH = libclang + "/lib";
buildInputs = [ openssl libsodium nettle_34 libclang ] ++ stdenv.lib.optionals stdenv.isDarwin
(with darwin.apple_sdk.frameworks; [ CoreServices Security ]);
cargoBuildFlags = stdenv.lib.optional gitImportSupport "--features=git";
LIBCLANG_PATH = "${libclang}/lib";
doCheck = false;
nativeBuildInputs = [ pkg-config clang ];
buildInputs = [ openssl libclang libsodium xxHash zstd ]
++ (stdenv.lib.optionals gitImportSupport [ libgit2 ])
++ (stdenv.lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
CoreServices Security SystemConfiguration
]));
meta = with stdenv.lib; {
description = "A distributed version control system";
homepage = "https://pijul.org";
license = with licenses; [ gpl2Plus ];
maintainers = [ maintainers.gal_bolle ];
maintainers = with maintainers; [ gal_bolle dywedir ];
};
}

View file

@ -1,12 +0,0 @@
--- a/src/client/connection.rs 2020-02-04 12:48:43.845299096 +0100
+++ b/src/client/connection.rs 2020-02-04 12:50:00.140329310 +0100
@@ -546,8 +546,8 @@
&[msg::NEWKEYS],
&mut session.0.write_buffer,
);
- session.0.kex = Some(Kex::NewKeys(newkeys));
newkeys.sent = true;
+ session.0.kex = Some(Kex::NewKeys(newkeys));
}
Ok(())
}