jeffreywildman / homebrew-virt-manager

A set of homebrew formulae to install virt-manager and virt-viewer on MAC OSX
1.02k stars 267 forks source link

installation fails due to missing libarchive #112

Closed ssbarnea closed 5 years ago

ssbarnea commented 5 years ago

While running the installation commands, the build fails due to lack of

$ brew install virt-manager virt-viewer                                                                                                                                                             [10:12:53]
Updating Homebrew...
Ignoring path homebrew-cask/
To restore the stashed changes to /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask run:
  'cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask && git stash pop'
==> Auto-updated Homebrew!
Updated 3 taps (homebrew/core, homebrew/cask and homebrew/cask-fonts).
==> Updated Formulae
direnv ✔                  circleci                  git-standup               libhttpserver             mosquitto                 pgcli                     ps2eps                    ttyd
git ✔                     cython                    goffice                   libomp                    netdata                   pgformatter               rclone                    wcslib
libtiff ✔                 dnscrypt-proxy            helmfile                  libspectre                nghttp2                   pip-completion            rebar3                    wolfssl
openssl ✔                 docfx                     httpie                    libtcod                   nnn                       ppsspp                    redis
bgpdump                   exploitdb                 ios-webkit-debug-proxy    libwebsockets             octave                    pqiv                      rtags
bison                     fluent-bit                latex2html                macvim                    openssl@1.1               presto                    terragrunt
certigo                   ghostscript               libcouchbase              minio                     percona-server            protobuf                  topgrade

==> Installing virt-manager from jeffreywildman/virt-manager
==> Installing dependencies for jeffreywildman/virt-manager/virt-manager: libtiff, openssl, osinfo-db-tools, osinfo-db, py2cairo, ninja, meson, py3cairo, pygobject3, bdw-gc, guile, autogen, automake, lz4, opus, spice-protocol, usbredir, gstreamer, libogg, libvorbis, orc, theora, gst-plugins-base, gst-libav, flac, speex, libshout, libvpx, taglib, gst-plugins-good, faac, faad2, libmms, gst-plugins-bad, lame, x264, gst-plugins-ugly, spice-gtk and vte3
==> Installing jeffreywildman/virt-manager/virt-manager dependency: libtiff
==> Downloading https://homebrew.bintray.com/bottles/libtiff-4.0.10.mojave.bottle.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/9fc324e360e2b5fe46ce13bd97bc1a338cf08c8d60dca4241bcc8c2efcadb99a?response-content-disposition=attachment%3Bfilename%3D%22libtiff-4.0.10.mojave.bottl
######################################################################## 100.0%
==> Pouring libtiff-4.0.10.mojave.bottle.tar.gz
🍺  /usr/local/Cellar/libtiff/4.0.10: 246 files, 3.5MB
==> Installing jeffreywildman/virt-manager/virt-manager dependency: openssl
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2q.mojave.bottle.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/cdbee2befd8f2e178ff0c5f9e8796a73a7de20055aae51cba7cc749429e8c90f?response-content-disposition=attachment%3Bfilename%3D%22openssl-1.0.2q.mojave.bottl
######################################################################## 100.0%
==> Pouring openssl-1.0.2q.mojave.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
  /usr/local/etc/openssl/certs

and run
  /usr/local/opt/openssl/bin/c_rehash

openssl is keg-only, which means it was not symlinked into /usr/local,
because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.

If you need to have openssl first in your PATH run:
  echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile

For compilers to find openssl you may need to set:
  export LDFLAGS="-L/usr/local/opt/openssl/lib"
  export CPPFLAGS="-I/usr/local/opt/openssl/include"

For pkg-config to find openssl you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"

==> Summary
🍺  /usr/local/Cellar/openssl/1.0.2q: 1,794 files, 12.1MB
==> Installing jeffreywildman/virt-manager/virt-manager dependency: osinfo-db-tools
==> Downloading https://releases.pagure.org/libosinfo/osinfo-db-tools-1.2.0.tar.gz
Already downloaded: /Users/ssbarnea/Library/Caches/Homebrew/downloads/383dd91aa5e89d854b8f1413169394a9d3d417649a9e9572420451abec11e936--osinfo-db-tools-1.2.0.tar.gz
==> ./configure --disable-silent-rules --prefix=/usr/local/Cellar/osinfo-db-tools/1.2.0 --localstatedir=/usr/local/var --sysconfdir=/usr/local/etc
Last 15 lines from /Users/ssbarnea/Library/Logs/Homebrew/osinfo-db-tools/01.configure:
checking for pkg-config... /usr/local/opt/pkg-config/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for LIBXML... yes
checking for LIBXSLT... yes
checking for LIBARCHIVE... no
configure: error: Package requirements (libarchive >= 3.0.0) were not met:

No package 'libarchive' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables LIBARCHIVE_CFLAGS
and LIBARCHIVE_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

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

brew install virt-manager virt-viewer  40.83s user 16.67s system 86% cpu 1:06.56 total
FAIL: 1

I tried to install it:

$ brew install libarchive                                                                                                                                                                           [10:17:18]
Warning: libarchive 3.3.3 is already installed, it's just not linked
You can use `brew link libarchive` to link this version.
Error: /usr/local/opt/libarchive is not a valid keg
FAIL: 1

I did check and the directory was present but it was empty. Also tried

$ brew link libarchive                                                                                                                                                                              Warning: Refusing to link macOS-provided software: libarchive
If you need to have libarchive first in your PATH run:
echo 'export PATH="/usr/local/opt/libarchive/bin:$PATH"' >> ~/.bash_profile

For compilers to find libarchive you may need to set:
export LDFLAGS="-L/usr/local/opt/libarchive/lib"
export CPPFLAGS="-I/usr/local/opt/libarchive/include"

For pkg-config to find libarchive you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/libarchive/lib/pkgconfig"

Solution

I found that adding libarchive to the pkgconfig path does make it install correctly, so now we only need to alter the variable during build to avoid a bad user experience.

PKG_CONFIG_PATH= /usr/local/opt/libarchive/lib/pkgconfig:$PKG_CONFIG_PATH

On the other hand I observe that installation time takes forever which makes me wonder if it would not be more appropiate to provide a precompiled cask for it.

jeffreywildman commented 5 years ago

Your log indicates libarchive is missing when installing osinfo-db-tools. However, the osinfo-db-tools lists libarchive as a build dependency. Perhaps try to narrow down the problem by installing osinfo-db-tools separately:

brew install osinfo-db-tools