craigcabrey / luminance

A Philips Hue client for Linux written in Python and GTK+.
https://craigcabrey.github.io/luminance/
GNU General Public License v2.0
155 stars 25 forks source link

Simplify installation #36

Open MichaPoe opened 5 years ago

MichaPoe commented 5 years ago

I tried to install it on my ubuntu 18.04 and 19.04 machines. But it was a bit hard. I am not a python developer so I also did not want to install all the dev tools on my machine. But I am using docker a lot so I decided to create a tiny install script being able to to all the "dirty" work there. I wanted to share this, as this might help other guys aswell. Here we go:

#/bin/sh
sudo apt install -y python3-pip
sudo pip3 install phue

mkdir /tmp/hue-luminance 2>>/dev/null
cd /tmp/hue-luminance

cat <<- EOF > Dockerfile
    FROM ubuntu:18.04
    RUN apt-get update && apt-get install -y \
        git python3-pip autoconf autogen build-essential python-gi-dev libgtk-3-dev gsettings-desktop-schemas-dev libgnome-desktop-3-dev libxml2-utils
    RUN pip3 install phue
    RUN mkdir -p /tmp/install
    WORKDIR /tmp/install
    RUN git clone https://github.com/craigcabrey/luminance.git
    WORKDIR /tmp/install/luminance
    CMD ./autogen.sh && ./configure --prefix=/usr/local && make && make install
    VOLUME /usr/local
EOF

docker build . -t hue-luminance
docker run --rm --mount type=bind,src=/usr/local,target=/usr/local hue-luminance
docker rmi hue-luminance
alexanderadam commented 4 years ago

Maybe it would be good to have an official Docker image in general at Docker Hub, GitLab or GitHub?