2020-01-04 23:12:36 +00:00
|
|
|
{ stdenv, rustPlatform, fetchFromGitHub, llvmPackages }:
|
2019-05-05 16:34:19 +01:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2019-08-31 12:41:23 +01:00
|
|
|
pname = "parinfer-rust";
|
2020-01-04 23:12:36 +00:00
|
|
|
version = "0.4.2";
|
2019-05-05 16:34:19 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "eraserhd";
|
|
|
|
repo = "parinfer-rust";
|
|
|
|
rev = "v${version}";
|
2020-01-04 23:12:36 +00:00
|
|
|
sha256 = "1k2kr1zlxx3w3kwb634kngzx8vl5iif1yr6zk2xh46gjwqb3223l";
|
2019-05-05 16:34:19 +01:00
|
|
|
};
|
|
|
|
|
2020-02-14 02:00:26 +00:00
|
|
|
# Delete this on next update; see #79975 for details
|
|
|
|
legacyCargoFetcher = true;
|
|
|
|
|
2020-01-04 23:12:36 +00:00
|
|
|
cargoSha256 = "0i5wy15w985nxwl4b6rzb06hchzjwph6ygzjkkmigm9diw9jcycn";
|
|
|
|
|
|
|
|
buildInputs = [ llvmPackages.libclang llvmPackages.clang ];
|
|
|
|
LIBCLANG_PATH = "${llvmPackages.libclang}/lib";
|
2019-05-05 16:34:19 +01:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share/kak/autoload/plugins
|
|
|
|
cp rc/parinfer.kak $out/share/kak/autoload/plugins/
|
2020-01-04 23:12:36 +00:00
|
|
|
|
|
|
|
rtpPath=$out/share/vim-plugins/parinfer-rust
|
|
|
|
mkdir -p $rtpPath/plugin
|
|
|
|
sed "s,let s:libdir = .*,let s:libdir = '${placeholder "out"}/lib'," \
|
|
|
|
plugin/parinfer.vim >$rtpPath/plugin/parinfer.vim
|
2019-05-05 16:34:19 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Infer parentheses for Clojure, Lisp, and Scheme.";
|
|
|
|
homepage = "https://github.com/eraserhd/parinfer-rust";
|
|
|
|
license = licenses.isc;
|
|
|
|
maintainers = with maintainers; [ eraserhd ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|