Update to renpy-7.3.5.606

Too many changes to list, but will now run most (all?) modern commercial
and free games.
Comes with a renpyify script modelled after the fnaify script that will
enable playing commercial games.
Tested by at least pamela@, solene@; ok solene@
This commit is contained in:
bcallah 2020-03-12 17:47:08 +00:00
parent bc76f692c8
commit 3b1789c8d6
10 changed files with 739 additions and 463 deletions

View File

@ -1,12 +1,11 @@
# $OpenBSD: Makefile,v 1.14 2019/07/12 20:46:23 sthen Exp $
# $OpenBSD: Makefile,v 1.15 2020/03/12 17:47:08 bcallah Exp $
COMMENT = visual novel engine
V = 6.17.7
MODPY_EGG_VERSION = ${V}.521
V = 7.3.5
MODPY_EGG_VERSION = ${V}.606
DISTNAME = renpy-${V}-source
PKGNAME = renpy-${V}
REVISION = 3
CATEGORIES = games
@ -15,8 +14,8 @@ HOMEPAGE = https://www.renpy.org/
# mostly MIT, some files LGPLv2.1+
PERMIT_PACKAGE = Yes
WANTLIB += GLEW SDL avcodec avformat avresample avutil freetype
WANTLIB += m png pthread swscale z ${MODPY_WANTLIB}
WANTLIB += GLEW SDL2 avcodec avformat avresample avutil freetype
WANTLIB += m png pthread swresample swscale z ${MODPY_WANTLIB}
MASTER_SITES = https://www.renpy.org/dl/${V}/
EXTRACT_SUFX = .tar.bz2
@ -24,9 +23,10 @@ EXTRACT_SUFX = .tar.bz2
MODULES = lang/python
BUILD_DEPENDS = devel/pygame \
games/pygame_sdl2 \
lang/cython
RUN_DEPENDS = devel/pygame \
RUN_DEPENDS = games/pygame_sdl2 \
x11/gnome/zenity
# XXX enable fribidi support
@ -35,6 +35,8 @@ LIB_DEPENDS = graphics/ffmpeg \
MAKE_ENV = RENPY_DEPS_INSTALL=/usr::${LOCALBASE}::${X11BASE}
CFLAGS += -I/usr/X11R6/include
NO_TEST = Yes
WRKSRC = ${WRKDIST}/module
@ -45,9 +47,10 @@ MODPY_ADJ_FILES = ../renpy.py
pre-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/renpy
cd ${WRKDIST} && \
cp -r launcher renpy templates the_question tutorial LICENSE.txt \
cp -r launcher renpy the_question tutorial LICENSE.txt \
${PREFIX}/share/renpy
${INSTALL_SCRIPT} ${WRKDIST}/renpy.py ${PREFIX}/share/renpy
${SUBST_PROGRAM} ${FILESDIR}/renpy ${PREFIX}/bin/renpy
${SUBST_PROGRAM} ${FILESDIR}/renpyify ${PREFIX}/bin/renpyify
.include <bsd.port.mk>

View File

@ -1,2 +1,2 @@
SHA256 (renpy-6.17.7-source.tar.bz2) = /vAd6eSCtz2dQJ3npDutpt0+KgVJuZ3UhzBjcRkO0Dg=
SIZE (renpy-6.17.7-source.tar.bz2) = 17932988
SHA256 (renpy-7.3.5-source.tar.bz2) = hNf0a1S5IEv0cs1TMgE4D/LIZpt5Z7LJjEuvvRwr2ao=
SIZE (renpy-7.3.5-source.tar.bz2) = 68211972

View File

@ -1,3 +1,3 @@
#!/bin/sh
cd ${TRUEPREFIX}/share/renpy/ && ${MODPY_BIN} ./renpy.py "$@"
cd ${TRUEPREFIX}/share/renpy && ${MODPY_BIN} ./renpy.py "$@"

View File

@ -0,0 +1,24 @@
#!/bin/ksh
game=`pwd | xargs basename | sed -e 's,_, ,g' | cut -d - -f 1`
pyname=`ls -1 *.py | head -n 1`
printf "Ren'Py-ify $game..."
if [ ! -f $pyname ] ; then
echo "Could not find game script!"
echo "Make sure you are in the game directory, then run renpyify again."
exit 1
fi
if [ ! -d renpy ] ; then
echo "Could not find renpy directory."
echo "Make sure you are in the game directory, then run renpyify again."
exit 1
fi
mv renpy renpy-orig
cp -R ${TRUEPREFIX}/share/renpy/renpy renpy
echo " done!"
printf "Run \"python2 $pyname\" to play.\n"

View File

@ -1,14 +0,0 @@
$OpenBSD: patch-module_core_c,v 1.1 2018/04/01 09:30:18 landry Exp $
Fix build with pygame 1.9.3
Index: module/core.c
--- module/core.c.orig
+++ module/core.c
@@ -1,5 +1,6 @@
#include "renpy.h"
#include "IMG_savepng.h"
+#define PYGAME_H
#include <pygame/pygame.h>
#include <stdio.h>
#include <math.h>

View File

