renpy: pin to python 3.12; 8.3.7.25031702 -> 8.4.1.25072401; auto update version codename (#428643)
This commit is contained in:
@@ -1,91 +0,0 @@
|
||||
From b120f82f9809b98231188daacb94f22a9e69187a Mon Sep 17 00:00:00 2001
|
||||
From: Gregor Riepl <onitake@gmail.com>
|
||||
Date: Thu, 8 Aug 2024 23:56:16 +0200
|
||||
Subject: [PATCH] Replace deprecated APIs when compiling against newer FFmpeg
|
||||
|
||||
---
|
||||
module/ffmedia.c | 37 +++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 37 insertions(+)
|
||||
|
||||
diff --git a/module/ffmedia.c b/module/ffmedia.c
|
||||
index d4bb346ac35740711b8393e66d0bfc28c849ff0e..0f57e311f277359fad731e348531becbadbb06d4 100644
|
||||
--- a/module/ffmedia.c
|
||||
+++ b/module/ffmedia.c
|
||||
@@ -71,7 +71,11 @@ static int rwops_read(void *opaque, uint8_t *buf, int buf_size) {
|
||||
|
||||
}
|
||||
|
||||
+#if (LIBAVFORMAT_VERSION_MAJOR < 61)
|
||||
static int rwops_write(void *opaque, uint8_t *buf, int buf_size) {
|
||||
+#else
|
||||
+static int rwops_write(void *opaque, const uint8_t *buf, int buf_size) {
|
||||
+#endif
|
||||
printf("Writing to an SDL_rwops is a really bad idea.\n");
|
||||
return -1;
|
||||
}
|
||||
@@ -690,9 +694,14 @@ static void decode_audio(MediaState *ms) {
|
||||
}
|
||||
|
||||
converted_frame->sample_rate = audio_sample_rate;
|
||||
+#if (LIBAVUTIL_VERSION_MAJOR < 59)
|
||||
converted_frame->channel_layout = AV_CH_LAYOUT_STEREO;
|
||||
+#else
|
||||
+ converted_frame->ch_layout = (AVChannelLayout) AV_CHANNEL_LAYOUT_STEREO;
|
||||
+#endif
|
||||
converted_frame->format = AV_SAMPLE_FMT_S16;
|
||||
|
||||
+#if (LIBAVUTIL_VERSION_MAJOR < 59)
|
||||
if (!ms->audio_decode_frame->channel_layout) {
|
||||
ms->audio_decode_frame->channel_layout = av_get_default_channel_layout(ms->audio_decode_frame->channels);
|
||||
|
||||
@@ -711,6 +720,26 @@ static void decode_audio(MediaState *ms) {
|
||||
swr_set_matrix(ms->swr, stereo_matrix, 1);
|
||||
}
|
||||
}
|
||||
+#else
|
||||
+ if (ms->audio_decode_frame->ch_layout.order == AV_CHANNEL_ORDER_UNSPEC) {
|
||||
+ av_channel_layout_default(&ms->audio_decode_frame->ch_layout, ms->audio_decode_frame->ch_layout.nb_channels);
|
||||
+
|
||||
+ if (audio_equal_mono && (ms->audio_decode_frame->ch_layout.nb_channels == 1)) {
|
||||
+ swr_alloc_set_opts2(
|
||||
+ &ms->swr,
|
||||
+ &converted_frame->ch_layout,
|
||||
+ converted_frame->format,
|
||||
+ converted_frame->sample_rate,
|
||||
+ &ms->audio_decode_frame->ch_layout,
|
||||
+ ms->audio_decode_frame->format,
|
||||
+ ms->audio_decode_frame->sample_rate,
|
||||
+ 0,
|
||||
+ NULL);
|
||||
+
|
||||
+ swr_set_matrix(ms->swr, stereo_matrix, 1);
|
||||
+ }
|
||||
+ }
|
||||
+#endif
|
||||
|
||||
if(swr_convert_frame(ms->swr, converted_frame, ms->audio_decode_frame)) {
|
||||
av_frame_free(&converted_frame);
|
||||
@@ -1159,7 +1188,11 @@ static int decode_thread(void *arg) {
|
||||
|
||||
// Compute the number of samples we need to play back.
|
||||
if (ms->audio_duration < 0) {
|
||||
+#if (LIBAVFORMAT_VERSION_MAJOR < 62)
|
||||
if (av_fmt_ctx_get_duration_estimation_method(ctx) != AVFMT_DURATION_FROM_BITRATE) {
|
||||
+#else
|
||||
+ if (ctx->duration_estimation_method != AVFMT_DURATION_FROM_BITRATE) {
|
||||
+#endif
|
||||
|
||||
long long duration = ((long long) ctx->duration) * audio_sample_rate;
|
||||
ms->audio_duration = (unsigned int) (duration / AV_TIME_BASE);
|
||||
@@ -1319,7 +1352,11 @@ static int decode_sync_start(void *arg) {
|
||||
|
||||
// Compute the number of samples we need to play back.
|
||||
if (ms->audio_duration < 0) {
|
||||
+#if (LIBAVFORMAT_VERSION_MAJOR < 62)
|
||||
if (av_fmt_ctx_get_duration_estimation_method(ctx) != AVFMT_DURATION_FROM_BITRATE) {
|
||||
+#else
|
||||
+ if (ctx->duration_estimation_method != AVFMT_DURATION_FROM_BITRATE) {
|
||||
+#endif
|
||||
|
||||
long long duration = ((long long) ctx->duration) * audio_sample_rate;
|
||||
ms->audio_duration = (unsigned int) (duration / AV_TIME_BASE);
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
assimp,
|
||||
fetchFromGitHub,
|
||||
ffmpeg,
|
||||
freetype,
|
||||
@@ -10,7 +11,6 @@
|
||||
libGLU,
|
||||
libpng,
|
||||
makeWrapper,
|
||||
nix-update-script,
|
||||
pkg-config,
|
||||
python3,
|
||||
SDL2,
|
||||
@@ -25,13 +25,13 @@ let
|
||||
in
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "renpy";
|
||||
version = "8.3.7.25031702";
|
||||
version = "8.4.1.25072401";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "renpy";
|
||||
repo = "renpy";
|
||||
tag = finalAttrs.version;
|
||||
hash = "sha256-QY6MMiagPVV+pCDM0FRD++r2fY3tD8qWmHj7fJKIxUQ=";
|
||||
hash = "sha256-wJnMqUrRGWcsuZWdqbiUI/BD2sSRjJKEzsCOzSngoZM=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
@@ -42,6 +42,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
assimp
|
||||
ffmpeg
|
||||
freetype
|
||||
fribidi
|
||||
@@ -86,7 +87,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
patches = [
|
||||
./shutup-erofs-errors.patch
|
||||
./5687.patch
|
||||
]
|
||||
++ lib.optional withoutSteam ./noSteam.patch;
|
||||
|
||||
@@ -98,20 +98,20 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
official = False
|
||||
nightly = False
|
||||
# Look at https://renpy.org/latest.html for what to put.
|
||||
version_name = '64bit Sensation'
|
||||
version_name = "Tomorrowland"
|
||||
EOF
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
${python.pythonOnBuildForHost.interpreter} module/setup.py build --parallel=$NIX_BUILD_CORES
|
||||
${python.pythonOnBuildForHost.interpreter} setup.py build --parallel=$NIX_BUILD_CORES
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
${python.pythonOnBuildForHost.interpreter} module/setup.py install_lib -d $out/${python.sitePackages}
|
||||
${python.pythonOnBuildForHost.interpreter} setup.py install_lib -d $out/${python.sitePackages}
|
||||
mkdir -p $out/share/renpy
|
||||
cp -vr sdk-fonts gui launcher renpy the_question tutorial renpy.py $out/share/renpy
|
||||
|
||||
@@ -130,7 +130,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
doInstallCheck = true;
|
||||
versionCheckProgramArg = "--version";
|
||||
|
||||
passthru.updateScript = nix-update-script { };
|
||||
passthru.updateScript = ./update.sh;
|
||||
|
||||
meta = {
|
||||
description = "Visual Novel Engine";
|
||||
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p bash nix-update html-xml-utils
|
||||
|
||||
set -ex
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
|
||||
|
||||
codename=`curl -L https://renpy.org/latest.html | hxclean | hxselect -c h1 small`
|
||||
sed -E -i "s/(version_name = ).*/\1$codename/" $SCRIPT_DIR/package.nix
|
||||
|
||||
nix-update renpy
|
||||
@@ -2309,6 +2309,8 @@ with pkgs;
|
||||
|
||||
rare = python3Packages.callPackage ../games/rare { };
|
||||
|
||||
renpy = callPackage ../by-name/re/renpy/package.nix { python3 = python312; };
|
||||
|
||||
rmview = libsForQt5.callPackage ../applications/misc/remarkable/rmview { };
|
||||
|
||||
remarkable-mouse = python3Packages.callPackage ../applications/misc/remarkable/remarkable-mouse { };
|
||||
|
||||
Reference in New Issue
Block a user