3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/editors/neovim/gnvim/default.nix
Daniël de Kok 85f96822a0 treewide: fix cargoSha256/cargoHash
Rust 1.50.0 incorporated a Cargo change (rust-lang/cargo#8937) in
which cargo vendor erroneously changed permissions of vendored
crates. This was fixed in Rust
1.51.0 (rust-lang/cargo#9131). Unfortunately, this means that all
cargoSha256/cargoHashes produced during the Rust 1.50.0 cycle are
potentially broken.

This change updates cargoSha256/cargoHash tree-wide.

Fixes #121994.
2021-05-08 00:36:37 -07:00

51 lines
1.4 KiB
Nix

{ lib, rustPlatform, fetchFromGitHub, gtk, webkitgtk }:
rustPlatform.buildRustPackage rec {
pname = "gnvim-unwrapped";
version = "0.1.6";
src = fetchFromGitHub {
owner = "vhakulinen";
repo = "gnvim";
rev = "v${version}";
sha256 = "1cc3yk04v9icdjr5cn58mqc3ba1wqmlzhf9ly7biy9m8yk30w9y0";
};
cargoSha256 = "0z6hhahxdc6d7nzqvc8jlxn1frsc39va8z5pmwfmmq5z61ahk90z";
buildInputs = [ gtk webkitgtk ];
# The default build script tries to get the version through Git, so we
# replace it
postPatch = ''
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
# Install the binary ourselves, since the Makefile doesn't have the path
# containing the target architecture
sed -e "/target\/release/d" -i Makefile
'';
postInstall = ''
make install PREFIX="${placeholder "out"}"
'';
meta = with lib; {
description = "GUI for neovim, without any web bloat";
homepage = "https://github.com/vhakulinen/gnvim";
license = licenses.mit;
maintainers = with maintainers; [ minijackson ];
};
}