@ -1,102 +0,0 @@
$OpenBSD: patch-module_ffdecode_c,v 1.4 2019/02/19 23:40:49 sthen Exp $
- Fix build with pygame 1.9.3
- Update for newer FFmpeg API
Index: module/ffdecode.c
--- module/ffdecode.c.orig
+++ module/ffdecode.c
@@ -19,10 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#define NO_PYGAME_C_API
#include <pygame/pygame.h>
#include <math.h>
#include <limits.h>
#include <libavutil/avstring.h>
+#include <libavutil/time.h>
#include <libavformat/avformat.h>
#include <libavcodec/avcodec.h>
#include <libswscale/swscale.h>
@@ -101,8 +103,8 @@ typedef struct VideoState {
compensation */
#ifndef HAS_RESAMPLE
- uint8_t audio_buf1[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2] __attribute__ ((aligned (16))) ;
- uint8_t audio_buf2[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2] __attribute__ ((aligned (16))) ;
+ uint8_t audio_buf1[(192000 * 3) / 2] __attribute__ ((aligned (16))) ;
+ uint8_t audio_buf2[(192000 * 3) / 2] __attribute__ ((aligned (16))) ;
#else
uint8_t *audio_buf1;
#endif
@@ -627,13 +629,13 @@ static void alloc_picture(void *opaque, PyObject *pysu
pixel = SDL_MapRGBA(surf->format, 1, 2, 3, 4);
if (bytes[0] == 4 && bytes[1] == 1) {
- vp->fmt = PIX_FMT_ARGB;
+ vp->fmt = AV_PIX_FMT_ARGB;
} else if (bytes[0] == 4 && bytes[1] == 3) {
- vp->fmt = PIX_FMT_ABGR;
+ vp->fmt = AV_PIX_FMT_ABGR;
} else if (bytes[0] == 1) {
- vp->fmt = PIX_FMT_RGBA;
+ vp->fmt = AV_PIX_FMT_RGBA;
} else {
- vp->fmt = PIX_FMT_BGRA;
+ vp->fmt = AV_PIX_FMT_BGRA;
}
pixel = SDL_MapRGBA(surf->format, 0, 0, 0, 255);
@@ -756,7 +758,7 @@ static int video_thread(void *arg)
double pts;
for(;;) {
- frame = avcodec_alloc_frame();
+ frame = av_frame_alloc();
while (is->paused && !is->videoq.abort_request) {
SDL_Delay(2);
@@ -816,10 +818,10 @@ static int audio_decode_frame(VideoState *is, double *
int resample_changed, audio_resample;
if (!is->frame) {
- if (!(is->frame = avcodec_alloc_frame()))
+ if (!(is->frame = av_frame_alloc()))
return AVERROR(ENOMEM);
} else
- avcodec_get_frame_defaults(is->frame);
+ av_frame_unref(is->frame);
if (flush_complete)
break;
@@ -836,7 +838,7 @@ static int audio_decode_frame(VideoState *is, double *
if (!got_frame) {
/* stop sending empty packets if the decoder is finished */
- if (!pkt_temp->data && dec->codec->capabilities & CODEC_CAP_DELAY)
+ if (!pkt_temp->data && dec->codec->capabilities & AV_CODEC_CAP_DELAY)
flush_complete = 1;
continue;
}
@@ -1231,9 +1233,9 @@ static int stream_component_open(VideoState *is, int s
/* prepare audio output */
if (enc->codec_type == AVMEDIA_TYPE_AUDIO) {
if (enc->channels > 0) {
- enc->request_channels = FFMIN(2, enc->channels);
+ enc->request_channel_layout = av_get_default_channel_layout(FFMIN(2, enc->channels));
} else {
- enc->request_channels = 2;
+ enc->request_channel_layout = av_get_default_channel_layout(2);
}
}
@@ -1242,7 +1244,7 @@ static int stream_component_open(VideoState *is, int s
enc->debug = debug;
enc->workaround_bugs = workaround_bugs;
enc->idct_algo= idct;
- if(fast) enc->flags2 |= CODEC_FLAG2_FAST;
+ if(fast) enc->flags2 |= AV_CODEC_FLAG2_FAST;
enc->skip_frame= skip_frame;
enc->skip_idct= skip_idct;
enc->skip_loop_filter= skip_loop_filter;

View File

@ -1,12 +0,0 @@
$OpenBSD: patch-module_setup_py,v 1.2 2018/04/01 09:30:18 landry Exp $
Index: module/setup.py
--- module/setup.py.orig
+++ module/setup.py
@@ -72,6 +72,7 @@ include("libavformat/avformat.h")
include("libavcodec/avcodec.h")
include("libswscale/swscale.h")
include("GL/glew.h")
+include("GL/glu.h")
library("SDL")
library("png")

View File

@ -1,15 +0,0 @@
$OpenBSD: patch-module_subpixel_c,v 1.1 2018/04/01 09:30:18 landry Exp $
Fix build with pygame 1.9.3
Index: module/subpixel.c
--- module/subpixel.c.orig
+++ module/subpixel.c
@@ -7,6 +7,7 @@
*/
#include "renpy.h"
+#define NO_PYGAME_C_API
#include <pygame/pygame.h>
#include <stdio.h>
#include <math.h>

File diff suppressed because it is too large Load Diff

10
games/renpy/pkg/README Normal file
View File

@ -0,0 +1,10 @@
$OpenBSD: README,v 1.1 2020/03/12 17:47:08 bcallah Exp $
+-----------------------------------------------------------------------
| Running ${PKGSTEM} on OpenBSD
+-----------------------------------------------------------------------
Ren'Py
======
If you cannot get a game to work, try running the `renpyify` script in
the game's main directory (the one with the renpy/ subdirectory in it).