Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renpy and pygame_sdl2 update - 6.99.14 #33943

Merged
merged 3 commits into from
Mar 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 21 additions & 13 deletions pkgs/development/interpreters/renpy/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,37 @@

with pythonPackages;

stdenv.mkDerivation {
name = "renpy-6.99.12.4";
stdenv.mkDerivation rec {
name = "renpy-${version}";
version = "6.99.14";

meta = {
meta = with stdenv.lib; {
description = "Ren'Py Visual Novel Engine";
homepage = http://renpy.org/;
license = stdenv.lib.licenses.mit;
platforms = stdenv.lib.platforms.linux;
# This is an ancient version, last updated in 2014 (3d59f42ce); it fails to
# build with the most recent pygame version, and fails to run with 1.9.1.
broken = true;
license = licenses.mit;
platforms = platforms.linux;
};

src = fetchurl {
url = "http://www.renpy.org/dl/6.99.12.4/renpy-6.99.12.4-source.tar.bz2";
sha256 = "035342rr39zp7krp08z0xhcl73gqbqyilshgmljq0ynfrxxckn35";
url = "https://www.renpy.org/dl/${version}/renpy-${version}-source.tar.bz2";
sha256 = "00r1l9rd9wj8zfh279n7sak894xxhxqp3rcwg41g0md8yfiysc4h";
};

patches = [
./launcherenv.patch
];

postPatch = ''
substituteInPlace launcher/game/choose_directory.rpy --replace /usr/bin/python ${python.interpreter}
'';

nativeBuildInputs = [ pkgconfig ];
buildInputs = [
python cython wrapPython
python cython wrapPython tkinter
SDL2 libpng ffmpeg freetype glew libGLU_combined fribidi zlib pygame_sdl2 glib
];

pythonPath = [ pygame_sdl2 ];
pythonPath = [ pygame_sdl2 tkinter ];

RENPY_DEPS_INSTALL = stdenv.lib.concatStringsSep "::" (map (path: "${path}") [
SDL2 SDL2.dev libpng ffmpeg ffmpeg.out freetype glew.dev glew.out libGLU_combined fribidi zlib
Expand All @@ -41,7 +47,9 @@ stdenv.mkDerivation {

installPhase = ''
mkdir -p $out/share/renpy
cp -r renpy renpy.py $out/share/renpy
cp -vr * $out/share/renpy
rm -rf $out/share/renpy/module

python module/setup.py install --prefix=$out --install-lib=$out/share/renpy/module

makeWrapper ${python}/bin/python $out/bin/renpy \
Expand Down
14 changes: 14 additions & 0 deletions pkgs/development/interpreters/renpy/launcherenv.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# The launcher game starts projects in a separate python process
# with the -E flag, which prevents the nix set PYTHONPATH envvar
# from taking effect, preventing the loading of pygame_sdl2
--- a/launcher/game/project.rpy
+++ b/launcher/game/project.rpy
@@ -239,7 +239,7 @@
raise Exception("Python interpreter not found: %r", executables)

# Put together the basic command line.
- cmd = [ executable, "-EO", sys.argv[0] ]
+ cmd = [ executable, "-O", sys.argv[0] ]

cmd.append(self.path)
cmd.extend(args)
30 changes: 21 additions & 9 deletions pkgs/development/python-modules/pygame_sdl2/default.nix
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
{ stdenv, pkgs, buildPythonPackage, fetchFromGitHub, isPy27
{ stdenv, pkgs, buildPythonPackage, fetchurl, isPy27, fetchpatch
, cython, SDL2, SDL2_image, SDL2_ttf, SDL2_mixer, libjpeg, libpng }:

buildPythonPackage rec {
pname = "pygame_sdl2";
version = "6.99.10.1227";
name = "${pname}-${version}";

src = fetchFromGitHub {
owner = "renpy";
repo = "${pname}";
rev = "renpy-${version}";
sha256 = "10n6janvqh5adn7pcijqwqfh234sybjz788kb8ac6b4l11hy2lx1";
version = "2.1.0";
renpy_version = "6.99.14";
name = "${pname}-${version}-${renpy_version}";

src = fetchurl {
url = "https://www.renpy.org/dl/${renpy_version}/pygame_sdl2-${version}-for-renpy-${renpy_version}.tar.gz";
sha256 = "1zsnb2bivbwysgxmfg9iv12arhpf3gqkmqinhciz955hlqv016b9";
};

# force rebuild of headers needed for install
prePatch = ''
rm -rf gen gen3
'';

patches = [
# fix for recent sdl2
(fetchpatch {
url = "https://github.com/apoleon/pygame_sdl2/commit/ced6051f4a4559a725804cc58c079e1efea0a573.patch";
sha256 = "08rqjzvdlmmdf8kyd8ws5lzjy1mrwnds4fdy38inkyw7saydcxyr";
})
];

buildInputs = [
SDL2 SDL2_image SDL2_ttf SDL2_mixer
cython libjpeg libpng
Expand Down