From 260de2ef60a305f40a4874c5568b3b760de49c93 Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Thu, 15 Dec 2022 20:29:19 +1000 Subject: [PATCH] add tic-80 to curve --- hosts/profiles/desktop/default.nix | 1 + pkgs/default.nix | 1 + pkgs/tic-80.nix | 63 ++++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 pkgs/tic-80.nix diff --git a/hosts/profiles/desktop/default.nix b/hosts/profiles/desktop/default.nix index c9341f98..6dca6dd1 100644 --- a/hosts/profiles/desktop/default.nix +++ b/hosts/profiles/desktop/default.nix @@ -90,6 +90,7 @@ in calendar-cli wyrd tex + tic-80 ]; diff --git a/pkgs/default.nix b/pkgs/default.nix index 245429de..925d0f4b 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -3,4 +3,5 @@ { pkgs ? (import ../nixpkgs.nix) { } }: { plymouth-themes = pkgs.callPackage ./plymouth.nix { }; + tic-80 = pkgs.callPackage ./tic-80.nix { }; } diff --git a/pkgs/tic-80.nix b/pkgs/tic-80.nix new file mode 100644 index 00000000..1ef148eb --- /dev/null +++ b/pkgs/tic-80.nix @@ -0,0 +1,63 @@ +# Stolen from: https://gist.github.com/jjwatt/c83c02e6903c8ffaf546fe5eb27e7d25?permalink_comment_id=3305141#gistcomment-3305141 +{ pkgs, ... }: +stdenv.mkDerivation rec { + name = "tic-80"; + src = builtins.fetchGit { + fetchSubmodules = true; + url = "https://github.com/nesbox/TIC-80"; + rev = "0feb848378fc40d16aaa609ed7a2148d7a064ac4"; + sha256 = "12fl9wfc1577rmzcll50r3hq582010bpwd3yi15ji2vadc2q1w9l"; + }; + buildInputs = with pkgs; [ + gcc + pkgconfig + autoconf + automake + libtool + pcre + gnumake + SDL2 + SDL2_gfx + SDL_image + SDL2_ttf + SDL2_mixer + harfbuzz + curl + gtk3 + gtk3-x11 + cmake + cmakeCurses + elementary-cmake-modules + extra-cmake-modules + libglvnd + mesa_glu + mesa_glu + freeglut + alsaLib + ]; + + configurePhase = '' + echo [DIRECTORY] $(pwd) + sed -i 's/BUILD_PRO "Build PRO version" FALSE/BUILD_PRO "Build PRO version" TRUE/' CMakeLists.txt + cd build/ + cmake .. + ''; + + buildPhase = '' + make -j4 + ''; + + installPhase = '' + mkdir -p $out/bin + chmod a+x bin/tic80 + cp -v bin/tic80 $out/bin + ''; + + tic80Item = makeDesktopItem { + name = "TIC-80"; + exec = "tic80"; + comment = "Tiny Computer"; + categories = "Development;Game"; + desktopName = "TIC-80"; + }; +}