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

This commit is contained in:
Sandro 2022-07-15 12:10:09 +02:00 committed by GitHub
commit e83851024e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 152 additions and 4 deletions

View file

@ -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";

View file

@ -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 ];
};
}

View file

@ -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 <Python.h>
-#ifdef RENPY_BUILD
#include <fribidi.h>
-#else
-#include <fribidi-src/lib/fribidi.h>
-#endif
#include <stdlib.h>
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):

View file

@ -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

View file

@ -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";

View file

@ -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 { };