diff --git a/pkgs/by-name/ed/edopro/package.nix b/pkgs/by-name/ed/edopro/package.nix index 368b402e014e5..5390b97eb5189 100644 --- a/pkgs/by-name/ed/edopro/package.nix +++ b/pkgs/by-name/ed/edopro/package.nix @@ -3,6 +3,7 @@ stdenv, fetchFromGitHub, fetchzip, + makeWrapper, premake5, writeShellScriptBin, runCommandLocal, @@ -52,14 +53,9 @@ let deps = import ./deps.nix; in let - assets = { - pname = "assets"; - version = deps.edopro-version; - - src = fetchzip { - url = "https://github.com/ProjectIgnis/edopro-assets/releases/download/${deps.edopro-version}/ProjectIgnis-EDOPro-${deps.edopro-version}-linux.tar.gz"; - sha256 = deps.assets-hash; - }; + assets = fetchzip { + url = "https://github.com/ProjectIgnis/edopro-assets/releases/download/${deps.edopro-version}/ProjectIgnis-EDOPro-${deps.edopro-version}-linux.tar.gz"; + sha256 = deps.assets-hash; }; irrlicht-edopro = stdenv.mkDerivation { @@ -158,7 +154,10 @@ let fetchSubmodules = true; }; - nativeBuildInputs = [ premake5 ]; + nativeBuildInputs = [ + makeWrapper + premake5 + ]; buildInputs = [ bzip2 @@ -218,6 +217,17 @@ let mkdir -p $out/bin cp bin/${archLabel}/release/ygopro $out/bin + wrapProgram $out/bin/ygopro \ + --prefix PATH : ${lib.makeBinPath [ mono ]} \ + --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ + libGL + libX11 + libxkbcommon + libXxf86vm + sqlite + wayland + egl-wayland + ]} runHook postInstall ''; @@ -249,30 +259,17 @@ let if [ ! -d $EDOPRO_DIR ]; then mkdir -p $EDOPRO_DIR - cp -r --no-preserve=all ${assets.src}/{${assetsToCopy}} $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 - export PATH=PATH:'${lib.makeBinPath [ mono ]}'; - export LD_LIBRARY_PATH='${ - lib.makeLibraryPath [ - libGL - libX11 - libxkbcommon - libXxf86vm - sqlite - wayland - egl-wayland - ] - }'; - exec ${edopro}/bin/ygopro -C $EDOPRO_DIR $@ ''; edopro-desktop = runCommandLocal "io.github.edo9300.EDOPro.desktop" { } '' - cp ${assets.src}/config/io.github.edo9300.EDOPro.desktop.in desktop-template + cp ${assets}/config/io.github.edo9300.EDOPro.desktop.in desktop-template sed '/Path=/d' -i desktop-template sed 's/Exec=.*/Exec=EDOPro/' -i desktop-template @@ -285,7 +282,6 @@ symlinkJoin { name = "edopro-application-${deps.edopro-version}"; version = deps.edopro-version; paths = [ - edopro edopro-script edopro-desktop ]; @@ -293,7 +289,7 @@ symlinkJoin { postBuild = '' mkdir -p $out/share/icons/hicolor/256x256/apps/ ${imagemagick}/bin/magick \ - ${assets.src}/textures/AppIcon.png \ + ${assets}/textures/AppIcon.png \ -resize 256x256 \ $out/share/icons/hicolor/256x256/apps/EDOPro.png '';