Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devilutionx: unstable-2019-07-28 -> 0.5.0 #70971

Merged
merged 2 commits into from Oct 21, 2019

Conversation

karolchmist
Copy link
Member

Motivation for this change

DevilutionX 0.5.0 release:
https://github.com/diasurgical/devilutionX/releases/tag/0.5.0

Based on Devilution 0.10.0

Features

  • Sound is now accurate to the original
  • All in-game issues fixed
  • Delete hero, inline dialogs and scrollbars are now implemented
  • Screenshots now have different names
  • Multiple simultaneous dialogs fixed
  • All builds are now 64bit (except for Windows and Raspberry Pi)
  • Memory leaks and crashes fixed
  • All keys are now mapped
  • UI text now has correct shadows
  • Much lower CPU usage

Known issues

  • Error dialogs not implemented in main UI
  • The game must restart after hosting multiplayer
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @karolchmist (myself :P )

pkgs/games/devilutionx/default.nix Outdated Show resolved Hide resolved
@aanderse
Copy link
Member

aanderse commented Oct 13, 2019

@GrahamcOfBorg build devilutionx

@aanderse
Copy link
Member

@karolchmist are you able to address the darwin failure?

@karolchmist
Copy link
Member Author

No, I don't see why it failed... Seems like it compiles, and then fails in install phase. I don't have macOs. What can we do? Maybe remove darwin from the platform list?

@aanderse
Copy link
Member

aanderse commented Oct 16, 2019

cp: cannot stat 'devilutionx': No such file or directory

Seems like a differently named executable is produced on darwin. If we had access to a darwin box we could simply insert an echo to tell us what is in that directory and go from there...

@karolchmist
Copy link
Member Author

@aanderse I pushed a commit that lists the content of the output folder. On darwin, it's :

[100%] Linking CXX executable devilutionx.app/Contents/MacOS/devilutionx
Copying OS X content devilutionx.app/Contents/Resources/AppIcon.icns
Copying OS X content devilutionx.app/Contents/Resources/CharisSILB.ttf
[100%] Built target devilutionx
installing
total 14932
drwxr-xr-x 16 nixbld1 nixbld      544 Oct 16 14:32 .
drwxr-xr-x 27 nixbld1 nixbld      918 Oct 16 14:30 ..
-rw-r--r--  1 nixbld1 nixbld        2 Jan  1  1970 .gitignore
-rw-r--r--  1 nixbld1 nixbld    35343 Oct 16 14:30 CMakeCache.txt
drwxr-xr-x 17 nixbld1 nixbld      578 Oct 16 14:33 CMakeFiles
-r--r--r--  1 nixbld1 nixbld     3870 Oct 16 14:30 CPackConfig.cmake
-r--r--r--  1 nixbld1 nixbld     4347 Oct 16 14:30 CPackSourceConfig.cmake
-rw-r--r--  1 nixbld1 nixbld   132032 Oct 16 14:30 Makefile
-rw-r--r--  1 nixbld1 nixbld     1731 Oct 16 14:30 cmake_install.cmake
-rw-r--r--  1 nixbld1 nixbld       77 Oct 16 14:30 config.h
drwxr-xr-x  3 nixbld1 nixbld      102 Oct 16 14:30 devilutionx.app
-rw-r--r--  1 nixbld1 nixbld    18512 Oct 16 14:32 libPKWare.a
-rw-r--r--  1 nixbld1 nixbld    43848 Oct 16 14:32 libRadon.a
-rw-r--r--  1 nixbld1 nixbld   103104 Oct 16 14:32 libStormLib.a
-rw-r--r--  1 nixbld1 nixbld 14875984 Oct 16 14:32 libdevilution.a
-rw-r--r--  1 nixbld1 nixbld    42976 Oct 16 14:30 libsmacker.a

It seems like devilutionx.app is the executable file.

Do you know what we should do in this case?

@aanderse
Copy link
Member

@karolchmist unfortunately I've never really used darwin much before so even the most basic specifics of the system elude me.

ping @lilyball as someone who might be generous and share basic darwin knowledge with us ❤️

@aanderse
Copy link
Member

Maybe @jsamsa wouldn't mind taking 30 seconds to explain an extremely basic darwin concept to us so you can finish this PR up... 🤔

@jsamsa
Copy link
Contributor

jsamsa commented Oct 18, 2019

mv devilutionx.app $out/Applications

@jsamsa
Copy link
Contributor

jsamsa commented Oct 18, 2019

There might be a binary that could (should) be moved to $out/bin as well. I'm not familiar with this package so, not sure myself. Have a look at pkgs/development/tools/electron/default.nix as an example

@karolchmist
Copy link
Member Author

