Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing homeassistant in FreebSD 13.2 #64

Open
tehfink opened this issue Dec 4, 2023 · 1 comment
Open

Installing homeassistant in FreebSD 13.2 #64

tehfink opened this issue Dec 4, 2023 · 1 comment

Comments

@tehfink
Copy link

tehfink commented Dec 4, 2023

Thanks for keeping this plugin alive!

As of 2023-12-04, Following the directions for 13.2 here:
https://github.com/tprelog/iocage-homeassistant/wiki/autostart-and-rc-service#starting-the-service

Got a few errors on service homeassistant start :

  1. webrtc-noise-gain
2023-12-04 04:24:39.022 ERROR (SyncWorker_3) [homeassistant.util.package] Unable to install package webrtc-noise-gain==1.2.3: error: subprocess-exited-with-error
…
      ValueError: Unsupported system: freebsd
…

Looks like they're aware of it: rhasspy/webrtc-noise-gain#6 (comment)

To fix:

pkg install -y git-lite
/usr/local/share/homeassistant/bin/pip install git+https://github.com/rhasspy/webrtc-noise-gain.git
  1. ninja (required by PyTurboJPEG)
  × Building wheel for ninja (pyproject.toml) did not run successfully.
…
          self.cmake_version = get_cmake_version(self.cmake_executable)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-ko3oubqz/overlay/lib/python3.11/site-packages/skbuild/cmaker.py", line 105, in get_cmake_version
          raise SKBuildError(msg) from err
      
      Problem with the CMake installation, aborting build. CMake executable is cmake
…

To fix:

pkg install -y cmake
/usr/local/share/homeassistant/bin/pip install ninja
  1. PyAV
Unable to install package ha-av==10.1.1: error: subprocess-exited-with-error
…
      pkg-config is required for building PyAV

To fix:

pkg install pkgconf
/usr/local/share/homeassistant/bin/pip install ha-av==10.1.1
  1. Numpy 1.26.0
2023-12-04 05:54:08.936 ERROR (MainThread) [homeassistant.setup] Setup failed for stream: Requirements for stream not found: ['numpy==1.26.0'].

Looks like they're aware of it: numpy/numpy#24873 (comment)

To fix:

cd /usr/local/share/homeassistant/
git clone https://github.com/numpy/numpy.git numpy-git
cd numpy-git
git checkout v1.26.0
git cherry-pick 040ed2d
git submodule update --init
cd ..
/usr/local/share/homeassistant/bin/pip install numpy-git/
  1. Finally & hopefully without errors: service homeassistant start
@tprelog tprelog pinned this issue Dec 4, 2023
@robvanoostenrijk
Copy link

robvanoostenrijk commented Feb 9, 2024

Home Assistant now is generating a warning about Python 3.11, and the move to Python 3.12 only.

Python 3.12 is problematic on FreeBSD because of the changes in setup tools. However with the way Python is used for Home Assistant (with pip venv packages only), this does not necessarily pose a problem.

Python 3.11 can be uninstalled from pkg and Python 3.12 installed as follows:

RELEASE=3.12.2

cd /root
wget -qO- https://www.python.org/ftp/python/${RELEASE}/Python-${RELEASE}.tar.xz | tar -xJ
cd /root/Python-${RELEASE}/
./configure --disable-test-modules --enable-optimizations
make -j $(nproc)
make altinstall
rm -f -R /root/Python-${RELEASE}

This makes python3.12 available in /usr/local/bin/python3.12. Run this only in a iocage or jail on FreeBSD!
All the above steps still apply and the rc.d script works fine.

Edit: Hacky script for the whole thing:
https://gist.github.com/robvanoostenrijk/0978f3f919a540cb0b280a6978cbe8aa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants