F1ash / homebrew-qt-virt-manager

The HomeBrew formulaes for install QtVirtManager on OS X
9 stars 12 forks source link

cmake fails to create /Applications/qt5-virt-manager.app/Contents/Resources on OSX Mojave #11

Open diversys opened 3 years ago

diversys commented 3 years ago

qt5-virt-manager compiles ok but cmake fails to create /Applications/qt5-virt-manager.app/Contents/Resources probably because it's sandboxed. Any ideas?

[1282/1282] Linking CXX executable qt5-virt-manager
==> ninja install
[0/1] Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/Cellar/qt-virt-manager/0.70.91.1/share/applications/qt5-virt-manager.desktop
-- Installing: /usr/local/Cellar/qt-virt-manager/0.70.91.1/bin/qt5-virt-manager
-- Installing: /usr/local/Cellar/qt-virt-manager/0.70.91.1/share/qt5-virt-manager/misc
-- Installing: /usr/local/Cellar/qt-virt-manager/0.70.91.1/share/qt5-virt-manager/misc/network
-- Installing: /usr/local/Cellar/qt-virt-manager/0.70.91.1/share/qt5-virt-manager/misc/network/host-bridge.xml
-- Installing: /usr/local/Cellar/qt-virt-manager/0.70.91.1/share/qt5-virt-manager/misc/network/private.xml
-- Installing: /usr/local/Cellar/qt-virt-manager/0.70.91.1/share/qt5-virt-manager/misc/network/local.xml
-- Installing: /usr/local/Cellar/qt-virt-manager/0.70.91.1/share/qt5-virt-manager/misc/network/default.xml
-- Installing: /usr/local/Cellar/qt-virt-manager/0.70.91.1/share/qt5-virt-manager/misc/network/default6.xml
-- Installing: /usr/local/Cellar/qt-virt-manager/0.70.91.1/share/qt5-virt-manager/misc/domain
-- Installing: /usr/local/Cellar/qt-virt-manager/0.70.91.1/share/qt5-virt-manager/misc/domain/xen_paravirt_guest_bootloader.xml
-- Installing: /usr/local/Cellar/qt-virt-manager/0.70.91.1/share/qt5-virt-manager/misc/domain/xen_fullvirt_guest_derect-kernel_boot.xml
-- Installing: /usr/local/Cellar/qt-virt-manager/0.70.91.1/share/qt5-virt-manager/misc/domain/qemu_guest_x86_64.xml
-- Installing: /usr/local/Cellar/qt-virt-manager/0.70.91.1/share/qt5-virt-manager/misc/domain/kvm_guest_i686.xml
-- Installing: /usr/local/Cellar/qt-virt-manager/0.70.91.1/share/qt5-virt-manager/misc/domain/xen_paravirt_guest_direct-kernel_boot.xml
-- Installing: /usr/local/Cellar/qt-virt-manager/0.70.91.1/share/qt5-virt-manager/misc/domain/lxc_example2.xml
-- Installing: /usr/local/Cellar/qt-virt-manager/0.70.91.1/share/qt5-virt-manager/misc/domain/xen_fullvirt_guest_BIOS_boot.xml
-- Installing: /usr/local/Cellar/qt-virt-manager/0.70.91.1/share/qt5-virt-manager/misc/domain/lxc_example1.xml
CMake Error at cmake_install.cmake:91 (file):
  file cannot create directory:
  /Applications/qt5-virt-manager.app/Contents/Resources.  Maybe need
  administrative privileges.

FAILED: CMakeFiles/install.util
cd /tmp/qt-virt-manager-20200812-35933-cs8t04/build && /usr/local/Cellar/cmake/3.18.1/bin/cmake -P cmake_install.cmake
ninja: build stopped: subcommand failed.

