Serge Bazanski | 18c1a26 | 2022-07-07 14:24:53 +0200 | [diff] [blame] | 1 | { pkgs, ... }: let |
| 2 | |
| 3 | signageForPkgs = pkgs: with { inherit (pkgs) love fetchFromGitHub stdenv curl; }; let |
| 4 | # Build LÖVE2D 12, currently still in development. This gives us https |
| 5 | # support. |
| 6 | love12 = (love.overrideAttrs (oa: { |
| 7 | version = "12.0-dev"; |
| 8 | src = fetchFromGitHub { |
| 9 | owner = "love2d"; |
| 10 | repo = "love"; |
| 11 | rev = "d586d1847446f5212d5f7e9efb94e50fcfba7d77"; |
| 12 | sha256 = "sha256-gTpVtyqXV6/GsezuCpooaY+x5tPfOF9p1b83v4kKR4E="; |
| 13 | }; |
| 14 | makeFlags = [ |
| 15 | "CPPFLAGS=-DHTTPS_BACKEND_CURL" |
| 16 | ]; |
| 17 | buildInputs = oa.buildInputs ++ [ curl ]; |
| 18 | NIX_LDFLAGS = "-lcurl"; |
| 19 | enableParallelBuilding = true; |
| 20 | })); |
| 21 | |
| 22 | signage = stdenv.mkDerivation { |
| 23 | name = "signage"; |
| 24 | src = ./.; |
| 25 | |
| 26 | installPhase = '' |
| 27 | mkdir -p $out/share/signage |
| 28 | cp -rv $src/* $out/share/signage/ |
| 29 | |
| 30 | mkdir -p $out/bin/ |
| 31 | cat <<EOF >$out/bin/signage |
| 32 | #!/usr/bin/env bash |
| 33 | ${love12}/bin/love $out/share/signage |
| 34 | EOF |
| 35 | chmod +x $out/bin/signage |
| 36 | ''; |
Piotr Dobrowolski | 8f986c1 | 2022-07-08 00:04:58 +0200 | [diff] [blame] | 37 | |
| 38 | passthru.runtime = love12; |
Serge Bazanski | 18c1a26 | 2022-07-07 14:24:53 +0200 | [diff] [blame] | 39 | }; |
| 40 | in signage; |
| 41 | |
| 42 | in { |
| 43 | prod = signageForPkgs pkgs; |
| 44 | local = signageForPkgs (import <nixpkgs> {}); |
| 45 | } |