diff --git a/pkgs/_sources/generated.json b/pkgs/_sources/generated.json index 370d9466..b651c95f 100644 --- a/pkgs/_sources/generated.json +++ b/pkgs/_sources/generated.json @@ -56,6 +56,69 @@ }, "version": "2.1.22-31" }, + "edopro": { + "cargoLocks": null, + "date": "2024-06-22", + "extract": null, + "name": "edopro", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": true, + "leaveDotGit": false, + "name": null, + "owner": "edo9300", + "repo": "edopro", + "rev": "dd5c5626f50c698f0e5d9ec7b90eefb5e10093ff", + "sha256": "sha256-6EEwJD5CB0IkWvz/rGAKHhkDJb0BpXG1Ejq8exIsuOg=", + "sparseCheckout": [], + "type": "github" + }, + "version": "dd5c5626f50c698f0e5d9ec7b90eefb5e10093ff" + }, + "edopro-distribution": { + "cargoLocks": null, + "date": "2024-06-13", + "extract": null, + "name": "edopro-distribution", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": true, + "leaveDotGit": true, + "name": null, + "owner": "ProjectIgnis", + "repo": "Distribution", + "rev": "286db345033c79cab6e36a8f06de3468008ff8cd", + "sha256": "sha256-ulolyrOw6bBySIRi1LEDwGASuUjO1OzRdmdx+VlcW+8=", + "sparseCheckout": [], + "type": "github" + }, + "version": "286db345033c79cab6e36a8f06de3468008ff8cd" + }, + "edopro-irrlicht": { + "cargoLocks": null, + "date": "2024-03-16", + "extract": null, + "name": "edopro-irrlicht", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "edo9300", + "repo": "irrlicht1-8-4", + "rev": "ba76104ccb104d769cdccda014e0a3966f7c40ac", + "sha256": "sha256-xVlVt9zv7SenEYhBQSop4UnNS5g4N5aPgiqSHhhajD8=", + "sparseCheckout": [], + "type": "github" + }, + "version": "ba76104ccb104d769cdccda014e0a3966f7c40ac" + }, "eglot-x": { "cargoLocks": null, "date": "2024-07-07", diff --git a/pkgs/_sources/generated.nix b/pkgs/_sources/generated.nix index c79bb2de..0f9e6264 100644 --- a/pkgs/_sources/generated.nix +++ b/pkgs/_sources/generated.nix @@ -31,6 +31,45 @@ sha256 = "sha256-2O0TjRhuwLd+QPUxV9tHeuWYtGoRnBa6icU7DMmxWyI="; }; }; + edopro = { + pname = "edopro"; + version = "dd5c5626f50c698f0e5d9ec7b90eefb5e10093ff"; + src = fetchFromGitHub { + owner = "edo9300"; + repo = "edopro"; + rev = "dd5c5626f50c698f0e5d9ec7b90eefb5e10093ff"; + fetchSubmodules = true; + sha256 = "sha256-6EEwJD5CB0IkWvz/rGAKHhkDJb0BpXG1Ejq8exIsuOg="; + }; + date = "2024-06-22"; + }; + edopro-distribution = { + pname = "edopro-distribution"; + version = "286db345033c79cab6e36a8f06de3468008ff8cd"; + src = fetchFromGitHub { + owner = "ProjectIgnis"; + repo = "Distribution"; + rev = "286db345033c79cab6e36a8f06de3468008ff8cd"; + fetchSubmodules = true; + deepClone = false; + leaveDotGit = true; + sparseCheckout = [ ]; + sha256 = "sha256-ocC1LdAGnKfNqsAHAEudn1XeG3WdFRHASIndrxTGq0g="; + }; + date = "2024-06-13"; + }; + edopro-irrlicht = { + pname = "edopro-irrlicht"; + version = "ba76104ccb104d769cdccda014e0a3966f7c40ac"; + src = fetchFromGitHub { + owner = "edo9300"; + repo = "irrlicht1-8-4"; + rev = "ba76104ccb104d769cdccda014e0a3966f7c40ac"; + fetchSubmodules = false; + sha256 = "sha256-xVlVt9zv7SenEYhBQSop4UnNS5g4N5aPgiqSHhhajD8="; + }; + date = "2024-03-16"; + }; eglot-x = { pname = "eglot-x"; version = "ada0c9f32deac90038661f461966aae51707abff"; diff --git a/pkgs/applications/edopro.nix b/pkgs/applications/edopro.nix new file mode 100644 index 00000000..29f7f1b8 --- /dev/null +++ b/pkgs/applications/edopro.nix @@ -0,0 +1,146 @@ +{ + stdenv, + sources, + + # build deps + premake5, + writeShellScriptBin, + + # edopro deps + bzip2, + curl, + egl-wayland, + flac, + fmt, + freetype, + irrlicht, + libevent, + libgit2, + libjpeg, + libpng, + libvorbis, + lua5_4_compat, + nlohmann_json, + noto-fonts-cjk-sans, + openal, + sqlite, + + # Irrlicht deps + wayland, + libxkbcommon, +}: +let + lua = lua5_4_compat; + + irrlicht-edopro = irrlicht.overrideAttrs (old: { + inherit (sources.edopro-irrlicht) pname version src; + buildInputs = old.buildInputs ++ [ + wayland + libxkbcommon + ]; + }); + + ocgcore = stdenv.mkDerivation { + inherit (sources.edopro) version src; + pname = sources.edopro.pname + "-ocgcore"; + + nativeBuildInputs = [ premake5 ]; + buildInputs = [ lua ]; + + enableParallelBuilding = true; + buildFlags = [ "verbose=true config=release ocgcoreshared" ]; + + # nixpkgs' lua is compiled as C, but lua can also be compiled as + # C++. Due to name mangling, a C-compiled lua will not be able to + # link to a C++ project without some hoops, but edopro normally + # builds it as a C++ library, so their code isn't used to this + # edge case. + # + # Hence we need to change the included headers a bit. + postPatch = '' + sed -i 's/#include /#include /g' ocgcore/*.* + sed -i '/#include /d' ocgcore/*.* + sed -i '/#include /d' ocgcore/*.* + ''; + + preBuild = '' + cd ocgcore + premake5 gmake2 --lua-path='${lua}' + cd build + ''; + + installPhase = '' + mkdir -p $out/lib + cp -r ../bin/release/* $out/lib/ + ''; + }; + + font = "${noto-fonts-cjk-sans}/share/fonts/opentype/noto-cjk/NotoSansCJK-VF.otf.ttc"; + edopro = stdenv.mkDerivation { + inherit (sources.edopro) pname version src; + + nativeBuildInputs = [ premake5 ]; + + buildInputs = [ + bzip2 + curl + flac + fmt + freetype + irrlicht-edopro + libevent + libgit2 + libjpeg + libpng + libvorbis + lua + nlohmann_json + openal + sqlite + ]; + + # nixpkgs' gcc stack currently appears to not support LTO + postPatch = '' + sed -i '/LinkTimeOptimization/d' ./premake5.lua + ''; + + # Edopro normally builds irrlicht without a prefix in its include + # dir + NIX_CFLAGS_COMPILE = "-I ${irrlicht-edopro}/include/irrlicht/"; + + enableParallelBuilding = true; + buildFlags = [ "verbose=true config=release_x64 ygopro" ]; + + preBuild = '' + premake5 gmake2 \ + --sound=sfml \ + --no-joystick=true \ + --os=linux \ + --prebuilt-core='${ocgcore}/lib' \ + --architecture=x64 \ + --bundled-font='${font}' \ + --lua-path='${lua}' + + cd build + ''; + + installPhase = '' + mkdir -p $out/{lib,bin} + cp ../bin/x64/release/ygopro $out/bin/ + cp ../bin/x64/release/*.a $out/lib + ''; + }; +in +writeShellScriptBin "EDOPro" '' + set -eu + EDOPRO_DIR="''${XDG_DATA_HOME:-~/.local/share}/edopro" + + if [ ! -d "''${EDOPRO_DIR}" ]; then + mkdir -p "''${EDOPRO_DIR}" + cp -r ${sources.edopro-distribution.src}/*/ "''${EDOPRO_DIR}/" + find "''${EDOPRO_DIR}" -type d -exec chmod 700 {} + + find "''${EDOPRO_DIR}" -type f -exec chmod 600 {} + + fi + + exec ${edopro}/bin/ygopro -C "''${EDOPRO_DIR}" $@ +'' diff --git a/pkgs/default.nix b/pkgs/default.nix index 5dcd821c..e4cc22bd 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -22,6 +22,7 @@ in # Proper packages deepfilternet = callPackage ./applications/deepfilternet.nix { }; drivestrike = callPackage ./applications/drivestrike.nix { }; + edopro = callPackage ./applications/edopro.nix { }; emacs = callPackage ./applications/emacs { }; gauth = callPackage ./applications/gauth.nix { }; gcs = callPackage ./applications/gcs.nix { }; diff --git a/pkgs/nvfetcher.toml b/pkgs/nvfetcher.toml index 66706e23..093fd45f 100644 --- a/pkgs/nvfetcher.toml +++ b/pkgs/nvfetcher.toml @@ -14,6 +14,22 @@ fetch.url = "https://app.drivestrike.com/static/yum/drivestrike.rpm" src.git = "https://github.com/nemethf/eglot-x" fetch.github = "nemethf/eglot-x" +[edopro] +src.git = "https://github.com/edo9300/edopro.git" +fetch.github = "edo9300/edopro" +git.fetchSubmodules = true + +[edopro-distribution] +src.git = "https://github.com/ProjectIgnis/Distribution.git" +fetch.github = "ProjectIgnis/Distribution" +git.fetchSubmodules = true +git.leaveDotGit = true +# git.deepClone = true + +[edopro-irrlicht] +src.git = "https://github.com/edo9300/irrlicht1-8-4.git" +fetch.github = "edo9300/irrlicht1-8-4" + [firefox-ui-fix] src.github = "black7375/Firefox-UI-Fix" fetch.github = "black7375/Firefox-UI-Fix"