Skip to content

Commit

Permalink
WIP: pkgs: Add edopro package
Browse files Browse the repository at this point in the history
  • Loading branch information
TLATER committed Jul 12, 2024
1 parent a31d748 commit d45709e
Show file tree
Hide file tree
Showing 5 changed files with 189 additions and 0 deletions.
42 changes: 42 additions & 0 deletions pkgs/_sources/generated.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
24 changes: 24 additions & 0 deletions pkgs/_sources/generated.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
113 changes: 113 additions & 0 deletions pkgs/applications/edopro.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
{
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
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" ];

# TODO(tlater): Somehow linking to lua isn't working properly
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";
in
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
'';
}
1 change: 1 addition & 0 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 { };
Expand Down
9 changes: 9 additions & 0 deletions pkgs/nvfetcher.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit d45709e

Please sign in to comment.