Skip to content
This repository has been archived by the owner on Aug 8, 2018. It is now read-only.

neovim now depends on gperf for building #175

Closed
knarz opened this issue Sep 1, 2016 · 11 comments
Closed

neovim now depends on gperf for building #175

knarz opened this issue Sep 1, 2016 · 11 comments

Comments

@knarz
Copy link

knarz commented Sep 1, 2016

As of neovim/neovim@7e2348f neovim requires gperf during build.

The following doesn't seem to work because gperf is not in homebrew-core.

    resource "gperf" do
      url "https://ftpmirror.gnu.org/gperf/gperf-3.0.4.tar.gz"
      sha256 "767112a204407e62dbc3106647cf839ed544f3cf5d0f0523aaa2508623aad63e"
    end

Setting USE_EXISTING_SRC_DIR to OFF fixes the build but I'm not sure if that is the proper approach. What would the proper approach be?

@jszakmeister
Copy link
Contributor

It shouldn't need to be in homebrew-core... it's a resource for our project, not a Homebrew depedency. The above should work fine. What issue are you having? What error did you see?

@kassio
Copy link

kassio commented Sep 2, 2016

I'm getting the following error:

Last 15 lines from /Users/kborges/Library/Logs/Homebrew/neovim/02.make:
/usr/local/Cellar/cmake/3.6.1/bin/cmake -E make_directory /tmp/neovim-20160902-70131-dpc1hs/deps-build/build/tmp
/usr/local/Cellar/cmake/3.6.1/bin/cmake -E make_directory /tmp/neovim-20160902-70131-dpc1hs/deps-build/build/src/gperf-stamp
/usr/local/Cellar/cmake/3.6.1/bin/cmake -E make_directory /tmp/neovim-20160902-70131-dpc1hs/deps-build/build/downloads/gperf
/usr/local/Cellar/cmake/3.6.1/bin/cmake -E touch /tmp/neovim-20160902-70131-dpc1hs/deps-build/build/src/gperf-stamp/gperf-mkdir
[ 92%] Performing download step for 'gperf'
cd /tmp/neovim-20160902-70131-dpc1hs/deps-build/build/downloads/gperf && /usr/local/Cellar/cmake/3.6.1/bin/cmake -DPREFIX=/tmp/neovim-20160902-70131-dpc1hs/deps-build/build -DDOWNLOAD_DIR=/tmp/neovim-20160902-70131-dpc1hs/deps-build/build/downloads/gperf -DURL=http://ftp.gnu.org/pub/gnu/gperf/gperf-3.0.4.tar.gz -DEXPECTED_SHA256=767112a204407e62dbc3106647cf839ed544f3cf5d0f0523aaa2508623aad63e -DTARGET=gperf -DUSE_EXISTING_SRC_DIR=ON -P /tmp/neovim-20160902-70131-dpc1hs/third-party/cmake/DownloadAndExtractFile.cmake
CMake Error at /tmp/neovim-20160902-70131-dpc1hs/third-party/cmake/DownloadAndExtractFile.cmake:33 (message):
  USE_EXISTING_SRC_DIR set to ON, but
  '/tmp/neovim-20160902-70131-dpc1hs/deps-build/build/src/gperf' does not
  exist or is empty.


make[2]: *** [build/src/gperf-stamp/gperf-download] Error 1
make[1]: *** [CMakeFiles/gperf.dir/all] Error 2
make: *** [all] Error 2

@jszakmeister
Copy link
Contributor

Interestingly enough, on OS X, there is already a gperf (v3.0.3) available, so we don't actually need it there.

@knarz
Copy link
Author

knarz commented Sep 2, 2016

The homebrew build breaks because it enables USE_EXISTING_SRC_DIR, which means that gperf doesn't get downloaded and makes cmake unable to locate the dependency.

@kassio
Copy link

kassio commented Sep 2, 2016

Adding the resource "gperf" do #... worked for me. 😄

@jszakmeister
Copy link
Contributor

That looks like something may have failed on the download step. CMake doesn't give a great error here, but it may have been an empty file. I just ran with:

+
+    resource "gperf" do
+      url "http://ftp.gnu.org/pub/gnu/gperf/gperf-3.0.4.tar.gz"
+      sha256 "767112a204407e62dbc3106647cf839ed544f3cf5d0f0523aaa2508623aad63e"
+    end

in the resources for building against HEAD (there are two separate blocks... make sure you're adding it to the right one), and everything built fine.

That said, I don't think we need any of it... gperf is available. What does gperf --version show on the command line? This is probably the patch we need:

diff --git a/Formula/neovim.rb b/Formula/neovim.rb
index 2468849..eab8c3e 100644
--- a/Formula/neovim.rb
+++ b/Formula/neovim.rb
@@ -119,7 +124,8 @@ class Neovim < Formula
     cd "deps-build" do
       ohai "Building third-party dependencies."
       system "cmake", "../third-party", "-DUSE_BUNDLED_BUSTED=OFF",
-             "-DUSE_BUNDLED_LUV=OFF", "-DUSE_EXISTING_SRC_DIR=ON",
+             "-DUSE_BUNDLED_GPERF=OFF", "-DUSE_BUNDLED_LUV=OFF",
+             "-DUSE_EXISTING_SRC_DIR=ON",
              *std_cmake_args
       system "make", "VERBOSE=1"
     end

@kassio
Copy link

kassio commented Sep 2, 2016

@jszakmeister yeah, I tried your patch and worked perfectly. Can you add this on master?

@jszakmeister
Copy link
Contributor

@knarz No. You added the resource to the wrong block... you need to add the resource block to the one that begins with 'head do' on line 51, so it wasn't actually downloaded and extracted.

@knarz
Copy link
Author

knarz commented Sep 2, 2016

I added it to the correct block but I forgot that I also added depends_on "gperf" => :build, without that it builds just fine, my bad.

@jszakmeister
Copy link
Contributor

@knarz I'm surprised by that last bit because that's adding a Homebrew dependency, and there is no gperf recipe. I expect that to fail. :-(

@jszakmeister
Copy link
Contributor

Ah, I just read it again... it did fail. :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants