tic-80: unstable-2022-10-06 -> unstable-2023-07-18

This commit is contained in:
Gabriel Arazas 2023-07-19 07:42:01 +08:00
parent e42daf3404
commit 9ce500bd01
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
2 changed files with 29 additions and 77 deletions

View File

@ -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()
################################

View File

@ -4,6 +4,7 @@
{ stdenv
, lib
, SDL2
, SDL2_sound
, alsaLib
, cmake
, fetchFromGitHub
@ -13,49 +14,51 @@
, dbus
, libGLU
, libX11
, libstdcxx5
, libglvnd
, libsamplerate
, mesa
, pkg-config
, sndio
, valgrind
, zlib
, pulseaudioSupport ? stdenv.isLinux
, libpulseaudio
, waylandSupport ? true
, wayland
, libxkbcommon
, libdecor
, esoundSupport ? true
, espeak
, jackSupport ? true
, jack2
# Ruby support requires compiling mruby so we'll skip it for now.
, rubySupport ? false
, mruby
, ruby
, rake
, pythonSupport ? true
, python3
, withPro ? true
}:
# TODO: Fix the timestamp in the help section.
stdenv.mkDerivation rec {
pname = "tic-80";
version = "unstable-2022-10-26";
version = "unstable-2023-07-18";
src = fetchFromGitHub {
owner = "nesbox";
repo = "TIC-80";
rev = "7f4ad780d75d2cd8446f856f85ba293af70530eb";
sha256 = "sha256-8ciBya9ismBQ27JFQr3Qsk72UvHA1vMEExSwGNk3iOk=";
rev = "68b94ee596e1ac218b8b9685fd0485c7ee8d2f18";
hash = "sha256-S3LYuRRFMZYl6dENrV21bowzo7smm+zSHXt77/83oL0=";
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 ];
buildInputs = [
alsaLib
@ -67,20 +70,25 @@ stdenv.mkDerivation rec {
mesa
git
SDL2
SDL2_sound
zlib
mruby
rake
valgrind
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) [
wayland
libxkbcommon
libdecor
];
# TODO: Replace SOKOL-built version with SDL.
cmakeFlags = [ "-DBUILD_PRO=ON" ];
cmakeFlags = lib.optional withPro "-DBUILD_PRO=ON";
# Export all of the TIC-80-related utilities.
outputs = [ "out" "dev" ];
@ -91,7 +99,6 @@ stdenv.mkDerivation rec {
mkdir -p $out/share/tic80
cp -r ../demos $out/share/tic80/
patchelf --set-rpath ${lib.makeLibraryPath [ libstdcxx5 libX11 dbus ]} $out/bin/tic80
'';
meta = with lib; {