nixpkgs/pkgs/development/interpreters/renpy/default.nix

63 lines
1.6 KiB
Nix
Raw Normal View History

2019-11-13 15:32:10 +01:00
{ stdenv, fetchurl, python2Packages, pkgconfig, SDL2
2019-11-10 17:44:34 +01:00
, libpng, ffmpeg, freetype, glew, libGL, libGLU, fribidi, zlib
, glib
}:
2019-11-13 15:32:10 +01:00
with python2Packages;
stdenv.mkDerivation rec {
pname = "renpy";
version = "7.3.5";
2013-12-11 06:05:07 +01:00
meta = with stdenv.lib; {
2013-12-11 06:05:07 +01:00
description = "Ren'Py Visual Novel Engine";
2018-06-27 22:12:57 +02:00
homepage = https://renpy.org/;
license = licenses.mit;
platforms = platforms.linux;
2013-12-11 06:05:07 +01:00
};
src = fetchurl {
url = "https://www.renpy.org/dl/${version}/renpy-${version}-source.tar.bz2";
sha256 = "1anr5cfbvbsbik4v4rvrkdkciwhg700k4lydfbs4n85raimz9mw4";
};
patches = [
./launcherenv.patch
];
postPatch = ''
substituteInPlace launcher/game/choose_directory.rpy --replace /usr/bin/python ${python.interpreter}
'';
nativeBuildInputs = [ pkgconfig ];
buildInputs = [
python cython wrapPython tkinter
2019-11-10 17:44:34 +01:00
SDL2 libpng ffmpeg freetype glew libGLU libGL fribidi zlib pygame_sdl2 glib
];
pythonPath = [ pygame_sdl2 tkinter ];
2019-09-09 01:38:31 +02:00
RENPY_DEPS_INSTALL = stdenv.lib.concatStringsSep "::" (map (path: path) [
2019-11-10 17:44:34 +01:00
SDL2 SDL2.dev libpng ffmpeg ffmpeg.out freetype glew.dev glew.out libGLU libGL fribidi zlib
]);
buildPhase = ''
python module/setup.py build
'';
installPhase = ''
mkdir -p $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 \
--set PYTHONPATH $PYTHONPATH \
--set RENPY_BASE $out/share/renpy \
--add-flags "-O $out/share/renpy/renpy.py"
'';
NIX_CFLAGS_COMPILE = "-I${pygame_sdl2}/include/${python.libPrefix}";
}