Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Cosima Neidahl <[email protected]>
  • Loading branch information
Redhawk18 and OPNA2608 authored Oct 22, 2024
1 parent 5439c14 commit 8bd0bc1
Showing 1 changed file with 22 additions and 26 deletions.
48 changes: 22 additions & 26 deletions pkgs/by-name/ed/edopro/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
stdenv,
fetchFromGitHub,
fetchzip,
makeWrapper,
premake5,
writeShellScriptBin,
runCommandLocal,
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -158,7 +154,10 @@ let
fetchSubmodules = true;
};

nativeBuildInputs = [ premake5 ];
nativeBuildInputs = [
makeWrapper
premake5
];

buildInputs = [
bzip2
Expand Down Expand Up @@ -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
'';
Expand Down Expand Up @@ -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
Expand All @@ -285,15 +282,14 @@ symlinkJoin {
name = "edopro-application-${deps.edopro-version}";
version = deps.edopro-version;
paths = [
edopro
edopro-script
edopro-desktop
];

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
'';
Expand Down

0 comments on commit 8bd0bc1

Please sign in to comment.