about summary refs log tree commit diff
path: root/pkgs/applications/editors/neovim/gnvim/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/editors/neovim/gnvim/default.nix')
-rw-r--r--pkgs/applications/editors/neovim/gnvim/default.nix37
1 files changed, 13 insertions, 24 deletions
diff --git a/pkgs/applications/editors/neovim/gnvim/default.nix b/pkgs/applications/editors/neovim/gnvim/default.nix
index e0d0fe45ea88a..01248b287c516 100644
--- a/pkgs/applications/editors/neovim/gnvim/default.nix
+++ b/pkgs/applications/editors/neovim/gnvim/default.nix
@@ -1,42 +1,28 @@
-{ lib, rustPlatform, fetchFromGitHub, gtk, webkitgtk }:
+{ lib, rustPlatform, fetchFromGitHub, pkg-config, glib, gtk4 }:
 
 rustPlatform.buildRustPackage rec {
   pname = "gnvim-unwrapped";
-  version = "0.1.6";
+  version = "0.3.1";
 
   src = fetchFromGitHub {
     owner = "vhakulinen";
     repo = "gnvim";
     rev = "v${version}";
-    sha256 = "1cc3yk04v9icdjr5cn58mqc3ba1wqmlzhf9ly7biy9m8yk30w9y0";
+    hash = "sha256-VyyHlyMW/9zYECobQwngFARQYqcoXmopyCHUwHolXfo=";
   };
 
-  cargoLock = {
-    lockFile = ./Cargo.lock;
-    outputHashes = {
-      "nvim-rs-0.1.1-alpha.0" = "sha256-wn68Lix3zZULrg/G4hP+OSj1GbEZMsA/+PaOlG9WLtc=";
-    };
-  };
+  cargoLock.lockFile = ./Cargo.lock;
 
-  buildInputs = [ gtk webkitgtk ];
+  nativeBuildInputs = [
+    pkg-config
+    # for the `glib-compile-resources` command
+    glib
+  ];
+  buildInputs = [ glib gtk4 ];
 
   # 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
@@ -46,6 +32,9 @@ rustPlatform.buildRustPackage rec {
     make install PREFIX="${placeholder "out"}"
   '';
 
+  # GTK fails to initialize
+  doCheck = false;
+
   meta = with lib; {
     description = "GUI for neovim, without any web bloat";
     homepage = "https://github.com/vhakulinen/gnvim";