diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 628dca8dbe36..5a1e46290878 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -11504,6 +11504,13 @@ githubId = 543055; name = "Shadaj Laddad"; }; + shadowrz = { + email = "shadowrz+nixpkgs@disroot.org"; + matrix = "@ShadowRZ:matrixim.cc"; + github = "ShadowRZ"; + githubId = 23130178; + name = "夜坂雅"; + }; shahrukh330 = { email = "shahrukh330@gmail.com"; github = "shahrukh330"; diff --git a/pkgs/development/interpreters/renpy/default.nix b/pkgs/development/interpreters/renpy/default.nix new file mode 100644 index 000000000000..73c95c740596 --- /dev/null +++ b/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 ]; + }; +} diff --git a/pkgs/development/interpreters/renpy/renpy-system-fribidi.diff b/pkgs/development/interpreters/renpy/renpy-system-fribidi.diff new file mode 100644 index 000000000000..8c93b75a7b0f --- /dev/null +++ b/pkgs/development/interpreters/renpy/renpy-system-fribidi.diff @@ -0,0 +1,51 @@ +diff --git a/module/renpybidicore.c b/module/renpybidicore.c +index 849430d..d883a52 100644 +--- a/module/renpybidicore.c ++++ b/module/renpybidicore.c +@@ -1,10 +1,6 @@ + #include + +-#ifdef RENPY_BUILD + #include +-#else +-#include +-#endif + + #include + +diff --git a/module/setup.py b/module/setup.py +index bd16816..f6b8794 100755 +--- a/module/setup.py ++++ b/module/setup.py +@@ -118,29 +118,17 @@ cython( + sdl + [ png, 'z', 'm' ]) + + FRIBIDI_SOURCES = """ +-fribidi-src/lib/fribidi.c +-fribidi-src/lib/fribidi-arabic.c +-fribidi-src/lib/fribidi-bidi.c +-fribidi-src/lib/fribidi-bidi-types.c +-fribidi-src/lib/fribidi-deprecated.c +-fribidi-src/lib/fribidi-joining.c +-fribidi-src/lib/fribidi-joining-types.c +-fribidi-src/lib/fribidi-mem.c +-fribidi-src/lib/fribidi-mirroring.c +-fribidi-src/lib/fribidi-run.c +-fribidi-src/lib/fribidi-shape.c + renpybidicore.c + """.split() + cython( + "_renpybidi", + FRIBIDI_SOURCES, ++ ["fribidi"], + includes=[ +- BASE + "/fribidi-src/", +- BASE + "/fribidi-src/lib/", ++ "@fribidi@/include/fribidi/", + ], + define_macros=[ + ("FRIBIDI_ENTRY", ""), +- ("HAVE_CONFIG_H", "1"), + ]) + + if not (android or ios or emscripten): diff --git a/pkgs/development/python-modules/pygame_sdl2/default.nix b/pkgs/development/python-modules/pygame_sdl2/default.nix index 00965b4a1495..2d0004cdfc18 100644 --- a/pkgs/development/python-modules/pygame_sdl2/default.nix +++ b/pkgs/development/python-modules/pygame_sdl2/default.nix @@ -1,15 +1,15 @@ -{ lib, buildPythonPackage, fetchurl, isPy27 +{ lib, buildPythonPackage, fetchurl, isPy27, renpy , cython, SDL2, SDL2_image, SDL2_ttf, SDL2_mixer, libjpeg, libpng }: buildPythonPackage rec { pname = "pygame_sdl2"; version = "2.1.0"; - renpy_version = "7.2.0"; + renpy_version = renpy.base_version; 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 = "1amgsb6mm8ssf7vdcs5dr8rlxrgyhh29m4i573z1cw61ynd7vgcw"; + sha256 = "sha256-iKsnmuSBzfHlIOHUwWECfvPa9LuBbCr9Kmq5dolxUlU="; }; # force rebuild of headers needed for install diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index bf0a61c3c2e8..4524288260e0 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1213,7 +1213,6 @@ mapAliases ({ redkite = throw "redkite was archived by upstream"; # Added 2021-04-12 redshift-wlr = throw "redshift-wlr has been replaced by gammastep"; # Added 2021-12-25 reicast = throw "reicast has been removed from nixpkgs as it is unmaintained, please use flycast instead"; # Added 2022-03-07 - renpy = throw "renpy has been removed from nixpkgs, it was unmaintained and the latest packaged version required python2"; # Added 2022-01-12 # 3 resholve aliases below added 2022-04-08; drop after 2022-11-30? resholvePackage = throw "resholvePackage has been renamed to resholve.mkDerivation"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6def62527ad3..6e1b5ad3625d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10071,6 +10071,8 @@ with pkgs; redsocks = callPackage ../tools/networking/redsocks { }; + renpy = callPackage ../development/interpreters/renpy { }; + rep = callPackage ../development/tools/rep { }; repseek = callPackage ../applications/science/biology/repseek { };