2022-07-18 16:21:45 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, python3, pkg-config, SDL2
|
|
|
|
, libpng, ffmpeg, freetype, glew, libGL, libGLU, fribidi, zlib
|
|
|
|
, makeWrapper
|
|
|
|
}:
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
let
|
2022-07-18 16:21:45 +00:00
|
|
|
# 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
|
2024-01-13 08:15:51 +00:00
|
|
|
base_version = "8.1.3";
|
|
|
|
vc_version = "23091805";
|
2023-05-24 13:37:59 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "renpy";
|
|
|
|
|
2022-07-18 16:21:45 +00:00
|
|
|
version = "${base_version}.${vc_version}";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "renpy";
|
|
|
|
repo = "renpy";
|
|
|
|
rev = version;
|
2024-01-13 08:15:51 +00:00
|
|
|
sha256 = "sha256-bYqnKSWY8EEGr1+12cWeT9/ZSv5OrKLsRqCnnIruDQw=";
|
2022-07-18 16:21:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
makeWrapper
|
|
|
|
python3.pkgs.cython
|
2023-05-24 13:37:59 +00:00
|
|
|
python3.pkgs.setuptools
|
2022-07-18 16:21:45 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
SDL2 libpng ffmpeg freetype glew libGLU libGL fribidi zlib
|
|
|
|
] ++ (with python3.pkgs; [
|
2024-01-13 08:15:51 +00:00
|
|
|
python pygame-sdl2 tkinter future six pefile requests ecdsa
|
2022-07-18 16:21:45 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
RENPY_DEPS_INSTALL = lib.concatStringsSep "::" (map (path: path) [
|
2023-02-16 17:41:37 +00:00
|
|
|
SDL2 SDL2.dev libpng ffmpeg.lib freetype glew.dev libGLU libGL fribidi zlib
|
2022-07-18 16:21:45 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
patches = [
|
2022-08-21 13:32:41 +00:00
|
|
|
./shutup-erofs-errors.patch
|
2022-07-18 16:21:45 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
cp tutorial/game/tutorial_director.rpy{m,}
|
|
|
|
|
|
|
|
cat > renpy/vc_version.py << EOF
|
2023-08-22 20:05:09 +00:00
|
|
|
version = '${version}'
|
2022-07-18 16:21:45 +00:00
|
|
|
official = False
|
|
|
|
nightly = False
|
2023-08-22 20:05:09 +00:00
|
|
|
# Look at https://renpy.org/latest.html for what to put.
|
|
|
|
version_name = 'Where No One Has Gone Before'
|
2022-07-18 16:21:45 +00:00
|
|
|
EOF
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = with python3.pkgs; ''
|
|
|
|
runHook preBuild
|
2023-11-16 04:20:00 +00:00
|
|
|
${python.pythonOnBuildForHost.interpreter} module/setup.py build --parallel=$NIX_BUILD_CORES
|
2022-07-18 16:21:45 +00:00
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = with python3.pkgs; ''
|
|
|
|
runHook preInstall
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
${python.pythonOnBuildForHost.interpreter} module/setup.py install_lib -d $out/${python.sitePackages}
|
2022-07-18 16:21:45 +00:00
|
|
|
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}" \
|
2022-08-21 13:32:41 +00:00
|
|
|
--add-flags "$out/share/renpy/renpy.py"
|
2022-07-18 16:21:45 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = with python3.pkgs; "-I${pygame-sdl2}/include/${python.libPrefix}";
|
2022-07-18 16:21:45 +00:00
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
passthru = { inherit base_version vc_version; };
|
2022-07-18 16:21:45 +00:00
|
|
|
}
|