2021-01-25 09:26:54 +01:00
|
|
|
{ lib, rustPlatform, fetchFromGitHub, gtk, webkitgtk }:
|
2019-09-18 13:06:42 +02:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "gnvim-unwrapped";
|
2020-07-08 23:03:42 +02:00
|
|
|
version = "0.1.6";
|
2019-09-18 13:06:42 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "vhakulinen";
|
|
|
|
repo = "gnvim";
|
2020-07-08 23:03:42 +02:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1cc3yk04v9icdjr5cn58mqc3ba1wqmlzhf9ly7biy9m8yk30w9y0";
|
2019-09-18 13:06:42 +02:00
|
|
|
};
|
|
|
|
|
2021-05-07 13:00:49 +02:00
|
|
|
cargoSha256 = "0z6hhahxdc6d7nzqvc8jlxn1frsc39va8z5pmwfmmq5z61ahk90z";
|
2019-09-18 13:06:42 +02:00
|
|
|
|
|
|
|
buildInputs = [ gtk webkitgtk ];
|
|
|
|
|
|
|
|
# The default build script tries to get the version through Git, so we
|
|
|
|
# replace it
|
2021-03-06 17:11:31 +01:00
|
|
|
postPatch = ''
|
2019-09-18 13:06:42 +02:00
|
|
|
cat << EOF > build.rs
|
|
|
|
use std::env;
|
|
|
|
use std::fs::File;
|
|
|
|
use std::io::Write;
|
|
|
|
use std::path::Path;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let out_dir = env::var("OUT_DIR").unwrap();
|
|
|
|
let dest_path = Path::new(&out_dir).join("gnvim_version.rs");
|
|
|
|
let mut f = File::create(&dest_path).unwrap();
|
|
|
|
f.write_all(b"const VERSION: &str = \"${version}\";").unwrap();
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
2021-03-06 17:11:31 +01:00
|
|
|
# Install the binary ourselves, since the Makefile doesn't have the path
|
|
|
|
# containing the target architecture
|
|
|
|
sed -e "/target\/release/d" -i Makefile
|
2020-05-13 22:19:47 +02:00
|
|
|
'';
|
|
|
|
|
2021-03-06 17:11:31 +01:00
|
|
|
postInstall = ''
|
2019-09-18 13:06:42 +02:00
|
|
|
make install PREFIX="${placeholder "out"}"
|
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2019-09-18 13:06:42 +02:00
|
|
|
description = "GUI for neovim, without any web bloat";
|
|
|
|
homepage = "https://github.com/vhakulinen/gnvim";
|
2020-03-09 00:19:41 +01:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ minijackson ];
|
2019-09-18 13:06:42 +02:00
|
|
|
};
|
|
|
|
}
|