tic-80: update to git HEAD and fix build (#414270)
This commit is contained in:
@@ -9,49 +9,36 @@
|
|||||||
fetchFromGitHub,
|
fetchFromGitHub,
|
||||||
libGL,
|
libGL,
|
||||||
libGLU,
|
libGLU,
|
||||||
alsa-lib,
|
|
||||||
libX11,
|
libX11,
|
||||||
libICE,
|
janet,
|
||||||
libXi,
|
lua5_3,
|
||||||
libXScrnSaver,
|
quickjs,
|
||||||
libXcursor,
|
SDL2,
|
||||||
libXinerama,
|
|
||||||
libXext,
|
|
||||||
libXxf86vm,
|
|
||||||
libXrandr,
|
|
||||||
libxkbcommon,
|
|
||||||
wayland,
|
|
||||||
wayland-protocols,
|
|
||||||
wayland-scanner,
|
|
||||||
dbus,
|
|
||||||
udev,
|
|
||||||
libdecor,
|
|
||||||
pipewire,
|
|
||||||
libpulseaudio,
|
|
||||||
# Whether to build TIC-80's "Pro" version, which is an incentive to support the project financially,
|
# Whether to build TIC-80's "Pro" version, which is an incentive to support the project financially,
|
||||||
# that enables some additional features. It is, however, fully open source.
|
# that enables some additional features. It is, however, fully open source.
|
||||||
withPro ? false,
|
withPro ? false,
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
major = "1";
|
# git rev-list HEAD --count
|
||||||
minor = "1";
|
revision = "3016";
|
||||||
revision = "2837";
|
year = "2025";
|
||||||
year = "2023";
|
|
||||||
in
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation {
|
||||||
pname = "tic-80";
|
pname = "tic-80";
|
||||||
version = "${major}.${minor}.${revision}";
|
# use an untagged version until upstream tags a new version. We want
|
||||||
|
# 'PREFER_SYSTEM_LIBRARIES', and without it tic-80 won't build
|
||||||
|
version = "1.1-unstable-2025-05-26";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "nesbox";
|
owner = "nesbox";
|
||||||
repo = "TIC-80";
|
repo = "TIC-80";
|
||||||
rev = "v" + version;
|
rev = "663d43924abf6fd7620de6bf25c009ce5b30ab83";
|
||||||
hash = "sha256-p7OyuD/4KxAzylQDlXW681TvEZwKYDD4zq2KDRkcv48=";
|
hash = "sha256-UjBnXxYZ5gfk58sI1qek5fkKpJ7LzOVmrxdjVgONcXc=";
|
||||||
# TIC-80 vendors its dependencies as submodules, so to use its current build system,
|
# TIC-80 vendors its dependencies as submodules. For the following dependencies,
|
||||||
# we need to fetch them. Managing the dependencies ourselves would require a lot of
|
# there are no (or no compatible) packages in nixpkgs yet, so we use the vendored
|
||||||
# changes in the build system, which doesn't seem worth it right now. In future versions,
|
# ones as a fill-in: kubazip, wasm, squirrel, pocketpy, argparse, naett,
|
||||||
# TIC-80 is switching to more modular CMake files, at which point we can reconsider.
|
# sdlgpu, mruby.
|
||||||
fetchSubmodules = true;
|
fetchSubmodules = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -61,7 +48,7 @@ stdenv.mkDerivation rec {
|
|||||||
# To avoid the awkward copyright range of "2017-1980", which would be caused by the
|
# To avoid the awkward copyright range of "2017-1980", which would be caused by the
|
||||||
# sandbox environment, hardcode the year of the release.
|
# sandbox environment, hardcode the year of the release.
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace CMakeLists.txt \
|
substituteInPlace cmake/version.cmake \
|
||||||
--replace-fail 'set(VERSION_REVISION 0)' 'set(VERSION_REVISION ${revision})' \
|
--replace-fail 'set(VERSION_REVISION 0)' 'set(VERSION_REVISION ${revision})' \
|
||||||
--replace-fail 'string(TIMESTAMP VERSION_YEAR "%Y")' 'set(VERSION_YEAR "${year}")'
|
--replace-fail 'string(TIMESTAMP VERSION_YEAR "%Y")' 'set(VERSION_YEAR "${year}")'
|
||||||
'';
|
'';
|
||||||
@@ -72,7 +59,20 @@ stdenv.mkDerivation rec {
|
|||||||
unset LD
|
unset LD
|
||||||
'';
|
'';
|
||||||
|
|
||||||
cmakeFlags = lib.optionals withPro [ "-DBUILD_PRO=On" ] ++ [ "-DBUILD_SDLGPU=On" ];
|
cmakeFlags =
|
||||||
|
let
|
||||||
|
enableCmakeBool = (lib.flip lib.cmakeBool) true;
|
||||||
|
in
|
||||||
|
[
|
||||||
|
(lib.cmakeBool "BUILD_PRO" withPro)
|
||||||
|
]
|
||||||
|
++ (map enableCmakeBool [
|
||||||
|
"BUILD_STATIC"
|
||||||
|
"PREFER_SYSTEM_LIBRARIES"
|
||||||
|
"BUILD_SDLGPU"
|
||||||
|
"BUILD_WITH_ALL"
|
||||||
|
]);
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
cmake
|
cmake
|
||||||
curl
|
curl
|
||||||
@@ -81,54 +81,15 @@ stdenv.mkDerivation rec {
|
|||||||
rake
|
rake
|
||||||
];
|
];
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
alsa-lib
|
|
||||||
dbus
|
|
||||||
libdecor
|
|
||||||
libGL
|
libGL
|
||||||
libGLU
|
libGLU
|
||||||
libICE
|
|
||||||
libpulseaudio
|
|
||||||
libX11
|
libX11
|
||||||
libXcursor
|
janet
|
||||||
libXext
|
(lua5_3.withPackages (ps: [ ps.fennel ]))
|
||||||
libXi
|
quickjs
|
||||||
libXinerama
|
SDL2
|
||||||
libxkbcommon
|
|
||||||
libXrandr
|
|
||||||
libXScrnSaver
|
|
||||||
libXxf86vm
|
|
||||||
pipewire
|
|
||||||
udev
|
|
||||||
wayland
|
|
||||||
wayland-protocols
|
|
||||||
wayland-scanner
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# This package borrows heavily from pkgs/development/libraries/SDL2/default.nix
|
|
||||||
# because TIC-80 vendors SDL2, which means we need to take care and implement
|
|
||||||
# a similar environment in TIC-80's vendored copy of SDL2.
|
|
||||||
#
|
|
||||||
# SDL is weird in that instead of just dynamically linking with
|
|
||||||
# libraries when you `--enable-*` (or when `configure` finds) them
|
|
||||||
# it `dlopen`s them at runtime. In principle, this means it can
|
|
||||||
# ignore any missing optional dependencies like alsa, pulseaudio,
|
|
||||||
# some x11 libs, wayland, etc if they are missing on the system
|
|
||||||
# and/or work with wide array of versions of said libraries. In
|
|
||||||
# nixpkgs, however, we don't need any of that. Moreover, since we
|
|
||||||
# don't have a global ld-cache we have to stuff all the propagated
|
|
||||||
# libraries into rpath by hand or else some applications that use
|
|
||||||
# SDL API that requires said libraries will fail to start.
|
|
||||||
#
|
|
||||||
# You can grep SDL sources with `grep -rE 'SDL_(NAME|.*_SYM)'` to
|
|
||||||
# list the symbols used in this way.
|
|
||||||
postFixup =
|
|
||||||
let
|
|
||||||
rpath = lib.makeLibraryPath buildInputs;
|
|
||||||
in
|
|
||||||
''
|
|
||||||
patchelf --set-rpath "$(patchelf --print-rpath $out/bin/tic80):${rpath}" "$out/bin/tic80"
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Free and open source fantasy computer for making, playing and sharing tiny games";
|
description = "Free and open source fantasy computer for making, playing and sharing tiny games";
|
||||||
longDescription = ''
|
longDescription = ''
|
||||||
@@ -151,7 +112,5 @@ stdenv.mkDerivation rec {
|
|||||||
platforms = platforms.linux;
|
platforms = platforms.linux;
|
||||||
mainProgram = "tic80";
|
mainProgram = "tic80";
|
||||||
maintainers = with maintainers; [ blinry ];
|
maintainers = with maintainers; [ blinry ];
|
||||||
# /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]
|
|
||||||
broken = true;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user