blob: 5909659e90a5319812680c746792127a41a598ed [file] [log] [blame]
Serge Bazanski18c1a262022-07-07 14:24:53 +02001{ 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 Dobrowolski8f986c12022-07-08 00:04:58 +020037
38 passthru.runtime = love12;
Serge Bazanski18c1a262022-07-07 14:24:53 +020039 };
40 in signage;
41
42in {
43 prod = signageForPkgs pkgs;
44 local = signageForPkgs (import <nixpkgs> {});
45}