diff options
author | Alyssa Ross <hi@alyssa.is> | 2022-12-06 19:57:55 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2023-02-08 13:48:30 +0000 |
commit | bf3aadfdd39aa197e18bade671fab6726349ffa4 (patch) | |
tree | 698567af766ed441d757b57a7b21e68d4a342a2b /nixpkgs/pkgs/development/interpreters/renpy/default.nix | |
parent | f4afc5a01d9539ce09e47494e679c51f80723d07 (diff) | |
parent | 99665eb45f58d959d2cb9e49ddb960c79d596f33 (diff) | |
download | nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.gz nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.bz2 nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.lz nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.xz nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.zst nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.zip |
Merge commit '99665eb45f58d959d2cb9e49ddb960c79d596f33'
Diffstat (limited to 'nixpkgs/pkgs/development/interpreters/renpy/default.nix')
-rw-r--r-- | nixpkgs/pkgs/development/interpreters/renpy/default.nix | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/interpreters/renpy/default.nix b/nixpkgs/pkgs/development/interpreters/renpy/default.nix new file mode 100644 index 000000000000..73c95c740596 --- /dev/null +++ b/nixpkgs/pkgs/development/interpreters/renpy/default.nix @@ -0,0 +1,89 @@ +{ lib, stdenv, fetchFromGitHub, python3, pkg-config, SDL2 +, libpng, ffmpeg, freetype, glew, libGL, libGLU, fribidi, zlib +, makeWrapper +}: + +stdenv.mkDerivation rec { + pname = "renpy"; + + # https://renpy.org/doc/html/changelog.html#versioning + # base_version is of the form major.minor.patch + # vc_version is of the form YYMMDDCC + # version corresponds to the tag on GitHub + base_version = "8.0.0"; + vc_version = "22062402"; + version = "${base_version}.${vc_version}"; + + src = fetchFromGitHub { + owner = "renpy"; + repo = "renpy"; + rev = version; + sha256 = "sha256-37Hbs0i5eXMjVaETX7ImJCak0y8XtEHUaRFceA9J39A="; + }; + + nativeBuildInputs = [ + pkg-config + makeWrapper + python3.pkgs.cython + ]; + + buildInputs = [ + SDL2 libpng ffmpeg freetype glew libGLU libGL fribidi zlib + ] ++ (with python3.pkgs; [ + python pygame_sdl2 tkinter future six pefile requests + ]); + + RENPY_DEPS_INSTALL = lib.concatStringsSep "::" (map (path: path) [ + SDL2 SDL2.dev libpng ffmpeg.out freetype glew.dev libGLU libGL fribidi zlib + ]); + + enableParallelBuilding = true; + + patches = [ + ./renpy-system-fribidi.diff + ]; + + postPatch = '' + substituteInPlace module/setup.py \ + --replace "@fribidi@" "${fribidi}" + + cp tutorial/game/tutorial_director.rpy{m,} + + cat > renpy/vc_version.py << EOF + vc_version = ${vc_version} + official = False + nightly = False + EOF + ''; + + buildPhase = with python3.pkgs; '' + runHook preBuild + ${python.interpreter} module/setup.py build --parallel=$NIX_BUILD_CORES + runHook postBuild + ''; + + installPhase = with python3.pkgs; '' + runHook preInstall + + ${python.interpreter} module/setup.py install --prefix=$out + mkdir -p $out/share/renpy + cp -vr sdk-fonts gui launcher renpy the_question tutorial renpy.py $out/share/renpy + + makeWrapper ${python.interpreter} $out/bin/renpy \ + --set PYTHONPATH "$PYTHONPATH:$out/${python.sitePackages}" \ + --add-flags "-O $out/share/renpy/renpy.py" + + runHook postInstall + ''; + + NIX_CFLAGS_COMPILE = with python3.pkgs; "-I${pygame_sdl2}/include/${python.libPrefix}"; + + meta = with lib; { + description = "Visual Novel Engine"; + homepage = "https://renpy.org/"; + changelog = "https://renpy.org/doc/html/changelog.html"; + license = licenses.mit; + platforms = platforms.linux; + maintainers = with maintainers; [ shadowrz ]; + }; +} |