diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2020-11-04 13:00:33 +0100 |
---|---|---|
committer | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2020-11-04 13:00:33 +0100 |
commit | 6d8a9bc6258a850a73c4709e0e9d372eb75277e1 (patch) | |
tree | 8c9e7359632a852883a2b224facbcd1008957185 /pkgs | |
parent | 36f1ace92b2165a7db8df76db944335440c5b129 (diff) | |
download | pnpkgs-6d8a9bc6258a850a73c4709e0e9d372eb75277e1.tar.gz pnpkgs-6d8a9bc6258a850a73c4709e0e9d372eb75277e1.zip |
Add voidrice update script
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/hyperion-rpi3/default.nix | 83 | ||||
-rw-r--r-- | pkgs/hyperion-rpi3/prebuilt.nix | 22 | ||||
-rw-r--r-- | pkgs/voidrice.json | 4 | ||||
-rw-r--r-- | pkgs/voidrice.nix | 9 |
4 files changed, 101 insertions, 17 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/"; + }; +} diff --git a/pkgs/voidrice.json b/pkgs/voidrice.json new file mode 100644 index 0000000..d1112ad --- /dev/null +++ b/pkgs/voidrice.json @@ -0,0 +1,4 @@ +{ + "rev": "a801ddcbfcf1c0fd01a0c06975571e56c51b077b", + "sha256": "0gjzfsmpnnb4vbcbgwx0g2z240zz9kckns1j109lfc0kq0xi93zw" +} diff --git a/pkgs/voidrice.nix b/pkgs/voidrice.nix index 9acf6c2..d4611a0 100644 --- a/pkgs/voidrice.nix +++ b/pkgs/voidrice.nix @@ -1,7 +1,10 @@ { pkgs ? import <nixpkgs> }: - +with builtins; +let + specs = fromJSON (readFile ./voidrice.json); +in pkgs.fetchgit { url = "https://github.com/LukeSmithxyz/voidrice"; - rev = "b768fc601e9b587aa800cd0656a8eee170bd1c93"; - sha256 = "1i35n0qfh0llfg1b8la9yj7qsycwlmipgfp6k1yz9r27gjll768z"; + rev = specs.rev; + sha256 = specs.sha256; } |