osresearch / hcpy

Python tool to talk to Home Connect appliances over the local network (no cloud required)
276 stars 32 forks source link

MacOS install #23

Open miklosbagi opened 1 year ago

miklosbagi commented 1 year ago

Howdy,

Few things I've ran into on Mac (arm).
Added #24 in case you're happy with the proposal below:

For Mac, building sslpsk needs some extra steps

  1. The openssl package installed via brew: brew install openssl, and
  2. Build saslpsk separately with flags: LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pip3 install sslpsk
  3. You may also want to pip3 install requests
  4. Finally install the rest of the requirements with pip3 install -r requirements.txt

If all that goes to plan, we get info from hc-login as expected

Hope that helps a few folks, mb

jorritolthuis commented 11 months ago

When installing sslpsk using the command proposed here on macOS 14.1.2 (Intel), clang failed:

      Compiling with an SDK that doesn't seem to exist: /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk
      Please check your Xcode installation
      clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -I/usr/local/opt/openssl@3/include -I/Users/jorrit/Documents/Projects/home_control_py/venv/include -I/usr/local/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c sslpsk/_sslpsk.c -o build/temp.macosx-14-x86_64-cpython-311/sslpsk/_sslpsk.o
      clang: warning: no such sysroot directory: '/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk' [-Wmissing-sysroot]
      In file included from sslpsk/_sslpsk.c:17:
      /usr/local/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11/Python.h:23:12: fatal error: 'stdlib.h' file not found
      #  include <stdlib.h>
                 ^~~~~~~~~~
      1 error generated.
      error: command '/usr/bin/clang' failed with exit code 1

This issue seems to pop up on other GitHub projects as well. It is easily resolved by symlinking the Xcode SDK to where Clang is looking: ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk

If other people encounter this, it might be worth a note in the README. Otherwise, if it's just my configuration, let's ignore it.