From 436f194a7659efa62ac6f7cba57803c531f5d79d Mon Sep 17 00:00:00 2001 From: Tomo <68489118+Tomodachi94@users.noreply.github.com> Date: Tue, 2 Jan 2024 22:42:21 -0800 Subject: [PATCH] craftos-pc: 2.7.5 -> 2.8 Changelog: https://github.com/MCJack123/craftos2/releases/tag/v2.8 This release contains several breaking changes, and should **not** be backported. --- .../manual/release-notes/rl-2405.section.md | 6 +++++ .../emulators/craftos-pc/default.nix | 23 +++++++++++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-2405.section.md b/nixos/doc/manual/release-notes/rl-2405.section.md index b347992031d9..36a645db4ebb 100644 --- a/nixos/doc/manual/release-notes/rl-2405.section.md +++ b/nixos/doc/manual/release-notes/rl-2405.section.md @@ -61,6 +61,12 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m - The `kanata` package has been updated to v1.5.0, which includes [breaking changes](https://github.com/jtroo/kanata/releases/tag/v1.5.0). +- The `craftos-pc` package has been updated to v2.8, which includes [breaking changes](https://github.com/MCJack123/craftos2/releases/tag/v2.8). + - Files are now handled in binary mode; this could break programs with embedded UTF-8 characters. + - The ROM was updated to match ComputerCraft version v1.109.2. + - The bundled Lua was updated to Lua v5.2, which includes breaking changes. See the [Lua manual](https://www.lua.org/manual/5.2/manual.html#8) for more information. + - The WebSocket API [was rewritten](https://github.com/MCJack123/craftos2/issues/337), which introduced breaking changes. + - The latest available version of Nextcloud is v28 (available as `pkgs.nextcloud28`). The installation logic is as follows: - If [`services.nextcloud.package`](#opt-services.nextcloud.package) is specified explicitly, this package will be installed (**recommended**) - If [`system.stateVersion`](#opt-system.stateVersion) is >=24.05, `pkgs.nextcloud28` will be installed by default. diff --git a/pkgs/applications/emulators/craftos-pc/default.nix b/pkgs/applications/emulators/craftos-pc/default.nix index b147af8d02b7..9c1c31c689ca 100644 --- a/pkgs/applications/emulators/craftos-pc/default.nix +++ b/pkgs/applications/emulators/craftos-pc/default.nix @@ -16,17 +16,17 @@ }: let - version = "2.7.5"; + version = "2.8"; craftos2-lua = fetchFromGitHub { owner = "MCJack123"; repo = "craftos2-lua"; rev = "v${version}"; - hash = "sha256-JMBsSoO/yTLw7K1Ri3BzKr5bz5UirXiPr/Q0YoMumhY="; + hash = "sha256-xuNcWt3Wnh3WlYe6pB4dvP3PY9S5ghL9QQombGn8iyY="; }; craftos2-rom = fetchFromGitHub { owner = "McJack123"; repo = "craftos2-rom"; - rev = "v${version}.1"; # Author released a hotfix; remove trailing '.1' on next update + rev = "v${version}"; hash = "sha256-WZs/KIdpqLLzvpH2hiJpe/AehluoQMtewBbAb4htz8k="; }; in @@ -39,9 +39,18 @@ stdenv.mkDerivation rec { owner = "MCJack123"; repo = "craftos2"; rev = "v${version}"; - hash = "sha256-t2yhSuNPFCF2NaQFWuN9Nos5ZPinAvecV6EZNO0Cy9I="; + hash = "sha256-nT/oN2XRU1Du1/IHlkRCzLqFwQ5s9Sr4FQs3ES+aPFs="; }; + patches = [ + ( # Fixes CCEmuX. This is a one-character change that did not make it into the release. + fetchpatch { + url = "https://github.com/MCJack123/craftos2/commit/9ef7e16b69ead69b5fe076724842a1e24b3de058.patch"; + hash = "sha256-SjNnsooDFt3JoVOO0xf6scrGXEQQmrQf91GY7VWaTOw="; + } + ) + ]; + buildInputs = [ patchelf poco openssl SDL2 SDL2_mixer ncurses libpng pngpp libwebp ]; preBuild = '' @@ -50,6 +59,12 @@ stdenv.mkDerivation rec { make -C craftos2-lua linux ''; + buildPhase = '' + runHook preBuild + make + runHook postBuild + ''; + dontStrip = true; installPhase = ''