mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 04:58:01 +00:00
tic-80: unstable-2022-10-06 -> unstable-2023-07-18
This commit is contained in:
parent
e42daf3404
commit
9ce500bd01
@ -1,55 +0,0 @@
|
|||||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
||||||
index 964a44d..3ae22ad 100644
|
|
||||||
--- a/CMakeLists.txt
|
|
||||||
+++ b/CMakeLists.txt
|
|
||||||
@@ -262,13 +262,13 @@ message("BUILD_WITH_MRUBY: ${BUILD_WITH_MRUBY}")
|
|
||||||
|
|
||||||
if(BUILD_WITH_MRUBY)
|
|
||||||
set(MRUBY_BUILDDIR ${CMAKE_SOURCE_DIR}/build/mruby)
|
|
||||||
- set(MRUBY_DIR ${THIRDPARTY_DIR}/mruby)
|
|
||||||
+ set(MRUBY_DIR @mruby@)
|
|
||||||
if(ANDROID)
|
|
||||||
set(MRUBY_CONFIG ${MRUBY_BUILDDIR}/tic_android.rb)
|
|
||||||
else()
|
|
||||||
set(MRUBY_CONFIG ${MRUBY_BUILDDIR}/tic_default.rb)
|
|
||||||
endif()
|
|
||||||
- set(MRUBY_LIB ${MRUBY_DIR}/build/target/lib/libmruby.a)
|
|
||||||
+ set(MRUBY_LIB ${MRUBY_DIR}/lib/libmruby.a)
|
|
||||||
|
|
||||||
if(MSVC)
|
|
||||||
set(MRUBY_TOOLCHAIN visualcpp)
|
|
||||||
@@ -286,26 +286,6 @@ if(BUILD_WITH_MRUBY)
|
|
||||||
set(MRUBY_RAKE_EXTRA_OPTS "${MRUBY_RAKE_EXTRA_OPTS} ANDROID_NDK_HOME=${ANDROID_NDK_HOME}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
- ExternalProject_Add(mruby_vendor
|
|
||||||
- SOURCE_DIR ${MRUBY_DIR}
|
|
||||||
- CONFIGURE_COMMAND ""
|
|
||||||
- BUILD_IN_SOURCE TRUE
|
|
||||||
- BUILD_COMMAND
|
|
||||||
- ${RAKE} clean all "MRUBY_CONFIG=${MRUBY_CONFIG}"
|
|
||||||
- "TARGET_CC=\"${CMAKE_C_COMPILER}\""
|
|
||||||
- "TARGET_AR=\"${CMAKE_AR}\""
|
|
||||||
- "TARGET_CFLAGS=${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${BUILD_TYPE_UC}}"
|
|
||||||
- "TARGET_LDFLAGS=${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_LINKER_FLAGS_${BUILD_TYPE_UC}}"
|
|
||||||
- "BUILD_TYPE=${BUILD_TYPE_UC}"
|
|
||||||
- "MRUBY_SYSROOT=${MRUBY_SYSROOT}"
|
|
||||||
- "MRUBY_TOOLCHAIN=${MRUBY_TOOLCHAIN}"
|
|
||||||
- "ANDROID_ARCH=${CMAKE_ANDROID_ARCH_ABI}"
|
|
||||||
- "ANDROID_PLATFORM=android-${CMAKE_SYSTEM_VERSION}"
|
|
||||||
- ${MRUBY_RAKE_EXTRA_OPTS}
|
|
||||||
- INSTALL_COMMAND ""
|
|
||||||
- BUILD_BYPRODUCTS ${MRUBY_LIB}
|
|
||||||
- )
|
|
||||||
-
|
|
||||||
add_library(mruby STATIC IMPORTED GLOBAL)
|
|
||||||
set_property(TARGET mruby APPEND
|
|
||||||
PROPERTY IMPORTED_LOCATION ${MRUBY_LIB}
|
|
||||||
@@ -313,7 +293,6 @@ if(BUILD_WITH_MRUBY)
|
|
||||||
set_property(TARGET mruby APPEND
|
|
||||||
PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${MRUBY_DIR}/include
|
|
||||||
)
|
|
||||||
- add_dependencies(mruby mruby_vendor)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
################################
|
|
@ -4,6 +4,7 @@
|
|||||||
{ stdenv
|
{ stdenv
|
||||||
, lib
|
, lib
|
||||||
, SDL2
|
, SDL2
|
||||||
|
, SDL2_sound
|
||||||
, alsaLib
|
, alsaLib
|
||||||
, cmake
|
, cmake
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
@ -13,49 +14,51 @@
|
|||||||
, dbus
|
, dbus
|
||||||
, libGLU
|
, libGLU
|
||||||
, libX11
|
, libX11
|
||||||
, libstdcxx5
|
|
||||||
, libglvnd
|
, libglvnd
|
||||||
, libsamplerate
|
, libsamplerate
|
||||||
, mesa
|
, mesa
|
||||||
, pkg-config
|
, pkg-config
|
||||||
, sndio
|
, sndio
|
||||||
, valgrind
|
|
||||||
, zlib
|
, zlib
|
||||||
|
|
||||||
, pulseaudioSupport ? stdenv.isLinux
|
, pulseaudioSupport ? stdenv.isLinux
|
||||||
, libpulseaudio
|
, libpulseaudio
|
||||||
|
|
||||||
, waylandSupport ? true
|
, waylandSupport ? true
|
||||||
, wayland
|
, wayland
|
||||||
, libxkbcommon
|
, libxkbcommon
|
||||||
|
, libdecor
|
||||||
|
|
||||||
, esoundSupport ? true
|
, esoundSupport ? true
|
||||||
, espeak
|
, espeak
|
||||||
|
|
||||||
, jackSupport ? true
|
, jackSupport ? true
|
||||||
, jack2
|
, jack2
|
||||||
|
|
||||||
|
# Ruby support requires compiling mruby so we'll skip it for now.
|
||||||
, rubySupport ? false
|
, rubySupport ? false
|
||||||
, mruby
|
, ruby
|
||||||
, rake
|
, rake
|
||||||
|
|
||||||
|
, pythonSupport ? true
|
||||||
|
, python3
|
||||||
|
|
||||||
|
, withPro ? true
|
||||||
}:
|
}:
|
||||||
|
|
||||||
# TODO: Fix the timestamp in the help section.
|
# TODO: Fix the timestamp in the help section.
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "tic-80";
|
pname = "tic-80";
|
||||||
version = "unstable-2022-10-26";
|
version = "unstable-2023-07-18";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "nesbox";
|
owner = "nesbox";
|
||||||
repo = "TIC-80";
|
repo = "TIC-80";
|
||||||
rev = "7f4ad780d75d2cd8446f856f85ba293af70530eb";
|
rev = "68b94ee596e1ac218b8b9685fd0485c7ee8d2f18";
|
||||||
sha256 = "sha256-8ciBya9ismBQ27JFQr3Qsk72UvHA1vMEExSwGNk3iOk=";
|
hash = "sha256-S3LYuRRFMZYl6dENrV21bowzo7smm+zSHXt77/83oL0=";
|
||||||
fetchSubmodules = true;
|
fetchSubmodules = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# We're only replacing 'mruby' since it will have the most complications to
|
|
||||||
# build. Also, it uses the same version as the nixpkgs version as of
|
|
||||||
# 2021-12-18 which is v3.0.0.
|
|
||||||
patches = [ ./change-cmake.patch ];
|
|
||||||
postPatch = ''
|
|
||||||
substituteInPlace CMakeLists.txt --replace '@mruby@' "${mruby}"
|
|
||||||
'';
|
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake pkg-config ];
|
nativeBuildInputs = [ cmake pkg-config ];
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
alsaLib
|
alsaLib
|
||||||
@ -67,20 +70,25 @@ stdenv.mkDerivation rec {
|
|||||||
mesa
|
mesa
|
||||||
git
|
git
|
||||||
SDL2
|
SDL2
|
||||||
|
SDL2_sound
|
||||||
zlib
|
zlib
|
||||||
mruby
|
|
||||||
rake
|
|
||||||
valgrind
|
|
||||||
sndio
|
sndio
|
||||||
] ++ lib.optional pulseaudioSupport libpulseaudio
|
]
|
||||||
++ lib.optional jackSupport jack2 ++ lib.optional esoundSupport espeak
|
++ lib.optional pulseaudioSupport libpulseaudio
|
||||||
|
++ lib.optional jackSupport jack2
|
||||||
|
++ lib.optional esoundSupport espeak
|
||||||
|
++ lib.optionals rubySupport [
|
||||||
|
ruby
|
||||||
|
rake
|
||||||
|
]
|
||||||
|
++ lib.optional pythonSupport python3
|
||||||
++ lib.optionals (stdenv.isLinux && waylandSupport) [
|
++ lib.optionals (stdenv.isLinux && waylandSupport) [
|
||||||
wayland
|
wayland
|
||||||
libxkbcommon
|
libxkbcommon
|
||||||
|
libdecor
|
||||||
];
|
];
|
||||||
|
|
||||||
# TODO: Replace SOKOL-built version with SDL.
|
cmakeFlags = lib.optional withPro "-DBUILD_PRO=ON";
|
||||||
cmakeFlags = [ "-DBUILD_PRO=ON" ];
|
|
||||||
|
|
||||||
# Export all of the TIC-80-related utilities.
|
# Export all of the TIC-80-related utilities.
|
||||||
outputs = [ "out" "dev" ];
|
outputs = [ "out" "dev" ];
|
||||||
@ -91,7 +99,6 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
mkdir -p $out/share/tic80
|
mkdir -p $out/share/tic80
|
||||||
cp -r ../demos $out/share/tic80/
|
cp -r ../demos $out/share/tic80/
|
||||||
patchelf --set-rpath ${lib.makeLibraryPath [ libstdcxx5 libX11 dbus ]} $out/bin/tic80
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
|
Loading…
Reference in New Issue
Block a user