gerbera / homebrew-gerbera

A Homebrew Tap for Gerbera Media Server
https://gerbera.io
14 stars 8 forks source link

Gerbera doesn't install using homebrew #25

Closed galliangg closed 3 years ago

galliangg commented 4 years ago

brew install gerbera Updating Homebrew... ==> Auto-updated Homebrew! Updated 2 taps (homebrew/core and homebrew/cask-drivers). ==> Updated Formulae Updated 8 formulae. ==> Updated Casks nvidia-web-driver

==> Installing gerbera from gerbera/gerbera ==> Downloading https://github.com/gerbera/gerbera/archive/v1.6.1.tar.gz Already downloaded: /Users/james/Library/Caches/Homebrew/downloads/e7d5e6026a4aa5a56c8c28029d1ec74e2a24da4121df36e307935f59341bef9f--gerbera-1.6.1.tar.gz ==> cmake .. -DWITH_CURL=1 -DWITH_JS=1 -DWITH_TAGLIB=1 -DWITH_AVCODEC=1 -DWITH_EXIF=1 -DWITH_SYSTEMD=0 -DWITH_INOTIFY=0 -DCMAKE_CXX_FLAGS Last 15 lines from /Users/james/Library/Logs/Homebrew/gerbera/01.cmake: -- Looking for BSD native UUID -- Looking for libuuid -- Looking for libuuid - found -- Found libuuid: TRUE
-- Looking for native LFS support -- Looking for native LFS support - found -- Found LFS: TRUE

-- Found pupnp: /usr/local/lib/libupnp.dylib (found suitable version "1.14.0", minimum required is "1.12.1") CMake Error at CMakeLists.txt:312 (message): Gerbera requires libupnp with IPv6 support.

-- Configuring incomplete, errors occurred! See also "/tmp/gerbera-20200915-8883-a4i3oo/gerbera-1.6.1/build/CMakeFiles/CMakeOutput.log". See also "/tmp/gerbera-20200915-8883-a4i3oo/gerbera-1.6.1/build/CMakeFiles/CMakeError.log".

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core): https://github.com/gerbera/homebrew-gerbera/issues

Libupnp was installed by Homebrew and has IPv6 support

/usr/local/Cellar/libupnp/1.14.0/include/upnp/upnpconfig.h contains

/** Defined to 1 if the library has been compiled with ipv6 support

/** Defined to 1 if the library has been compiled bind the miniserver socket

It looks like CMake checks the wrong variable here when building Gerbera

https://github.com/gerbera/gerbera/blob/master/CMakeLists.txt#L326

if (NOT UPNP_HAS_IPV6) or if (UPNP_ENABLE_IPV6)

I'm not sure how to fix this so it's an OR check.

Can someone help me?

whyman commented 4 years ago

Hi,

Thanks for reporting, you are right, that CMake does look incorrect.

falloutphil commented 4 years ago

Confirmed - I see the same issue upgrading in homebrew from 1.4.0 -> 1.6.1 today.

I build libupnp manually and expressly enabled IPv6 (--enable-ipv6) - and I still got the same message despite it picking up my new version:

-- Found pupnp: /usr/local/lib/libupnp.dylib (found suitable version "1.14.0", minimum required is "1.12.1") CMake Error at CMakeLists.txt:312 (message): Gerbera requires libupnp with IPv6 support.

Here's a hacky workaround until it's fixed properly:

Built libupnp manual with: ./configure --enable-reuseaddr --enable-ipv6

Installed dependencies which don't seem to be implicitly picked-up: brew install spdlog pugixml

Copy the local copy of the tar file: cp /Users/yourusername/Library/Caches/Homebrew/downloads/somelonghexnumber--gerbera-1.6.1.tar.gz /some/place

Explode the tar, and edit the CmakeLists.txt - comment out the error.

message(FATAL_ERROR "Gerbera requires libupnp with IPv6 support.")

Tar up the result using exactly the same filename for the tar.

Try to install to get the new returned sha: brew install gerbera

Edit the sha after tweaking the CMakeLists.txt: brew edit gerbera

Try to install again - this time it should work!

At runtime I then had to recreate the config (command line switch) - to ensure things like the old verison webroot element was replaced with the correct version.

It would then execute fine. I still have some issues using '-e en0', but it will bind to other networks OK on my system, so I assume this is just something to do with my setup - I'll reply back if I think otherwise.

2020-09-27 20:30:37 error: LibUPnP could not bind to socket. 2020-09-27 20:30:37 info: Please check if another instance of Gerbera or 2020-09-27 20:30:37 info: another application is running on port TCP 0 or UDP 1900. 2020-09-27 20:30:37 error: UpnpUnRegisterClient failed (-116) 2020-09-27 20:30:37 error: UpnpUnRegisterRootDevice failed (-116)

EDIT

The above "bind to socket" issue was fixed by using libupnp 1.12.1 rather than 1.14.0 - so this may be worth considering if using the homebrew default versions if others report the same issue I am seeing.

Hope this helps....

One last note - I went has far as hacking the homebrew lib and include directories for it's install of libupnp - I don't think this is necessary because cmake should find your version anyway, and the above post suggests the brew version is configured correctly anyway. This is easy enough to do if neccessary - just copy the relevent files from /usr/local/lib and /usr/local/include/upnp into the /usr/local/opt/ locations of homebrew.

froodster commented 3 years ago

I'm kind of stuck at the configure libupnp step. The download in the brew cache does not include a configure executable so I can't run ./configure

whyman commented 3 years ago

My assumption is that we are not actually locating the header we need to check correctly.

Can someone upload the cmake logs from a failed build?

whyman commented 3 years ago

Please try with 1.7.0 :+1: