antimof / UxPlay

AirPlay Unix mirroring server
GNU General Public License v3.0
1.27k stars 177 forks source link

M1 macs openssl path #125

Open AlwynYin opened 1 year ago

AlwynYin commented 1 year ago

With Homebrew arm64, the installation path has been changed to /opt/homebrew/ instead of /usr/local

but the openssl package path in CmakeList.txt still has the old path hard coded. Changing it to /opt/homebrew fixes the problem.

A possible fix is to use homebrew --prefix to find the homebrew prefix in CmakeList.txt?

fduncanh commented 1 year ago

please repost your issue at https://github.com/FDH2/UxPlay

see https://github.com/antimof/UxPlay/issues/114

fduncanh commented 1 year ago

where exactly is openssl on M1 Macs? will this work? is there anything strange about openssl in homebrew on M1? (like the usr/local/opt/openssl@3/lib/pkgconfig location for openssl on Intel macs)?

Edit: it seems to be in /opt/homebrew/opt/openssl (found on web, only have intel mac/homebrew available)

proposed fix:


if( APPLE )
  set( ENV{PKG_CONFIG_PATH} "/usr/local/lib/pkgconfig" ) # standard location, and Brew
  set( ENV{PKG_CONFIG_PATH} "/opt/homebrew/lib/pkgconfig" ) # Brew on M1 macs
  set( ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/opt/local/lib/pkgconfig/" ) # MacPorts
  set( ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/opt/openssl@3/lib/pkgconfig" ) # Brew openssl
  set( ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/opt/hombrew/opt/openssl@3/lib/pkgconfig" ) # M1 Brew openssl
  message( "PKG_CONFIG_PATH (Apple, lib) = " $ENV{PKG_CONFIG_PATH} )
  find_program( PKG_CONFIG_EXECUTABLE  pkg-config  PATHS /Library/FrameWorks/GStreamer.framework/Commands )
  message( "PKG_CONFIG_EXECUTABLE " ${PKG_CONFIG_EXECUTABLE} )
endif()
fduncanh commented 1 year ago

Its now updated on the current UxPlay site https://github.com/FDH2/UxPlay

Please test on an M1 mac.

AlwynYin commented 1 year ago

It builds on my M1 mac. Thank you!