Unverified Commit 6810db91 authored by Rémi NICOLE's avatar Rémi NICOLE Committed by GitHub
Browse files

gnvim: 0.1.6 -> 0.3.1 (#204082)

parent ae9c464f
Loading
Loading
Loading
Loading
+699 −1080

File changed.

Preview size limit exceeded, changes collapsed.

+13 −24
Original line number Diff line number Diff line
{ 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";
+3 −11
Original line number Diff line number Diff line
{ stdenv, gnvim-unwrapped, neovim, makeWrapper }:
{ lib, stdenv, gnvim-unwrapped, neovim, makeWrapper }:

stdenv.mkDerivation {
  pname = "gnvim";
  version = gnvim-unwrapped.version;
  buildCommand = if stdenv.isDarwin then ''
    mkdir -p $out/Applications
    cp -r ${gnvim-unwrapped}/bin/gnvim.app $out/Applications

    chmod -R a+w "$out/Applications/gnvim.app/Contents/MacOS"
    wrapProgram "$out/Applications/gnvim.app/Contents/MacOS/gnvim" \
      --prefix PATH : "${neovim}/bin" \
      --set GNVIM_RUNTIME_PATH "${gnvim-unwrapped}/share/gnvim/runtime"
  '' else ''
  buildCommand = ''
    makeWrapper '${gnvim-unwrapped}/bin/gnvim' "$out/bin/gnvim" \
      --prefix PATH : "${neovim}/bin" \
      --set GNVIM_RUNTIME_PATH "${gnvim-unwrapped}/share/gnvim/runtime"

  '' + lib.optionalString (!stdenv.isDarwin) ''
    mkdir -p "$out/share"
    ln -s '${gnvim-unwrapped}/share/icons' "$out/share/icons"

+1 −3
Original line number Diff line number Diff line
@@ -34640,9 +34640,7 @@ with pkgs;
  neovim-qt-unwrapped = libsForQt5.callPackage ../applications/editors/neovim/neovim-qt.nix { };
  neovim-qt = libsForQt5.callPackage ../applications/editors/neovim/qt.nix { };
  gnvim-unwrapped = callPackage ../applications/editors/neovim/gnvim {
    gtk = gtk3;
  };
  gnvim-unwrapped = callPackage ../applications/editors/neovim/gnvim { };
  gnvim = callPackage ../applications/editors/neovim/gnvim/wrapper.nix { };