daa84 / neovim-gtk

gtk ui for neovim
GNU General Public License v3.0
718 stars 56 forks source link

How to install this? #65

Closed qazip closed 6 years ago

qazip commented 6 years ago

Hello,

Can you please edit the README and actually explain how to install this? I tried both the flatpak and compiling but it just didn't work.

After downloading the flatpak, how does one install it? flatpak install --bundle blabla.flatpak? Doesn't work.

How does one compile? git clone blabla, cd blabla, make? Doesn't work.

wezm commented 6 years ago

These instructions in the README worked for me: https://github.com/daa84/neovim-gtk/blob/master/README.md#install

kirillrdy commented 6 years ago

on a fair point, it might not be immediately obvious that first installation method requires working rust tool chain and a lot of development packages for gtk, X etc I guess that can be improved

qazip commented 6 years ago

Indeed, and I still don't know what the dependencies are. Does anyone have a list of prerequesites I need to have in order to be able to install this?

kirillrdy commented 6 years ago

@qazip what distro are you using? I can easily make a list of packages for Ubuntu and/or fedora.

qazip commented 6 years ago

@kirillrdy, I'm using ubuntu 16.04

kirillrdy commented 6 years ago

@qazip so, its actually very straight forward all you need is

qazip commented 6 years ago
error: failed to run custom build command for `gdk-sys v0.5.0`
process didn't exit successfully: `/home/user/neovim-gtk/target/release/build/gdk-sys-67fcf4758db7c0b4/build-script-build` (exit code: 1)
--- stderr
`"pkg-config" "--libs" "--cflags" "gdk-3.0 >= 3.22"` did not exit successfully: exit code: 1
--- stderr
Requested 'gdk-3.0 >= 3.22' but version of GDK is 3.18.9

Guess 16.04 is behind. A proper README file would've helped. Either way, thank you for all the help @kirillrdy!

joshnabbott commented 5 years ago

Not to beat a dead horse, but I had a rough time getting this installed. I'm not 100% certain I followed the right steps, but I

And that's where the issues started.

cargo install

Yielded me this error:

error: Using `cargo install` to install the binaries for the package in current working directory is no longer supported, use `cargo install --path .` instead. Use `cargo build` if you want to simply build the package.

make install

Got me permission denied errors

sudo make install

Got this error:

make: cargo: Command not found

(I don't know if root is supposed to see cargo or not. From what I gathered on the interwebs, if you're running sudo cargo you're doing something wrong.

Just to see what neovim-gtk looks like, I hacked my install with this

make PREFIX=/my/home/dir install

And it says it worked. I'm about to test, but wanted to document what I ran into here, in case someone needs it, or I'm an idiot and someone wants to tell me the right way to do this.

kirillrdy commented 5 years ago

@joshnabbott thank you for your post. Just so that you don't feel left out and you don't feel like an idiot( your words). 1) cargo install --path . is correct suggestion by cargo. That will install nvim-gtk binary in $HOME/.cargo/bin which is fine. so if you do that and you add $HOME/.cargo/bin to your path. thats enough to use nvim-gtk 2) make install would fail if you dont have write permissions to /usr/local ( thats normal ) 3) sudo make install, would not have $HOME/.cargo/bin in path ( which is what rustup installer does for you ), so it cant find cargo, so also normal

to simplify if you just want to install binary and run it cargo install --path . is enough, then you either add it to your path or call directly, no difference If you want it to show up as an application in Gnome or KDE, you can run make install the only thing it does is copy desktop shortcut file and a default font.

have a look at Makefile Hope this helps someone else as well K

joshnabbott commented 5 years ago

@kirillrdy thanks for confirming that I'm maybe not an idiot and for the explanation!

ewhac commented 5 years ago

I just bumped in to this myself. As a larval Rustacean, I'm not yet familiar with the ways Rust wants things to be.

The "traditional" way of doing this is:

sh$ make
sh$ sudo make install

The first step builds the program as a normal user. The second step copies the built binaries to their final location. cargo install, OTOH, does some unexpected things.

cargo install --debug --path . --force --root /usr/local when run as a normal user fails with the message:

error: failed to open: /usr/local/.crates.toml

Caused by:
  Permission denied (os error 13)

Obviously this fails as we don't have write permissions to /usr/local. The only surprising thing is the mention of the file .crates.toml (what's that all about?).

However, when we run cargo install as the superuser, it tries to re-download and build the world, even though we just did that as a normal user. A quick check reveals that a .cargo directory is created in root's home directory. So it seems cargo install first consults a database to see if any new/updated crates need to be downloaded/built, and the database it consults is the one belonging to the effective user (in this case, root, who hasn't built anything). It further appears there's no way to defeat this behavior (i.e. don't try to build anything, just install the binary that's already here).

All of which is a long-winded way of saying that, unless and until cargo install does something less surprising, supporting installs to /usr/local might be more trouble than it's worth.

(If you want to support adding desktop launcher icons, that can be done for the local user by copying things into the analogous directories under $HOME/.local/share.)