==> Formula
Tap: f1ash/qt-virt-manager
Path: /usr/local/Homebrew/Library/Taps/f1ash/homebrew-qt-virt-manager/qt-virt-manager.rb
==> Configuration
HOMEBREW_VERSION: 2.4.11-32-g289a6d3
ORIGIN: https://github.com/Homebrew/brew
HEAD: 289a6d3fbfa6af0874eae7eb27ba69755b6ce031
Last commit: 6 minutes ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 9c53ffa87417fecf063cb0babf8aae25264c0ae5
Core tap last commit: 31 minutes ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.LzmaHVPjPa/org.macosforge.xquartz:0
HOMEBREW_MAKE_JOBS: 8
CPU: octa-core 64-bit ivybridge
Homebrew Ruby: 2.6.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/bin/ruby
Clang: 10.0 build 1001
Git: 2.28.0 => /usr/local/bin/git
Curl: 7.54.0 => /usr/bin/curl
Java: 13.0.1
macOS: 10.14.6-x86_64
CLT: 10.3.0.0.1.1562985497
Xcode: N/A
XQuartz: 2.7.11 => /opt/X11
==> ENV
HOMEBREW_CC: clang
HOMEBREW_CXX: clang++
MAKEFLAGS: -j8
CMAKE_PREFIX_PATH: /usr/local/opt/libffi:/usr/local/opt/openssl@1.1:/usr/local/opt/readline:/usr/local/opt/sqlite:/usr/local/opt/qt:/usr/local/opt/jpeg-turbo:/usr/local/opt/gnu-getopt:/usr/local
CMAKE_INCLUDE_PATH: /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/libxml2:/opt/X11/include:/opt/X11/include/freetype2:/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers
CMAKE_LIBRARY_PATH: /opt/X11/lib:/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
CMAKE_FRAMEWORK_PATH: /usr/local/opt/python@3.8/Frameworks:/usr/local/opt/qt/Frameworks
PKG_CONFIG_PATH: /usr/local/opt/libffi/lib/pkgconfig:/usr/local/opt/pcre/lib/pkgconfig:/usr/local/opt/openssl@1.1/lib/pkgconfig:/usr/local/opt/readline/lib/pkgconfig:/usr/local/opt/sqlite/lib/pkgconfig:/usr/local/opt/xz/lib/pkgconfig:/usr/local/opt/python@3.8/lib/pkgconfig:/usr/local/opt/glib/lib/pkgconfig:/usr/local/opt/libpng/lib/pkgconfig:/usr/local/opt/freetype/lib/pkgconfig:/usr/local/opt/fontconfig/lib/pkgconfig:/usr/local/opt/lzo/lib/pkgconfig:/usr/local/opt/pixman/lib/pkgconfig:/usr/local/opt/cairo/lib/pkgconfig:/usr/local/opt/jpeg/lib/pkgconfig:/usr/local/opt/libusb/lib/pkgconfig:/usr/local/opt/usbredir/lib/pkgconfig:/usr/local/opt/spice-client-glib2/lib/pkgconfig:/usr/local/opt/qt/lib/pkgconfig:/usr/local/opt/qtermwidget/lib/pkgconfig:/usr/local/opt/jpeg-turbo/lib/pkgconfig:/usr/local/opt/gmp/lib/pkgconfig:/usr/local/opt/libidn2/lib/pkgconfig:/usr/local/opt/libtasn1/lib/pkgconfig:/usr/local/opt/nettle/lib/pkgconfig:/usr/local/opt/p11-kit/lib/pkgconfig:/usr/local/opt/libevent/lib/pkgconfig:/usr/local/opt/unbound/lib/pkgconfig:/usr/local/opt/gnutls/lib/pkgconfig:/usr/local/opt/libgpg-error/lib/pkgconfig:/usr/local/opt/libgcrypt/lib/pkgconfig:/usr/local/opt/sdl/lib/pkgconfig:/usr/local/opt/libvnc/lib/pkgconfig:/usr/local/opt/libvirt/lib/pkgconfig:/usr/local/opt/libvirt-glib/lib/pkgconfig:/usr/local/opt/shared-mime-info/lib/pkgconfig:/usr/local/opt/spice-protocol/share/pkgconfig:/usr/local/opt/yajl/share/pkgconfig
PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/10.14:/opt/X11/lib/pkgconfig:/opt/X11/share/pkgconfig
HOMEBREW_GIT: git
HOMEBREW_SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk
ACLOCAL_PATH: /usr/local/share/aclocal:/opt/X11/share/aclocal
PATH: /usr/local/Homebrew/Library/Homebrew/shims/mac/super:/usr/local/opt/intltool/bin:/usr/local/opt/libtool/bin:/usr/local/opt/pkg-config/bin:/usr/local/opt/cmake/bin:/usr/local/opt/ninja/bin:/usr/local/opt/gettext/bin:/usr/local/opt/pcre/bin:/usr/local/opt/gdbm/bin:/usr/local/opt/openssl@1.1/bin:/usr/local/opt/sqlite/bin:/usr/local/opt/xz/bin:/usr/local/opt/python@3.8/bin:/usr/local/opt/glib/bin:/usr/local/opt/libpng/bin:/usr/local/opt/freetype/bin:/usr/local/opt/fontconfig/bin:/usr/local/opt/cairo/bin:/usr/local/opt/jpeg/bin:/usr/local/opt/spice-client-glib2/bin:/usr/local/opt/qt/bin:/usr/local/opt/jpeg-turbo/bin:/usr/local/opt/libidn2/bin:/usr/local/opt/libtasn1/bin:/usr/local/opt/nettle/bin:/usr/local/opt/p11-kit/bin:/usr/local/opt/libevent/bin:/usr/local/opt/gnutls/bin:/usr/local/opt/libgpg-error/bin:/usr/local/opt/libgcrypt/bin:/usr/local/opt/sdl/bin:/usr/local/opt/libvnc/bin:/usr/local/opt/yajl/bin:/usr/local/opt/libvirt/bin:/usr/local/opt/docbook-xsl/bin:/usr/local/opt/gnu-getopt/bin:/usr/local/opt/xmlto/bin:/usr/local/opt/shared-mime-info/bin:/opt/X11/bin:/usr/bin:/bin:/usr/sbin:/sbin

