forked from eraserhd/parinfer-rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathderivation.nix
More file actions
40 lines (33 loc) · 1.12 KB
/
derivation.nix
File metadata and controls
40 lines (33 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{ lib, stdenv, libiconv, rustPlatform, fetchFromGitHub, llvmPackages }:
rustPlatform.buildRustPackage rec {
name = "parinfer-rust-${version}";
version = "0.5.0";
src = ./.;
cargoLock = {
lockFile = ./Cargo.lock;
};
useFetchCargoVendor = true;
nativeBuildInputs = [
llvmPackages.libclang
llvmPackages.clang
libiconv
rustPlatform.bindgenHook
];
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
postInstall = ''
mkdir -p $out/share/kak/autoload/plugins
sed "s,^str parinfer_path .*,str parinfer_path '${placeholder "out"}/bin/parinfer-rust'," \
rc/parinfer.kak >$out/share/kak/autoload/plugins/parinfer.kak
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
'';
meta = with 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;
};
}