From 33c07e7725294425774255ddfb57d78d8bb789eb Mon Sep 17 00:00:00 2001 From: KSJ2000 Date: Fri, 31 Jan 2025 17:11:42 +0200 Subject: [PATCH 1/2] renpy: 8.3.1.24090601 -> 8.3.4.24120703 --- pkgs/by-name/re/renpy/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/re/renpy/package.nix b/pkgs/by-name/re/renpy/package.nix index 49bd15debfce..f39f4e4e61d4 100644 --- a/pkgs/by-name/re/renpy/package.nix +++ b/pkgs/by-name/re/renpy/package.nix @@ -24,8 +24,8 @@ let # 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.3.1"; - vc_version = "24090601"; + base_version = "8.3.4"; + vc_version = "24120703"; version = "${base_version}.${vc_version}"; in stdenv.mkDerivation { @@ -36,7 +36,7 @@ stdenv.mkDerivation { owner = "renpy"; repo = "renpy"; rev = version; - hash = "sha256-k8mcDzaFngRF3Xl9cinUFU0T9sjxNIVrECUguARJVZ4="; + hash = "sha256-GM6cx9yP5bgKWMSYOkZS9hE33/HJnsv4KmlB23jbkqg="; }; nativeBuildInputs = [ From e100269019acf082b8d24b78e84ed8ad8a0ef2e9 Mon Sep 17 00:00:00 2001 From: KSJ2000 Date: Fri, 31 Jan 2025 18:20:00 +0200 Subject: [PATCH 2/2] renpy: modernize derivation --- pkgs/by-name/re/renpy/package.nix | 105 +++++++++++++++--------------- 1 file changed, 52 insertions(+), 53 deletions(-) diff --git a/pkgs/by-name/re/renpy/package.nix b/pkgs/by-name/re/renpy/package.nix index f39f4e4e61d4..2696c6359f12 100644 --- a/pkgs/by-name/re/renpy/package.nix +++ b/pkgs/by-name/re/renpy/package.nix @@ -1,89 +1,84 @@ { - lib, - stdenv, fetchFromGitHub, - fetchpatch, - python311, - pkg-config, - SDL2, - libpng, ffmpeg, freetype, + fribidi, glew, + harfbuzz, + lib, libGL, libGLU, - fribidi, - zlib, - harfbuzz, + libpng, makeWrapper, + nix-update-script, + pkg-config, + python311, + SDL2, + stdenv, + versionCheckHook, withoutSteam ? true, + zlib, }: let - # 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.3.4"; - vc_version = "24120703"; - version = "${base_version}.${vc_version}"; + python = python311; in -stdenv.mkDerivation { +stdenv.mkDerivation (finalAttrs: { pname = "renpy"; - inherit version; + version = "8.3.4.24120703"; src = fetchFromGitHub { owner = "renpy"; repo = "renpy"; - rev = version; - hash = "sha256-GM6cx9yP5bgKWMSYOkZS9hE33/HJnsv4KmlB23jbkqg="; + tag = finalAttrs.version; + hash = "sha256-9f1ptw+6OQ2rMytwPZPtUd+K/ihnVKHUiELs22iTTqE="; }; nativeBuildInputs = [ - pkg-config makeWrapper + pkg-config # Ren'Py currently does not compile on Cython 3.x. # See https://github.com/renpy/renpy/issues/5359 - python311.pkgs.cython_0 - python311.pkgs.setuptools + python.pkgs.cython_0 + python.pkgs.setuptools ]; buildInputs = [ - SDL2 - libpng ffmpeg freetype - glew - libGLU - libGL fribidi - zlib + glew harfbuzz + libGL + libGLU + libpng + SDL2 + zlib ] - ++ (with python311.pkgs; [ - python - pygame-sdl2 - tkinter - future - six - pefile - requests + ++ (with python.pkgs; [ ecdsa + future + pefile + pygame-sdl2 + python + requests + six + tkinter ]); RENPY_DEPS_INSTALL = lib.concatStringsSep "::" [ - SDL2 - SDL2.dev - libpng ffmpeg.lib freetype - glew.dev - libGLU - libGL fribidi - zlib + glew.dev harfbuzz.dev + libGL + libGLU + libpng + SDL2 + SDL2.dev + zlib ]; enableParallelBuilding = true; @@ -97,7 +92,7 @@ stdenv.mkDerivation { cp tutorial/game/tutorial_director.rpy{m,} cat > renpy/vc_version.py << EOF - version = '${version}' + version = '${finalAttrs.version}' official = False nightly = False # Look at https://renpy.org/latest.html for what to put. @@ -105,13 +100,13 @@ stdenv.mkDerivation { EOF ''; - buildPhase = with python311.pkgs; '' + buildPhase = '' runHook preBuild ${python.pythonOnBuildForHost.interpreter} module/setup.py build --parallel=$NIX_BUILD_CORES runHook postBuild ''; - installPhase = with python311.pkgs; '' + installPhase = '' runHook preInstall ${python.pythonOnBuildForHost.interpreter} module/setup.py install_lib -d $out/${python.sitePackages} @@ -125,7 +120,13 @@ stdenv.mkDerivation { runHook postInstall ''; - env.NIX_CFLAGS_COMPILE = with python311.pkgs; "-I${pygame-sdl2}/include/${python.libPrefix}"; + env.NIX_CFLAGS_COMPILE = "-I${python.pkgs.pygame-sdl2}/include/${python.libPrefix}"; + + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + versionCheckProgramArg = "--version"; + + passthru.updateScript = nix-update-script { }; meta = { description = "Visual Novel Engine"; @@ -133,9 +134,7 @@ stdenv.mkDerivation { homepage = "https://renpy.org/"; changelog = "https://renpy.org/doc/html/changelog.html"; license = lib.licenses.mit; - platforms = lib.platforms.linux; + platforms = lib.platforms.unix; maintainers = with lib.maintainers; [ shadowrz ]; }; - - passthru = { inherit base_version vc_version; }; -} +})