mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 04:58:01 +00:00
tic-80: 2022-01-18 -> 2022-10-26
Though, it is not really usable. There's always time to fix it later :)
This commit is contained in:
parent
9e1f14a10b
commit
ade16bf435
@ -1,75 +1,55 @@
|
|||||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||||
index 35a60dc..43b044f 100644
|
index 964a44d..3ae22ad 100644
|
||||||
--- a/CMakeLists.txt
|
--- a/CMakeLists.txt
|
||||||
+++ b/CMakeLists.txt
|
+++ b/CMakeLists.txt
|
||||||
@@ -247,13 +247,13 @@ if(NOT RAKE)
|
@@ -262,13 +262,13 @@ message("BUILD_WITH_MRUBY: ${BUILD_WITH_MRUBY}")
|
||||||
endif()
|
|
||||||
|
|
||||||
set(MRUBY_BUILDDIR ${CMAKE_SOURCE_DIR}/build/mruby)
|
if(BUILD_WITH_MRUBY)
|
||||||
-set(MRUBY_DIR ${THIRDPARTY_DIR}/mruby)
|
set(MRUBY_BUILDDIR ${CMAKE_SOURCE_DIR}/build/mruby)
|
||||||
+set(MRUBY_DIR @mruby@)
|
- set(MRUBY_DIR ${THIRDPARTY_DIR}/mruby)
|
||||||
if(ANDROID)
|
+ set(MRUBY_DIR @mruby@)
|
||||||
set(MRUBY_CONFIG ${MRUBY_BUILDDIR}/tic_android.rb)
|
if(ANDROID)
|
||||||
else()
|
set(MRUBY_CONFIG ${MRUBY_BUILDDIR}/tic_android.rb)
|
||||||
set(MRUBY_CONFIG ${MRUBY_BUILDDIR}/tic_default.rb)
|
else()
|
||||||
endif()
|
set(MRUBY_CONFIG ${MRUBY_BUILDDIR}/tic_default.rb)
|
||||||
-set(MRUBY_LIB ${MRUBY_DIR}/build/target/lib/libmruby.a)
|
endif()
|
||||||
+set(MRUBY_LIB ${MRUBY_DIR}/lib/libmruby.a)
|
- set(MRUBY_LIB ${MRUBY_DIR}/build/target/lib/libmruby.a)
|
||||||
|
+ set(MRUBY_LIB ${MRUBY_DIR}/lib/libmruby.a)
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
set(MRUBY_TOOLCHAIN visualcpp)
|
set(MRUBY_TOOLCHAIN visualcpp)
|
||||||
@@ -271,26 +271,6 @@ if(ANDROID_NDK_HOME)
|
@@ -286,26 +286,6 @@ if(BUILD_WITH_MRUBY)
|
||||||
set(MRUBY_RAKE_EXTRA_OPTS "${MRUBY_RAKE_EXTRA_OPTS} ANDROID_NDK_HOME=${ANDROID_NDK_HOME}")
|
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}
|
|
||||||
@@ -298,7 +278,6 @@ set_property(TARGET mruby APPEND
|
|
||||||
set_property(TARGET mruby APPEND
|
|
||||||
PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${MRUBY_DIR}/include
|
|
||||||
)
|
|
||||||
-add_dependencies(mruby mruby_vendor)
|
|
||||||
|
|
||||||
################################
|
|
||||||
# SQUIRREL
|
|
||||||
@@ -1055,6 +1034,19 @@ if(BUILD_SOKOL)
|
|
||||||
target_link_options(tic80-sokol PRIVATE -static -mconsole)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
+ if(LINUX)
|
- ExternalProject_Add(mruby_vendor
|
||||||
+ configure_file("${PROJECT_SOURCE_DIR}/build/linux/tic80.desktop.in" "${PROJECT_SOURCE_DIR}/build/linux/tic80.desktop")
|
- SOURCE_DIR ${MRUBY_DIR}
|
||||||
+
|
- CONFIGURE_COMMAND ""
|
||||||
+ install(TARGETS tic80-sokol DESTINATION bin)
|
- BUILD_IN_SOURCE TRUE
|
||||||
+
|
- BUILD_COMMAND
|
||||||
+ SET(TIC80_DESKTOP_DIR "share/applications/")
|
- ${RAKE} clean all "MRUBY_CONFIG=${MRUBY_CONFIG}"
|
||||||
+ SET(TIC80_PIXMAPS_DIR "share/icons/")
|
- "TARGET_CC=\"${CMAKE_C_COMPILER}\""
|
||||||
+
|
- "TARGET_AR=\"${CMAKE_AR}\""
|
||||||
+ install (FILES ${PROJECT_SOURCE_DIR}/build/linux/tic80.desktop DESTINATION ${TIC80_DESKTOP_DIR})
|
- "TARGET_CFLAGS=${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${BUILD_TYPE_UC}}"
|
||||||
+ install (FILES ${PROJECT_SOURCE_DIR}/build/linux/tic80.xml DESTINATION ${TIC80_DESKTOP_DIR})
|
- "TARGET_LDFLAGS=${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_LINKER_FLAGS_${BUILD_TYPE_UC}}"
|
||||||
+ install (FILES ${PROJECT_SOURCE_DIR}/build/linux/tic80.png DESTINATION ${TIC80_PIXMAPS_DIR})
|
- "BUILD_TYPE=${BUILD_TYPE_UC}"
|
||||||
+ endif()
|
- "MRUBY_SYSROOT=${MRUBY_SYSROOT}"
|
||||||
+
|
- "MRUBY_TOOLCHAIN=${MRUBY_TOOLCHAIN}"
|
||||||
target_link_libraries(tic80-sokol tic80studio sokol)
|
- "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()
|
endif()
|
||||||
|
|
||||||
|
################################
|
||||||
|
@ -3,20 +3,23 @@
|
|||||||
# how.
|
# how.
|
||||||
{ stdenv
|
{ stdenv
|
||||||
, lib
|
, lib
|
||||||
|
, SDL2
|
||||||
, alsaLib
|
, alsaLib
|
||||||
, cmake
|
, cmake
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, freeglut
|
, freeglut
|
||||||
, gtk3
|
|
||||||
, libGLU
|
|
||||||
, git
|
, git
|
||||||
|
, gtk3
|
||||||
|
, dbus
|
||||||
|
, libGLU
|
||||||
|
, libX11
|
||||||
|
, libstdcxx5
|
||||||
, libglvnd
|
, libglvnd
|
||||||
, mesa
|
|
||||||
, SDL2
|
|
||||||
, pkg-config
|
|
||||||
, valgrind
|
|
||||||
, sndio
|
|
||||||
, libsamplerate
|
, libsamplerate
|
||||||
|
, mesa
|
||||||
|
, pkg-config
|
||||||
|
, sndio
|
||||||
|
, valgrind
|
||||||
, zlib
|
, zlib
|
||||||
, pulseaudioSupport ? stdenv.isLinux
|
, pulseaudioSupport ? stdenv.isLinux
|
||||||
, libpulseaudio
|
, libpulseaudio
|
||||||
@ -33,16 +36,15 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
# TODO: Fix the timestamp in the help section.
|
# TODO: Fix the timestamp in the help section.
|
||||||
# TODO: Wait for SDL v2.0.18 for more Wayland support?
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "tic-80";
|
pname = "tic-80";
|
||||||
version = "unstable-2022-01-18";
|
version = "unstable-2022-10-26";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "nesbox";
|
owner = "nesbox";
|
||||||
repo = "TIC-80";
|
repo = "TIC-80";
|
||||||
rev = "06fde1279677273856c1daf9f2fa22e337daba3d";
|
rev = "7f4ad780d75d2cd8446f856f85ba293af70530eb";
|
||||||
sha256 = "sha256-qFjcxb/umrr6CT7yorWCkoDskmKCsMm9frceyF6lXjE=";
|
sha256 = "sha256-8ciBya9ismBQ27JFQr3Qsk72UvHA1vMEExSwGNk3iOk=";
|
||||||
fetchSubmodules = true;
|
fetchSubmodules = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -78,7 +80,7 @@ stdenv.mkDerivation rec {
|
|||||||
];
|
];
|
||||||
|
|
||||||
# TODO: Replace SOKOL-built version with SDL.
|
# TODO: Replace SOKOL-built version with SDL.
|
||||||
cmakeFlags = [ "-DBUILD_PRO=ON" "-DBUILD_SDL=OFF" "-DBUILD_SOKOL=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" ];
|
||||||
@ -89,7 +91,7 @@ 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/
|
||||||
mv $out/bin/tic80{-sokol,}
|
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