From 498e79f9d2266cb11e0d7c671bc7c63145b22b98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tristan=20Dani=C3=ABl=20Maat?= Date: Sat, 15 Jun 2024 03:30:40 +0200 Subject: [PATCH] WIP: pkgs: Add edopro package --- pkgs/_sources/generated.json | 42 +++++++++++++++ pkgs/_sources/generated.nix | 24 +++++++++ pkgs/applications/edopro.nix | 101 +++++++++++++++++++++++++++++++++-- pkgs/default.nix | 1 + pkgs/nvfetcher.toml | 9 ++++ 5 files changed, 173 insertions(+), 4 deletions(-) diff --git a/pkgs/_sources/generated.json b/pkgs/_sources/generated.json index 505bf710..fa2542cd 100644 --- a/pkgs/_sources/generated.json +++ b/pkgs/_sources/generated.json @@ -56,6 +56,48 @@ }, "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-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-02", diff --git a/pkgs/_sources/generated.nix b/pkgs/_sources/generated.nix index 0c92ca26..be575470 100644 --- a/pkgs/_sources/generated.nix +++ b/pkgs/_sources/generated.nix @@ -31,6 +31,30 @@ 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-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 = "14aa967a431f0b4d4f9e787c98b208e28f488c0b"; diff --git a/pkgs/applications/edopro.nix b/pkgs/applications/edopro.nix index 63fada28..1ac849a9 100644 --- a/pkgs/applications/edopro.nix +++ b/pkgs/applications/edopro.nix @@ -1,15 +1,108 @@ { stdenv, sources, + + # build deps premake5, + + # edopro deps + bzip2, + curl, + 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 + 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 = [ lua5_4_compat ]; + + buildFlags = [ "verbose=true config=release_x64 ocgcoreshared" ]; + + # TODO(tlater): Somehow linking to lua isn't working properly + preBuild = '' + premake5 gmake2 --lua-path='${lua5_4_compat}' + cd build + ''; + + installPhase = '' + mkdir -p $out/lib + cp -r ../bin/x64/release/* $out/lib/ + ''; + }; + + font = "${noto-fonts-cjk-sans}/share/fonts/opentype/noto-cjk/NotoSansCJK-VF.otf.ttc"; +in stdenv.mkDerivation { - inherit (sources) pname src; - TARGET_OS = "linux"; + inherit (sources.edopro) pname version src; nativeBuildInputs = [ premake5 ]; - buildPhase = '' - ./travis/build.sh + buildInputs = [ + bzip2 + curl + flac + fmt + freetype + irrlicht-edopro + libevent + libgit2 + libjpeg + libpng + libvorbis + 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}' + + cd build ''; } 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..eaca2fc6 100644 --- a/pkgs/nvfetcher.toml +++ b/pkgs/nvfetcher.toml @@ -14,6 +14,15 @@ 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-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"