Error: f1ash/qt-virt-manager/qt-virt-manager 0.70.91.1 did not build
Logs:
     /Users/diver/Library/Logs/Homebrew/qt-virt-manager/00.options.out
     /Users/diver/Library/Logs/Homebrew/qt-virt-manager/02.ninja.cc
     /Users/diver/Library/Logs/Homebrew/qt-virt-manager/01.cmake.cc
     /Users/diver/Library/Logs/Homebrew/qt-virt-manager/01.cmake
     /Users/diver/Library/Logs/Homebrew/qt-virt-manager/02.ninja
     /Users/diver/Library/Logs/Homebrew/qt-virt-manager/03.ninja
If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
  https://github.com/f1ash/homebrew-qt-virt-manager/issues
diversys commented 3 years ago

@yurikoles maybe you have an idea what's going on here?

yurikoles commented 3 years ago

Hi @diversys

Please try args << "-DCMAKE_INSTALL_BUNDLEDIR=#{bin}" and instruct users to make a symlink to corresponding .app under ~/Applications.

diversys commented 3 years ago

@yurikoles I tried this

brew tap F1ash/homebrew-qt-virt-manager
brew install f1ash/qt-virt-manager/qt-virt-manager

With this patch:

diff --git a/qt-virt-manager.rb b/qt-virt-manager.rb
index 02d7fe1..503be22 100644
--- a/qt-virt-manager.rb
+++ b/qt-virt-manager.rb
@@ -30,12 +30,20 @@ class QtVirtManager < Formula
     args<<"-DQT5_LIB_PATH=#{Formula["qt5"].prefix}"
     args<<"-DVNC_LIB_PATH=#{Formula["libvnc"].prefix}"
     args<<"-DSPICE_LIB_PATH=#{Formula["spice-protocol"].prefix}"
+    args<<"-DCMAKE_INSTALL_BUNDLEDIR=#{bin}"
       mkdir "build" do
           system "cmake", "..", *args
           system "make", "install"
       end
   end

+  def caveats; <<-EOS.undent
+     You need to take some manual steps in order to make this formula work:
+       mkdir -p "~/Applications/KDE"
+       ln -sf "#{prefix}/bin/qt5-virt-manager.app" "~/Applications/KDE/"
+  EOS
+  end
+
   def post_install
     # manual schema compile step
     system "#{Formula["glib"].opt_bin}/glib-compile-schemas", "#{HOMEBREW_PREFIX}/share/glib-2.0/schemas"

An the build still ended with:

CMake Error at cmake_install.cmake:91 (file):
  file cannot create directory:
  /Applications/qt5-virt-manager.app/Contents/Resources.  Maybe need
  administrative privileges.
diversys commented 3 years ago

@yurikoles any other ideas what could go wrong here?

diversys commented 2 years ago

anyone?