Thanks for your help @aanderse and @jsamsa . I tried to make sense of how to build it on Darwin, but I gave up because I wasn't sure what I was doing. Even if it builds, I can't test it properly.

If one day someone is willing to make it work, I'd be happy to help. Until then, I prefer to remove the support for Darwin. It's a niche game, and I don't think anybody cares...

To finish on a positive note: I re-enabled the hardening for the format flag, since it passes for the current version of the project.

@aanderse
Copy link
Member

@karolchmist alright. Too bad, but we don't have the hardware so if someone wants darwin support they'll have to add themselves to the maintainers list I guess.

Can you please format your commit messages as per nixpkgs standard? As in:

  • devilutionx: unstable-2019-07-28 -> 0.5.0
  • devilutionx: Remove darwin platform due to build errors
  • devilutionx: Remove hardeningDisable = [ "format" ]

Or squash all commits into:

  • devilutionx: unstable-2019-07-28 -> 0.5.0

Thanks!

@lilyball
Copy link
Member

@jsamsa's suggestion looks correct. The output as listed in your comment is devilutionx.app, which is a folder structure that contains the executable (among other things). The whole devilutionx.app is the GUI app and should be moved into $out/Applications as already recommended. I don't see anything in that output that obviously needs to be moved elsewhere either.

@lilyball
Copy link
Member

I don't have diabdat.mpq but I was able to run the app on darwin and get the screen telling me it's missing (I am curious how it's supposed to work with a Nix install though; where does the file go?)

Here's the diff applied to get to this point:

diff --git a/pkgs/games/devilutionx/default.nix b/pkgs/games/devilutionx/default.nix
index 63149aff678..650d12c112b 100644
--- a/pkgs/games/devilutionx/default.nix
+++ b/pkgs/games/devilutionx/default.nix
@@ -17,10 +17,13 @@ stdenv.mkDerivation rec {
 
   installPhase = ''
     runHook preInstall
-
+  '' + (if stdenv.isDarwin then ''
+    mkdir -p $out/Applications
+    mv devilutionx.app $out/Applications
+  '' else ''
     mkdir -p $out/bin
     cp devilutionx $out/bin
-
+  '') + ''
     runHook postInstall
   '';
 
@@ -29,6 +32,6 @@ stdenv.mkDerivation rec {
     description = "Diablo build for modern operating systems";
     license = licenses.unlicense;
     maintainers = [ maintainers.karolchmist ];
-    platforms = platforms.linux ++ platforms.windows;
+    platforms = platforms.linux ++ platforms.darwin ++ platforms.windows;
   };
 }

@aanderse
Copy link
Member

Thank you for your detailed explanation @lilyball! You are exceptional, as always! Generally how these open source forks/remakes of proprietary games work is that they ask you to put the game data in a predefined location like ~/.local/share/GAME.

@karolchmist at this point @lilyball has handed us the solution... If you don't mind can you please keep darwin support?

@lilyball
Copy link
Member

My question with diabdat.mpq is because the instructions say

Copy diabdat.mpq from your CD, or GoG install folder, to the DevilutionX install folder; Make sure it is all lowercase.

That makes it sound like it's supposed to be sitting next to the executable, which obviously doesn't work with Nix (for any platform).

That said, after digging through all of the code it does appear that if it can't find the file next to the executable it falls back to $HOME/.local/share/diasurgical/devilution/, so the Nix install should work fine even on macOS. I just wish this was documented.

@karolchmist
Copy link
Member Author

Hey @lilyball, thanks for you help! I pushed a version with your solution for Darwin.

How would you document the location for diabdat.mpq? Just in the description?

@karolchmist karolchmist force-pushed the update-devilutionx-0.5.0 branch 2 times, most recently from 561dc9b to 88edb8f Compare October 20, 2019 11:17
@aanderse
Copy link
Member

longDescription should be fine.

@aanderse
Copy link
Member

@GrahamcOfBorg build devilutionx

@aanderse
Copy link
Member

@karolchmist small suggestion on wording. Looking good. Thanks again @lilyball 🎉

Co-Authored-By: Aaron Andersen <aaron@fosslib.net>
@aanderse aanderse changed the title Bump devilutionx version to 0.5.0 devilutionx: unstable-2019-07-28 -> 0.5.0 Oct 21, 2019
@aanderse aanderse merged commit 47f47b4 into NixOS:master Oct 21, 2019
peti pushed a commit that referenced this pull request Oct 21, 2019
devilutionx: unstable-2019-07-28 -> 0.5.0
dtzWill pushed a commit to dtzWill/nixpkgs that referenced this pull request Oct 22, 2019
devilutionx: unstable-2019-07-28 -> 0.5.0
(cherry picked from commit 47f47b4)
@karolchmist karolchmist deleted the update-devilutionx-0.5.0 branch March 9, 2020 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants