onscripter: init at 20230825 (#451514)

This commit is contained in:
Emily
2025-10-20 19:26:54 +00:00
committed by GitHub
7 changed files with 158 additions and 68 deletions
-66
View File
@@ -1,66 +0,0 @@
{
lib,
SDL,
SDL_image,
SDL_mixer,
SDL_ttf,
fetchFromGitHub,
freetype,
libjpeg,
libogg,
libpng,
libvorbis,
pkg-config,
smpeg,
stdenv,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "onscripter-en";
version = "20110930";
# The website is not available now. Let's use a Museoa backup
src = fetchFromGitHub {
owner = "museoa";
repo = "onscripter-en";
rev = finalAttrs.version;
hash = "sha256-Lc5ZlH2C4ER02NmQ6icfiqpzVQdVUnOmdywGjjjSYSg=";
};
nativeBuildInputs = [
SDL
pkg-config
smpeg
];
buildInputs = [
SDL
SDL_image
SDL_mixer
SDL_ttf
freetype
libjpeg
libogg
libpng
libvorbis
smpeg
];
configureFlags = [ "--no-werror" ];
strictDeps = true;
preBuild = ''
sed -i 's/.dll//g' Makefile
'';
meta = {
homepage = "https://github.com/museoa/onscripter-en";
description = "Japanese visual novel scripting engine";
license = lib.licenses.gpl2Plus;
mainProgram = "onscripter-en";
maintainers = [ ];
platforms = lib.platforms.unix;
broken = stdenv.hostPlatform.isDarwin;
};
})
@@ -0,0 +1,12 @@
diff --git a/Makefile.onscripter b/Makefile.onscripter
index 0522dd0..6eede0d 100644
--- a/Makefile.onscripter
+++ b/Makefile.onscripter
@@ -130,3 +130,7 @@ FontInfo$(OBJSUFFIX): FontInfo.h Encoding.h
DirtyRect$(OBJSUFFIX) : DirtyRect.h
AVIWrapper$(OBJSUFFIX): AVIWrapper.h
LUAHandler$(OBJSUFFIX): $(ONSCRIPTER_HEADER) LUAHandler.h
+
+.PHONY: install
+install:
+ install -Dm755 -t $(out)/bin $(TARGET)
@@ -0,0 +1,23 @@
diff --git a/Makefile.MacOSX b/Makefile.MacOSX
index 878ebf9..03f83c3 100644
--- a/Makefile.MacOSX
+++ b/Makefile.MacOSX
@@ -6,12 +6,17 @@
INCS = `sdl-config --cflags` `smpeg-config --cflags`
-LIBS = `sdl-config --libs` `smpeg-config --libs` `freetype-config --libs` -lSDL_ttf -lSDL_image -lSDL_mixer -lbz2 -lm -ljpeg -framework QuickTime -framework CoreFoundation
+LIBS = `sdl-config --libs` `smpeg-config --libs` `freetype-config --libs` -lSDL_ttf -lSDL_image -lSDL_mixer -lbz2 -lm -ljpeg
DEFS = -DMACOSX -DUSE_CDROM -DUTF8_CAPTION -DUTF8_FILESYSTEM
EXESUFFIX =
OBJSUFFIX = .o
+# optional: lua
+DEFS += -DUSE_LUA
+LIBS += -llua
+EXT_OBJS += LUAHandler$(OBJSUFFIX)
+
.SUFFIXES:
.SUFFIXES: $(OBJSUFFIX) .cpp .h
@@ -0,0 +1,23 @@
diff --git a/Makefile.Linux b/Makefile.Linux
index 2b551bd..efb1f68 100644
--- a/Makefile.Linux
+++ b/Makefile.Linux
@@ -41,17 +41,9 @@ LIBS += -logg -lvorbis -lvorbisfile
# optional: support CD audio
DEFS += -DUSE_CDROM
-# optional: avifile
-DEFS += -DUSE_AVIFILE
-INCS += `avifile-config --cflags`
-LIBS += `avifile-config --libs`
-TARGET += simple_aviplay$(EXESUFFIX)
-EXT_OBJS += AVIWrapper$(OBJSUFFIX)
-
# optional: lua
DEFS += -DUSE_LUA
-INCS += -I/usr/include/lua5.1
-LIBS += -llua5.1
+LIBS += -llua
EXT_OBJS += LUAHandler$(OBJSUFFIX)
# optional: force screen width for PDA
+97
View File
@@ -0,0 +1,97 @@
{
lib,
SDL,
SDL_image,
SDL_mixer,
SDL_ttf,
bzip2,
fetchFromGitHub,
fontconfig,
freetype,
libjpeg,
libogg,
libpng,
libvorbis,
lua5_1,
runCommand,
smpeg,
stdenv,
}:
let
inherit (stdenv.hostPlatform) isDarwin;
in
stdenv.mkDerivation (finalAttrs: {
pname = "onscripter";
version = "20230825";
src = fetchFromGitHub {
owner = "ogapee";
repo = "onscripter";
rev = finalAttrs.version;
hash = "sha256-XaZTtOkV+2dHmcgZ4GbyiMxRBYdwT5eHxx+r05eAmBw=";
};
patches = [
# Add "install" target to Makefile
./add-make-install.patch
# 1. Remove libavifile dependency, which is old and unmaintained
# 2. Replace -llua5.1 with -llua because the former didn't work even with Lua 5.1
./fix-linux-build.patch
# 1. Remove direct linker flags for macOS SDKs.
# 2. Build with Lua
#
# ONScripter appears to depend on macOS SDKs only indirectly through SDL, so flags provided by
# the sdl-config command should suffice. The existing flags also referenced the deprecated
# QuickTime framework, resulting in a build failure.
./fix-darwin-build.patch
];
nativeBuildInputs = [
# Take cross compilation into account
(
let
commands = [
"${lib.getDev SDL}/bin/sdl-config"
"${lib.getDev smpeg}/bin/smpeg-config"
]
++ lib.optionals isDarwin [
"${lib.getDev freetype}/bin/freetype-config"
];
in
runCommand "onscripter-host-deps" { } ''
mkdir -p $out/bin
ln -s ${lib.escapeShellArgs commands} $out/bin
''
)
];
buildInputs = [
SDL
SDL_image
SDL_mixer
SDL_ttf
bzip2
libjpeg
libogg
libpng
libvorbis
lua5_1
smpeg
]
++ (if isDarwin then [ freetype ] else [ fontconfig ]);
# The build script for BSDs also fall under Makefile.Linux
makefile = if isDarwin then "Makefile.MacOSX" else "Makefile.Linux";
strictDeps = true;
meta = {
homepage = "https://ogapee.github.io/www/onscripter_en.html";
description = "Japanese visual novel scripting engine";
license = lib.licenses.gpl2Plus;
mainProgram = "onscripter";
maintainers = with lib.maintainers; [ midchildan ];
platforms = lib.platforms.unix;
};
})
+2 -2
View File
@@ -11,7 +11,7 @@
smpeg,
stdenv,
# passthru.tests
onscripter-en,
onscripter,
# Boolean flags
enableNativeMidi ? false,
enableSdltest ? (!stdenv.hostPlatform.isDarwin),
@@ -108,7 +108,7 @@ stdenv.mkDerivation (finalAttrs: {
strictDeps = true;
passthru.tests = {
inherit onscripter-en;
inherit onscripter;
};
meta = {
+1
View File
@@ -1955,6 +1955,7 @@ mapAliases {
offrss = throw "offrss has been removed due to lack of upstream maintenance; consider using another rss reader"; # Added 2025-06-01
oil = lib.warnOnInstantiate "Oil has been replaced with the faster native C++ version and renamed to 'oils-for-unix'. See also https://github.com/oils-for-unix/oils/wiki/Oils-Deployments" oils-for-unix; # Added 2024-10-22
onevpl-intel-gpu = lib.warnOnInstantiate "onevpl-intel-gpu has been renamed to vpl-gpu-rt" vpl-gpu-rt; # Added 2024-06-04
onscripter-en = throw "onscripter-en has been removed due to lack of maintenance in both upstream and Nixpkgs; onscripter is available instead"; # Added 2025-10-17
onthespot = throw "onethespot has been removed due to lack of upstream maintenance"; # Added 2025-09-26
openai-triton-llvm = triton-llvm; # added 2024-07-18
openai-whisper-cpp = whisper-cpp; # Added 2024-12-13