Merge pull request #179990 from ShadowRZ/shadowrz/renpy-8

authored by

Sandro and committed by
GitHub
e8385102 1ebd0737

+152 -4
+7
maintainers/maintainer-list.nix
··· 11504 11504 githubId = 543055; 11505 11505 name = "Shadaj Laddad"; 11506 11506 }; 11507 + shadowrz = { 11508 + email = "shadowrz+nixpkgs@disroot.org"; 11509 + matrix = "@ShadowRZ:matrixim.cc"; 11510 + github = "ShadowRZ"; 11511 + githubId = 23130178; 11512 + name = "夜坂雅"; 11513 + }; 11507 11514 shahrukh330 = { 11508 11515 email = "shahrukh330@gmail.com"; 11509 11516 github = "shahrukh330";
+89
pkgs/development/interpreters/renpy/default.nix
··· 1 + { lib, stdenv, fetchFromGitHub, python3, pkg-config, SDL2 2 + , libpng, ffmpeg, freetype, glew, libGL, libGLU, fribidi, zlib 3 + , makeWrapper 4 + }: 5 + 6 + stdenv.mkDerivation rec { 7 + pname = "renpy"; 8 + 9 + # https://renpy.org/doc/html/changelog.html#versioning 10 + # base_version is of the form major.minor.patch 11 + # vc_version is of the form YYMMDDCC 12 + # version corresponds to the tag on GitHub 13 + base_version = "8.0.0"; 14 + vc_version = "22062402"; 15 + version = "${base_version}.${vc_version}"; 16 + 17 + src = fetchFromGitHub { 18 + owner = "renpy"; 19 + repo = "renpy"; 20 + rev = version; 21 + sha256 = "sha256-37Hbs0i5eXMjVaETX7ImJCak0y8XtEHUaRFceA9J39A="; 22 + }; 23 + 24 + nativeBuildInputs = [ 25 + pkg-config 26 + makeWrapper 27 + python3.pkgs.cython 28 + ]; 29 + 30 + buildInputs = [ 31 + SDL2 libpng ffmpeg freetype glew libGLU libGL fribidi zlib 32 + ] ++ (with python3.pkgs; [ 33 + python pygame_sdl2 tkinter future six pefile requests 34 + ]); 35 + 36 + RENPY_DEPS_INSTALL = lib.concatStringsSep "::" (map (path: path) [ 37 + SDL2 SDL2.dev libpng ffmpeg.out freetype glew.dev libGLU libGL fribidi zlib 38 + ]); 39 + 40 + enableParallelBuilding = true; 41 + 42 + patches = [ 43 + ./renpy-system-fribidi.diff 44 + ]; 45 + 46 + postPatch = '' 47 + substituteInPlace module/setup.py \ 48 + --replace "@fribidi@" "${fribidi}" 49 + 50 + cp tutorial/game/tutorial_director.rpy{m,} 51 + 52 + cat > renpy/vc_version.py << EOF 53 + vc_version = ${vc_version} 54 + official = False 55 + nightly = False 56 + EOF 57 + ''; 58 + 59 + buildPhase = with python3.pkgs; '' 60 + runHook preBuild 61 + ${python.interpreter} module/setup.py build --parallel=$NIX_BUILD_CORES 62 + runHook postBuild 63 + ''; 64 + 65 + installPhase = with python3.pkgs; '' 66 + runHook preInstall 67 + 68 + ${python.interpreter} module/setup.py install --prefix=$out 69 + mkdir -p $out/share/renpy 70 + cp -vr sdk-fonts gui launcher renpy the_question tutorial renpy.py $out/share/renpy 71 + 72 + makeWrapper ${python.interpreter} $out/bin/renpy \ 73 + --set PYTHONPATH "$PYTHONPATH:$out/${python.sitePackages}" \ 74 + --add-flags "-O $out/share/renpy/renpy.py" 75 + 76 + runHook postInstall 77 + ''; 78 + 79 + NIX_CFLAGS_COMPILE = with python3.pkgs; "-I${pygame_sdl2}/include/${python.libPrefix}"; 80 + 81 + meta = with lib; { 82 + description = "Visual Novel Engine"; 83 + homepage = "https://renpy.org/"; 84 + changelog = "https://renpy.org/doc/html/changelog.html"; 85 + license = licenses.mit; 86 + platforms = platforms.linux; 87 + maintainers = with maintainers; [ shadowrz ]; 88 + }; 89 + }
+51
pkgs/development/interpreters/renpy/renpy-system-fribidi.diff
··· 1 + diff --git a/module/renpybidicore.c b/module/renpybidicore.c 2 + index 849430d..d883a52 100644 3 + --- a/module/renpybidicore.c 4 + +++ b/module/renpybidicore.c 5 + @@ -1,10 +1,6 @@ 6 + #include <Python.h> 7 + 8 + -#ifdef RENPY_BUILD 9 + #include <fribidi.h> 10 + -#else 11 + -#include <fribidi-src/lib/fribidi.h> 12 + -#endif 13 + 14 + #include <stdlib.h> 15 + 16 + diff --git a/module/setup.py b/module/setup.py 17 + index bd16816..f6b8794 100755 18 + --- a/module/setup.py 19 + +++ b/module/setup.py 20 + @@ -118,29 +118,17 @@ cython( 21 + sdl + [ png, 'z', 'm' ]) 22 + 23 + FRIBIDI_SOURCES = """ 24 + -fribidi-src/lib/fribidi.c 25 + -fribidi-src/lib/fribidi-arabic.c 26 + -fribidi-src/lib/fribidi-bidi.c 27 + -fribidi-src/lib/fribidi-bidi-types.c 28 + -fribidi-src/lib/fribidi-deprecated.c 29 + -fribidi-src/lib/fribidi-joining.c 30 + -fribidi-src/lib/fribidi-joining-types.c 31 + -fribidi-src/lib/fribidi-mem.c 32 + -fribidi-src/lib/fribidi-mirroring.c 33 + -fribidi-src/lib/fribidi-run.c 34 + -fribidi-src/lib/fribidi-shape.c 35 + renpybidicore.c 36 + """.split() 37 + cython( 38 + "_renpybidi", 39 + FRIBIDI_SOURCES, 40 + + ["fribidi"], 41 + includes=[ 42 + - BASE + "/fribidi-src/", 43 + - BASE + "/fribidi-src/lib/", 44 + + "@fribidi@/include/fribidi/", 45 + ], 46 + define_macros=[ 47 + ("FRIBIDI_ENTRY", ""), 48 + - ("HAVE_CONFIG_H", "1"), 49 + ]) 50 + 51 + if not (android or ios or emscripten):
+3 -3
pkgs/development/python-modules/pygame_sdl2/default.nix
··· 1 - { lib, buildPythonPackage, fetchurl, isPy27 1 + { lib, buildPythonPackage, fetchurl, isPy27, renpy 2 2 , cython, SDL2, SDL2_image, SDL2_ttf, SDL2_mixer, libjpeg, libpng }: 3 3 4 4 buildPythonPackage rec { 5 5 pname = "pygame_sdl2"; 6 6 version = "2.1.0"; 7 - renpy_version = "7.2.0"; 7 + renpy_version = renpy.base_version; 8 8 name = "${pname}-${version}-${renpy_version}"; 9 9 10 10 src = fetchurl { 11 11 url = "https://www.renpy.org/dl/${renpy_version}/pygame_sdl2-${version}-for-renpy-${renpy_version}.tar.gz"; 12 - sha256 = "1amgsb6mm8ssf7vdcs5dr8rlxrgyhh29m4i573z1cw61ynd7vgcw"; 12 + sha256 = "sha256-iKsnmuSBzfHlIOHUwWECfvPa9LuBbCr9Kmq5dolxUlU="; 13 13 }; 14 14 15 15 # force rebuild of headers needed for install
-1
pkgs/top-level/aliases.nix
··· 1213 1213 redkite = throw "redkite was archived by upstream"; # Added 2021-04-12 1214 1214 redshift-wlr = throw "redshift-wlr has been replaced by gammastep"; # Added 2021-12-25 1215 1215 reicast = throw "reicast has been removed from nixpkgs as it is unmaintained, please use flycast instead"; # Added 2022-03-07 1216 - renpy = throw "renpy has been removed from nixpkgs, it was unmaintained and the latest packaged version required python2"; # Added 2022-01-12 1217 1216 1218 1217 # 3 resholve aliases below added 2022-04-08; drop after 2022-11-30? 1219 1218 resholvePackage = throw "resholvePackage has been renamed to resholve.mkDerivation";
+2
pkgs/top-level/all-packages.nix
··· 10071 10071 10072 10072 redsocks = callPackage ../tools/networking/redsocks { }; 10073 10073 10074 + renpy = callPackage ../development/interpreters/renpy { }; 10075 + 10074 10076 rep = callPackage ../development/tools/rep { }; 10075 10077 10076 10078 repseek = callPackage ../applications/science/biology/repseek { };