diff options
Diffstat (limited to 'pkgs/hyperion-rpi3')
-rw-r--r-- | pkgs/hyperion-rpi3/default.nix | 83 | ||||
-rw-r--r-- | pkgs/hyperion-rpi3/prebuilt.nix | 22 |
2 files changed, 91 insertions, 14 deletions
diff --git a/pkgs/hyperion-rpi3/default.nix b/pkgs/hyperion-rpi3/default.nix index d1e8c38..5be1d46 100644 --- a/pkgs/hyperion-rpi3/default.nix +++ b/pkgs/hyperion-rpi3/default.nix @@ -1,22 +1,77 @@ -{ stdenv, fetchurl }: +{ stdenv, fetchFromGitHub, +cmake, rsync, +qt48Full, xorg, libusb1, python3, libcec, zlib }: with stdenv.lib; -stdenv.mkDerivation { - name = "hyperion-rpi3"; +let + pname = "hyperion"; + version = "1.03.2"; - src = fetchurl { - url = "https://sourceforge.net/projects/hyperion-project/files/release/hyperion_rpi3.tar.gz"; - sha256 = "04rf1q68b80pmb9m3pqmbr761hb3zpqsb7k2bjgd8x8kyw21dh6z"; + rpiFirmware = fetchFromGitHub { + owner = "raspberrypi"; + repo = "firmware"; + rev = "1.20190925"; + sha256 = "1b7y49rgfxffx95bkfhfr9cc95si1k6rgnbn71440grch6211w1v"; }; - buildPhase = ""; - installPhase = '' - mkdir -p $out - cp -r bin $out/bin - ''; + rpiTools = fetchFromGitHub { + owner = "raspberrypi"; + repo = "tools"; + rev = "4a335520900ce55e251ac4f420f52bf0b2ab6b1f"; + sha256 = "1b7y49rgfxffx95bkfhfr9cc95si1k6rgnbn71440grch6211w1v"; + }; +in +stdenv.mkDerivation { + inherit pname version; - meta = { - description = "Hyperion is an open source ambient light software. Feel free to join us and contribute new features!"; - homepage = "https://hyperion-project.org/"; + src = fetchFromGitHub { + owner = "hyperion-project"; + repo = pname; + rev = version; + sha256 = "02l8022g7g7sdw4ybwnb6dgkd6m0m731dzcqshngxbibsp0f9k0f"; + fetchSubmodules = true; }; + + nativeBuildInputs = [ cmake rsync ]; + buildInputs = [ + qt48Full + # qt4.qtbase + # qt4.qtsvg + # qt4.qtserialport + # qt4.qtx11extras + xorg.libxcb + xorg.libXrandr + xorg.libXrender + libusb1 + libcec + python3 + zlib + ]; + + buildPhase = '' +export RASCROSS_DIR="raspberrypi" +export ROOTFS_DIR="$RASCROSS_DIR/rootfs" +export HYPERION_DIR="." +export TOOLCHAIN_FILE="$HYPERION_DIR/Toolchain-RaspberryPi.cmake" + +export NATIVE_BUILD_DIR="$HYPERION_DIR/build" +export TARGET_BUILD_DIR="$HYPERION_DIR/build-rpi" + +mkdir -p "$ROOTFS_DIR" + +mkdir -p "$RASCROSS_DIR/firmware" +cp -r ${rpiFirmware} "$RASCROSS_DIR/firmware" +ln -s "$RASCROSS_DIR/firmware/hardfp/opt" "$ROOTFS_DIR/opt" + +cp -r ${rpiTools} "$RASCROSS_DIR/tools" + +mkdir -p "$NATIVE_BUILD_DIR" +cmake -DENABLE_DISPMANX=OFF --build "$NATIVE_BUILD_DIR" "$HYPERION_DIR" + +# do the cross build +# specify the protoc export file to import the protobuf compiler from the native build +mkdir -p "$TARGET_BUILD_DIR" +cmake -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE" -DIMPORT_PROTOC=$NATIVE_BUILD_DIR/protoc_export.cmake --build "$TARGET_BUILD_DIR" "$HYPERION_DIR" +''; + } diff --git a/pkgs/hyperion-rpi3/prebuilt.nix b/pkgs/hyperion-rpi3/prebuilt.nix new file mode 100644 index 0000000..d1e8c38 --- /dev/null +++ b/pkgs/hyperion-rpi3/prebuilt.nix @@ -0,0 +1,22 @@ +{ stdenv, fetchurl }: +with stdenv.lib; + +stdenv.mkDerivation { + name = "hyperion-rpi3"; + + src = fetchurl { + url = "https://sourceforge.net/projects/hyperion-project/files/release/hyperion_rpi3.tar.gz"; + sha256 = "04rf1q68b80pmb9m3pqmbr761hb3zpqsb7k2bjgd8x8kyw21dh6z"; + }; + + buildPhase = ""; + installPhase = '' + mkdir -p $out + cp -r bin $out/bin + ''; + + meta = { + description = "Hyperion is an open source ambient light software. Feel free to join us and contribute new features!"; + homepage = "https://hyperion-project.org/"; + }; +} |