2021-12-18 09:34:04 +00:00
|
|
|
# Build the TIC-80 virtual computer console with the PRO version. The
|
|
|
|
# developers are kind enough to make it easy to compile it if you know
|
|
|
|
# how.
|
2022-07-16 08:45:27 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2022-10-26 09:25:52 +00:00
|
|
|
, SDL2
|
2023-07-18 23:42:01 +00:00
|
|
|
, SDL2_sound
|
2024-10-30 11:32:47 +00:00
|
|
|
, alsa-lib
|
2022-07-16 08:45:27 +00:00
|
|
|
, cmake
|
|
|
|
, fetchFromGitHub
|
|
|
|
, freeglut
|
2022-10-26 09:25:52 +00:00
|
|
|
, git
|
2022-07-16 08:45:27 +00:00
|
|
|
, gtk3
|
2022-10-26 09:25:52 +00:00
|
|
|
, dbus
|
2022-07-16 08:45:27 +00:00
|
|
|
, libGLU
|
2022-10-26 09:25:52 +00:00
|
|
|
, libX11
|
2022-07-16 08:45:27 +00:00
|
|
|
, libglvnd
|
2022-10-26 09:25:52 +00:00
|
|
|
, libsamplerate
|
2022-07-16 08:45:27 +00:00
|
|
|
, mesa
|
2022-09-28 11:12:05 +00:00
|
|
|
, pkg-config
|
2022-07-16 08:45:27 +00:00
|
|
|
, sndio
|
|
|
|
, zlib
|
2023-07-18 23:42:01 +00:00
|
|
|
|
2022-07-16 08:45:27 +00:00
|
|
|
, pulseaudioSupport ? stdenv.isLinux
|
|
|
|
, libpulseaudio
|
2023-07-18 23:42:01 +00:00
|
|
|
|
2022-07-16 08:45:27 +00:00
|
|
|
, waylandSupport ? true
|
|
|
|
, wayland
|
|
|
|
, libxkbcommon
|
2023-07-18 23:42:01 +00:00
|
|
|
, libdecor
|
|
|
|
|
2022-07-16 08:45:27 +00:00
|
|
|
, esoundSupport ? true
|
|
|
|
, espeak
|
2023-07-18 23:42:01 +00:00
|
|
|
|
2022-07-16 08:45:27 +00:00
|
|
|
, jackSupport ? true
|
|
|
|
, jack2
|
2023-07-18 23:42:01 +00:00
|
|
|
|
2023-07-19 09:27:33 +00:00
|
|
|
# Ruby support requires compiling mruby so we'll skip it for now.
|
2022-07-16 08:45:27 +00:00
|
|
|
, rubySupport ? false
|
2023-07-18 23:42:01 +00:00
|
|
|
, ruby
|
2022-07-16 08:45:27 +00:00
|
|
|
, rake
|
2023-07-18 23:42:01 +00:00
|
|
|
|
|
|
|
, pythonSupport ? true
|
|
|
|
, python3
|
|
|
|
|
|
|
|
, withPro ? true
|
2021-12-18 09:34:04 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
# TODO: Fix the timestamp in the help section.
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "tic-80";
|
2023-07-18 23:42:01 +00:00
|
|
|
version = "unstable-2023-07-18";
|
2021-12-18 09:34:04 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nesbox";
|
|
|
|
repo = "TIC-80";
|
2023-07-18 23:42:01 +00:00
|
|
|
rev = "68b94ee596e1ac218b8b9685fd0485c7ee8d2f18";
|
|
|
|
hash = "sha256-S3LYuRRFMZYl6dENrV21bowzo7smm+zSHXt77/83oL0=";
|
2021-12-18 09:34:04 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2022-09-28 11:12:05 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2021-12-18 09:34:04 +00:00
|
|
|
buildInputs = [
|
2024-10-30 11:32:47 +00:00
|
|
|
alsa-lib
|
2021-12-18 09:34:04 +00:00
|
|
|
freeglut
|
|
|
|
gtk3
|
|
|
|
libsamplerate
|
|
|
|
libGLU
|
|
|
|
libglvnd
|
|
|
|
mesa
|
|
|
|
git
|
|
|
|
SDL2
|
2023-07-18 23:42:01 +00:00
|
|
|
SDL2_sound
|
2021-12-18 09:34:04 +00:00
|
|
|
zlib
|
|
|
|
sndio
|
2023-07-18 23:42:01 +00:00
|
|
|
]
|
|
|
|
++ lib.optional pulseaudioSupport libpulseaudio
|
|
|
|
++ lib.optional jackSupport jack2
|
|
|
|
++ lib.optional esoundSupport espeak
|
|
|
|
++ lib.optionals rubySupport [
|
|
|
|
ruby
|
|
|
|
rake
|
|
|
|
]
|
|
|
|
++ lib.optional pythonSupport python3
|
2022-11-19 03:05:31 +00:00
|
|
|
++ lib.optionals (stdenv.isLinux && waylandSupport) [
|
|
|
|
wayland
|
|
|
|
libxkbcommon
|
2023-07-18 23:42:01 +00:00
|
|
|
libdecor
|
2022-11-19 03:05:31 +00:00
|
|
|
];
|
2021-12-18 09:34:04 +00:00
|
|
|
|
2023-07-18 23:42:01 +00:00
|
|
|
cmakeFlags = lib.optional withPro "-DBUILD_PRO=ON";
|
2021-12-18 09:34:04 +00:00
|
|
|
|
|
|
|
# Export all of the TIC-80-related utilities.
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
postInstall = ''
|
|
|
|
install -Dm755 bin/* -t $dev/bin
|
|
|
|
install -Dm644 lib/* -t $dev/lib
|
|
|
|
install -Dm644 ../include/* -t $dev/include
|
|
|
|
|
|
|
|
mkdir -p $out/share/tic80
|
|
|
|
cp -r ../demos $out/share/tic80/
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A fantasy computer with built-in game dev tools.";
|
|
|
|
homepage = "https://tic80.com/";
|
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|