edopro: 40.1.4 -> 41.0.2 (#400930)

This commit is contained in:
Ryan Burns
2025-05-01 01:19:39 -07:00
committed by GitHub
4 changed files with 186 additions and 46 deletions
+7 -7
View File
@@ -1,11 +1,11 @@
# This is automatically generated by the update script.
# DO NOT MANUALLY EDIT.
{
assets-hash = "sha256-vZhkWJ1ZoNEwdc5kM1S0hyXnWmupiTOanCi9DCuqw/k=";
edopro-version = "40.1.4";
edopro-rev = "c713e23491a1e55c9d8e91257e5f2b5873696b9b";
edopro-hash = "sha256-mj0xEJsFcnY//za0uJosAPOPbU/jlduNX0YSNmvduLE=";
irrlicht-version = "1.9.0-unstable-2023-02-18";
irrlicht-rev = "7edde28d4f8c0c3589934c398a3a441286bb7c22";
irrlicht-hash = "sha256-Q2tNiYE/enZPqA5YhUe+Tkvmqtmmz2E0OqTRUDnt+UA=";
assets-hash = "sha256-cta4k6yxrdaFFfum0eshEzLODExBfA+oVPqcOpXG9uk=";
edopro-version = "41.0.2";
edopro-rev = "e5c0578aa504d0831dcbe29dbacd018f7b885b2c";
edopro-hash = "sha256-ZkQXWt73S3Nn+RnkG+e91BId7keI5OpM3NSeDMJWlZY=";
irrlicht-version = "1.9.0-unstable-2025-03-30";
irrlicht-rev = "47264fc2bc3223d110c589c9ffe4339d696a3dd0";
irrlicht-hash = "sha256-AwUCHQOivNgSnYe8kG6JxDIz7H5PC6RoozGiOGUejTI=";
}
@@ -0,0 +1,29 @@
From 41e750142b44465f3af197b7e2f0d6f54fc48c2d Mon Sep 17 00:00:00 2001
From: OPNA2608 <opna2608@protonmail.com>
Date: Mon, 21 Oct 2024 17:42:24 +0200
Subject: [PATCH] Mark Lua symbols as C symbols
Otherwise linking against our Lua built by a C-compiler fails due to the symbols being resolved as C++ symbols.
---
interpreter.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/interpreter.h b/interpreter.h
index 6c405a1..c471ecb 100644
--- a/interpreter.h
+++ b/interpreter.h
@@ -9,9 +9,11 @@
#define INTERPRETER_H_
// Due to longjmp behaviour, we must build Lua as C++ to avoid UB
+extern "C" {
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
+}
#include "common.h"
#include <unordered_map>
--
2.44.1
+144 -30
View File
@@ -2,19 +2,19 @@
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
fetchzip,
makeWrapper,
premake5,
writeShellScriptBin,
writeShellApplication,
runCommandLocal,
symlinkJoin,
writeText,
imagemagick,
bzip2,
curl,
envsubst,
flac,
# Use fmt 10+ after release 40.1.4+
fmt_9,
fmt,
freetype,
irrlicht,
libevent,
@@ -34,6 +34,7 @@
sqlite,
wayland,
egl-wayland,
zenity,
covers_url ? "https://pics.projectignis.org:2096/pics/cover/{}.jpg",
fields_url ? "https://pics.projectignis.org:2096/pics/field/{}.png",
# While ygoprodeck has higher quality images, "spamming" of their api results in a ban.
@@ -57,6 +58,14 @@ let
];
deps = import ./deps.nix;
edopro-src = fetchFromGitHub {
owner = "edo9300";
repo = "edopro";
rev = deps.edopro-rev;
fetchSubmodules = true;
hash = deps.edopro-hash;
};
in
let
assets = fetchzip {
@@ -107,16 +116,83 @@ let
};
};
ocgcore =
let
# Refer to CORENAME EPRO_TEXT in <edopro>/gframe/dllinterface.cpp for this
ocgcoreName = lib.strings.concatStrings [
(lib.optionalString (!stdenv.hostPlatform.isWindows) "lib")
"ocgcore"
(
if stdenv.hostPlatform.isiOS then
"-ios"
else if stdenv.hostPlatform.isAndroid then
(
if stdenv.hostPlatform.isx86_64 then
"x64"
else if stdenv.hostPlatform.isx86_32 then
"x86"
else if stdenv.hostPlatform.isAarch64 then
"v8"
else if stdenv.hostPlatform.isAarch32 then
"v7"
else
throw "Don't know what platform suffix edopro expects for ocgcore on: ${stdenv.hostPlatform.system}"
)
else
lib.optionalString (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) ".aarch64"
)
stdenv.hostPlatform.extensions.sharedLibrary
];
in
stdenv.mkDerivation {
pname = "ocgcore-edopro";
version = deps.edopro-version;
src = edopro-src;
sourceRoot = "${edopro-src.name}/ocgcore";
nativeBuildInputs = [
premake5
];
enableParallelBuilding = true;
buildFlags = [
"verbose=true"
"config=release"
"ocgcoreshared"
];
makeFlags = [
"-C"
"build"
];
# To make sure linking errors are discovered at build time, not when edopro runs into them during loading
env.NIX_LDFLAGS = "--unresolved-symbols=report-all";
installPhase = ''
runHook preInstall
install -Dm644 bin/release/*ocgcore*${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/${ocgcoreName}
runHook postInstall
'';
meta = {
description = "YGOPro script engine";
homepage = "https://github.com/edo9300/ygopro-core";
license = lib.licenses.agpl3Plus;
inherit maintainers;
platforms = lib.platforms.unix;
};
};
edopro = stdenv.mkDerivation {
pname = "edopro";
version = deps.edopro-version;
src = fetchFromGitHub {
owner = "edo9300";
repo = "edopro";
rev = deps.edopro-rev;
hash = deps.edopro-hash;
};
src = edopro-src;
nativeBuildInputs = [
makeWrapper
@@ -127,7 +203,7 @@ let
bzip2
curl
flac
fmt_9
fmt
freetype
irrlicht-edopro
libevent
@@ -141,19 +217,16 @@ let
sqlite
];
patches = [
(fetchpatch {
name = "libgit2-version.patch";
url = "https://github.com/edo9300/edopro/commit/f8ddbfff51231827a8dd1dcfcb2dda85f50a56d9.patch";
hash = "sha256-w9VTmWfw6vEyVvsOH+AK9lAbUOV+MagzGQ3Wa5DCS/U=";
})
];
# nixpkgs' gcc stack currently appears to not support LTO
# Override where bundled ocgcore get looked up in, so we can supply ours
# (can't use --prebuilt-core or let it build a core on its own without making core updates impossible)
postPatch = ''
substituteInPlace premake5.lua \
--replace-fail 'flags "LinkTimeOptimization"' 'removeflags "LinkTimeOptimization"'
substituteInPlace gframe/game.cpp \
--replace-fail 'ocgcore = LoadOCGcore(Utils::GetWorkingDirectory())' 'ocgcore = LoadOCGcore("${lib.getLib ocgcore}/lib/")'
touch ocgcore/premake5.lua
'';
@@ -244,21 +317,62 @@ let
"textures"
"WindBot"
];
wrapperZenityMessageTemplate = writeText "edopro-wrapper-multiple-versions-message.txt.in" ''
Nixpkgs' EDOPro wrapper has found more than 1 directory in: ''${EDOPRO_BASE_DIR}
We expected the only directory to be: ''${EDOPRO_DIR}
There may have been an update, requiring you to migrate any files you care about from an older version.
Examples include:
- decks/*
- config/system.conf - which has your client's settings
- any custom things you may have installed into: fonts, skins, script, sound, ...
- anything you wish to preserve from: replay, screenshots
Once you have copied over everything important to ''${EDOPRO_DIR}, delete the old version's path.
'';
in
writeShellScriptBin "edopro" ''
set -eu
EDOPRO_DIR="''${XDG_DATA_HOME:-$HOME/.local/share}/edopro"
writeShellApplication {
name = "edopro";
runtimeInputs = [
envsubst
zenity
];
text = ''
export EDOPRO_VERSION="${deps.edopro-version}"
export EDOPRO_BASE_DIR="''${XDG_DATA_HOME:-$HOME/.local/share}/edopro"
export EDOPRO_DIR="''${EDOPRO_BASE_DIR}/''${EDOPRO_VERSION}"
if [ ! -d $EDOPRO_DIR ]; then
mkdir -p $EDOPRO_DIR
cp -r --no-preserve=all ${assets}/{${assetsToCopy}} $EDOPRO_DIR
chmod -R go-rwx $EDOPRO_DIR
# If versioned directory doesn't exist yet, make it & copy over assets
if [ ! -d "$EDOPRO_DIR" ]; then
mkdir -p "$EDOPRO_DIR"
cp -r --no-preserve=all ${assets}/{${assetsToCopy}} "$EDOPRO_DIR"
chmod -R go-rwx "$EDOPRO_DIR"
rm $EDOPRO_DIR/config/io.github.edo9300.EDOPro.desktop.in
fi
rm "$EDOPRO_DIR"/config/io.github.edo9300.EDOPro.desktop.in
fi
exec ${lib.getExe edopro} -C $EDOPRO_DIR $@
'';
# Different versions provide different assets. Some are necessary for the game to run properly (configs for
# where to get incremental updates from, online servers, card scripting, certificates for communication etc),
# and some are optional nice-haves (example decks). It's also possible to override assets with custom skins.
#
# Don't try to manage all of this across versions, just inform the user that they may need to migrate their
# files if it looks like there are multiple versions.
edoproTopDirs="$(find "$EDOPRO_BASE_DIR" -mindepth 1 -maxdepth 1 -type d | wc -l)"
if [ "$edoproTopDirs" -ne 1 ]; then
zenity \
--info \
--title='[NIX] Multiple asset copies found' \
--text="$(envsubst < ${wrapperZenityMessageTemplate})" \
--ok-label='Continue to EDOPro'
fi
exec ${lib.getExe edopro} -C "$EDOPRO_DIR" "$@"
'';
};
edopro-desktop = runCommandLocal "io.github.edo9300.EDOPro.desktop" { } ''
mkdir -p $out/share/applications
+6 -9
View File
@@ -2,6 +2,7 @@
#! nix-shell -i python -p nix-prefetch-github python3Packages.githubkit
import json
import subprocess
import sys
from githubkit import GitHub, UnauthAuthStrategy
from githubkit.versions.latest.models import (
@@ -15,15 +16,11 @@ DEPS_PATH: str = "./pkgs/by-name/ed/edopro/deps.nix"
with GitHub(UnauthAuthStrategy()) as github:
edopro: Tag = github.rest.repos.list_tags("edo9300", "edopro").parsed_data[0]
# This dep is not versioned in anyway and is why we check below to see if this is a new version.
# This dep is not versioned in any way and is why we check below to see if this is a new version.
irrlicht: Commit = github.rest.repos.list_commits(
"edo9300", "irrlicht1-8-4"
).parsed_data[0]
irrlicht: Commit = github.rest.repos.get_commit(
"edo9300", "irrlicht1-8-4", "7edde28d4f8c0c3589934c398a3a441286bb7c22"
).parsed_data
edopro_working_version: str = ""
try:
@@ -32,11 +29,11 @@ try:
if "edopro-version" in line:
edopro_working_version = line.split('"')[1]
except FileNotFoundError:
print("Error: Dep file not found.")
print("Error: Dep file not found.", file=sys.stderr)
exit(2)
if edopro_working_version == "":
print("Working version is unbound")
print("Working version is unbound", file=sys.stderr)
exit(5)
if edopro_working_version == edopro.name:
@@ -56,7 +53,7 @@ def get_hash(owner: str, repo: str, rev: str, submodule: bool = False) -> str:
return out_json["hash"]
edopro_hash = get_hash("edo9300", "edopro", edopro.commit.sha)
edopro_hash = get_hash("edo9300", "edopro", edopro.commit.sha, submodule=True)
irrlicht_hash = get_hash("edo9300", "irrlicht1-8-4", irrlicht.sha)
asset_legacy_hash: str = (
@@ -98,7 +95,7 @@ with open(DEPS_PATH, "w") as file:
edopro-version = "{edopro.name}";
edopro-rev = "{edopro.commit.sha}";
edopro-hash = "{edopro_hash}";
irrlicht-version = "{"1.9.0-unstable-" + irrlicht.commit.committer.date.split("T")[0]}";
irrlicht-version = "{"1.9.0-unstable-" + irrlicht.commit.committer.date.strftime("%Y-%m-%d")}";
irrlicht-rev = "{irrlicht.sha}";
irrlicht-hash = "{irrlicht_hash}";
}}