1 { lib, stdenv, fetchFromGitHub, python3, pkg-config, SDL2
2 , libpng, ffmpeg, freetype, glew, libGL, libGLU, fribidi, zlib
7 # https://renpy.org/doc/html/changelog.html#versioning
8 # base_version is of the form major.minor.patch
9 # vc_version is of the form YYMMDDCC
10 # version corresponds to the tag on GitHub
11 base_version = "8.1.1";
12 vc_version = "23060707";
13 in stdenv.mkDerivation rec {
16 version = "${base_version}.${vc_version}";
18 src = fetchFromGitHub {
22 sha256 = "sha256-aJ/MobZ6SNBYRC/EpUxAMLJ3pwK6PC92DV0YL/LF5Ew=";
29 python3.pkgs.setuptools
33 SDL2 libpng ffmpeg freetype glew libGLU libGL fribidi zlib
34 ] ++ (with python3.pkgs; [
35 python pygame_sdl2 tkinter future six pefile requests ecdsa
38 RENPY_DEPS_INSTALL = lib.concatStringsSep "::" (map (path: path) [
39 SDL2 SDL2.dev libpng ffmpeg.lib freetype glew.dev libGLU libGL fribidi zlib
42 enableParallelBuilding = true;
45 ./shutup-erofs-errors.patch
49 cp tutorial/game/tutorial_director.rpy{m,}
51 cat > renpy/vc_version.py << EOF
52 version = '${version}'
55 # Look at https://renpy.org/latest.html for what to put.
56 version_name = 'Where No One Has Gone Before'
60 buildPhase = with python3.pkgs; ''
62 ${python.pythonOnBuildForHost.interpreter} module/setup.py build --parallel=$NIX_BUILD_CORES
66 installPhase = with python3.pkgs; ''
69 ${python.pythonOnBuildForHost.interpreter} module/setup.py install_lib -d $out/${python.sitePackages}
70 mkdir -p $out/share/renpy
71 cp -vr sdk-fonts gui launcher renpy the_question tutorial renpy.py $out/share/renpy
73 makeWrapper ${python.interpreter} $out/bin/renpy \
74 --set PYTHONPATH "$PYTHONPATH:$out/${python.sitePackages}" \
75 --add-flags "$out/share/renpy/renpy.py"
80 env.NIX_CFLAGS_COMPILE = with python3.pkgs; "-I${pygame_sdl2}/include/${python.libPrefix}";
83 description = "Visual Novel Engine";
84 homepage = "https://renpy.org/";
85 changelog = "https://renpy.org/doc/html/changelog.html";
86 license = licenses.mit;
87 platforms = platforms.linux;
88 maintainers = with maintainers; [ shadowrz ];
91 passthru = { inherit base_version vc_version; };