···99 fetchFromGitHub,1010 libGL,1111 libGLU,1212- alsa-lib,1312 libX11,1414- libICE,1515- libXi,1616- libXScrnSaver,1717- libXcursor,1818- libXinerama,1919- libXext,2020- libXxf86vm,2121- libXrandr,2222- libxkbcommon,2323- wayland,2424- wayland-protocols,2525- wayland-scanner,2626- dbus,2727- udev,2828- libdecor,2929- pipewire,3030- libpulseaudio,1313+ janet,1414+ lua5_3,1515+ quickjs,1616+ SDL2,3117 # Whether to build TIC-80's "Pro" version, which is an incentive to support the project financially,3218 # that enables some additional features. It is, however, fully open source.3319 withPro ? false,3420}:3521let3636- major = "1";3737- minor = "1";3838- revision = "2837";3939- year = "2023";2222+ # git rev-list HEAD --count2323+ revision = "3016";2424+ year = "2025";4025in41264242-stdenv.mkDerivation rec {2727+stdenv.mkDerivation {4328 pname = "tic-80";4444- version = "${major}.${minor}.${revision}";2929+ # use an untagged version until upstream tags a new version. We want3030+ # 'PREFER_SYSTEM_LIBRARIES', and without it tic-80 won't build3131+ version = "1.1-unstable-2025-05-26";45324633 src = fetchFromGitHub {4734 owner = "nesbox";4835 repo = "TIC-80";4949- rev = "v" + version;5050- hash = "sha256-p7OyuD/4KxAzylQDlXW681TvEZwKYDD4zq2KDRkcv48=";5151- # TIC-80 vendors its dependencies as submodules, so to use its current build system,5252- # we need to fetch them. Managing the dependencies ourselves would require a lot of5353- # changes in the build system, which doesn't seem worth it right now. In future versions,5454- # TIC-80 is switching to more modular CMake files, at which point we can reconsider.3636+ rev = "663d43924abf6fd7620de6bf25c009ce5b30ab83";3737+ hash = "sha256-UjBnXxYZ5gfk58sI1qek5fkKpJ7LzOVmrxdjVgONcXc=";3838+ # TIC-80 vendors its dependencies as submodules. For the following dependencies,3939+ # there are no (or no compatible) packages in nixpkgs yet, so we use the vendored4040+ # ones as a fill-in: kubazip, wasm, squirrel, pocketpy, argparse, naett,4141+ # sdlgpu, mruby.5542 fetchSubmodules = true;5643 };5744···4861 # To avoid the awkward copyright range of "2017-1980", which would be caused by the4962 # sandbox environment, hardcode the year of the release.5063 postPatch = ''5151- substituteInPlace CMakeLists.txt \6464+ substituteInPlace cmake/version.cmake \5265 --replace-fail 'set(VERSION_REVISION 0)' 'set(VERSION_REVISION ${revision})' \5366 --replace-fail 'string(TIMESTAMP VERSION_YEAR "%Y")' 'set(VERSION_YEAR "${year}")'5467 '';···5972 unset LD6073 '';61746262- cmakeFlags = lib.optionals withPro [ "-DBUILD_PRO=On" ] ++ [ "-DBUILD_SDLGPU=On" ];7575+ cmakeFlags =7676+ let7777+ enableCmakeBool = (lib.flip lib.cmakeBool) true;7878+ in7979+ [8080+ (lib.cmakeBool "BUILD_PRO" withPro)8181+ ]8282+ ++ (map enableCmakeBool [8383+ "BUILD_STATIC"8484+ "PREFER_SYSTEM_LIBRARIES"8585+ "BUILD_SDLGPU"8686+ "BUILD_WITH_ALL"8787+ ]);8888+6389 nativeBuildInputs = [6490 cmake6591 curl···8181 rake8282 ];8383 buildInputs = [8484- alsa-lib8585- dbus8686- libdecor8784 libGL8885 libGLU8989- libICE9090- libpulseaudio9186 libX119292- libXcursor9393- libXext9494- libXi9595- libXinerama9696- libxkbcommon9797- libXrandr9898- libXScrnSaver9999- libXxf86vm100100- pipewire101101- udev102102- wayland103103- wayland-protocols104104- wayland-scanner8787+ janet8888+ (lua5_3.withPackages (ps: [ ps.fennel ]))8989+ quickjs9090+ SDL210591 ];106106-107107- # This package borrows heavily from pkgs/development/libraries/SDL2/default.nix108108- # because TIC-80 vendors SDL2, which means we need to take care and implement109109- # a similar environment in TIC-80's vendored copy of SDL2.110110- #111111- # SDL is weird in that instead of just dynamically linking with112112- # libraries when you `--enable-*` (or when `configure` finds) them113113- # it `dlopen`s them at runtime. In principle, this means it can114114- # ignore any missing optional dependencies like alsa, pulseaudio,115115- # some x11 libs, wayland, etc if they are missing on the system116116- # and/or work with wide array of versions of said libraries. In117117- # nixpkgs, however, we don't need any of that. Moreover, since we118118- # don't have a global ld-cache we have to stuff all the propagated119119- # libraries into rpath by hand or else some applications that use120120- # SDL API that requires said libraries will fail to start.121121- #122122- # You can grep SDL sources with `grep -rE 'SDL_(NAME|.*_SYM)'` to123123- # list the symbols used in this way.124124- postFixup =125125- let126126- rpath = lib.makeLibraryPath buildInputs;127127- in128128- ''129129- patchelf --set-rpath "$(patchelf --print-rpath $out/bin/tic80):${rpath}" "$out/bin/tic80"130130- '';1319213293 meta = with lib; {13394 description = "Free and open source fantasy computer for making, playing and sharing tiny games";···112151 platforms = platforms.linux;113152 mainProgram = "tic80";114153 maintainers = with maintainers; [ blinry ];115115- # /build/source/vendor/sdl2/src/audio/pipewire/SDL_pipewire.c:623:37: error: passing argument 1 of 'pw_node_enum_params' from incompatible pointer type [-Wincompatible-pointer-types]116116- broken = true;117154 };118155}