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

cataclysm-dda: 0.D -> 0.E #84261

Merged
merged 1 commit into from Apr 20, 2020
Merged

cataclysm-dda: 0.D -> 0.E #84261

merged 1 commit into from Apr 20, 2020

Conversation

catern
Copy link
Contributor

@catern catern commented Apr 4, 2020

Motivation for this change

New release, just released a few days ago. Ran it and played briefly, seems to work fine.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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.

@catern
Copy link
Contributor Author

catern commented Apr 4, 2020

Incidentally, this release removed the most popular and complete tileset due to redistribution/licensing issues; it's now distributed separately at https://discourse.cataclysmdda.org/t/32x32-msx-dead-people-tileset/18775 . It would be a good project for someone to add a package for that tileset, and a plugin interface for the cataclysm-dda package so that the tileset can be added in. (tilesets, as far as I know, have to be directly in the cataclysm-dda data directory, which is in the Nix store, hence the need for a package plugin interface)

@mnacamura
Copy link
Contributor

Built and run successfully on NixOS. Looks good for me.

It would be a good project for someone to add a package for that tileset, and a plugin interface for the cataclysm-dda package so that the tileset can be added in.

I personally tried to do so (https://github.com/mnacamura/nixpkgs-cdda-mods) but such a plugin interface is not necessary because recent C:DDA allows users to put tilesets in their user directory as well as mods and soundpacks.

@svenkeidel
Copy link
Contributor

svenkeidel commented Apr 6, 2020

Packaging the game without a proper tileset only confuses users. I had to spent some time myself figuring out where the chesthole tileset went. At least we should make it easier to add back a tileset. However, downloading the tileset and manually adding it to your user directory is cumbersome and errorprone. This is it is not the nix way.

@mnacamura, I like your nix package that manages cataclysm mods. Any chance you can integrate this into nixpkgs? With this functionality we can make it much easier for nix users to add a proper tileset and other mods.

@mnacamura
Copy link
Contributor

@svenkeidel As a nix user I totally agree with "it is not the nix way". It would be easy to port my bareborn overlay to nixpkgs. I'll try it later.

For packaging mods and for using them, I am concerned about some (many?) mods are distributed in non Unix-friendly ways; via mega.nz, moddb.com, etc. having no permanent link, requiring manual download, and/or file name containing invalid characters for nix store (such as / and ). In that case one has to manually download them in a web browser and nix-store --add-fixed sha256 <POSSIBLY_RENAMED_FILE> one by one. That's tedious.

@svenkeidel
Copy link
Contributor

svenkeidel commented Apr 6, 2020

Yes, this is a valid concern.

I am concerned about some (many?) mods are distributed in non Unix-friendly ways; via mega.nz, moddb.com, etc. having no permanent link.

To what mods are you referring to in particular? The MSX tileset is distributed via mega.nz, but also has a github page: https://github.com/SomeDeadGuy/UndeadPeopleTileset. You download projects on github with the fetchFromGitHub command provided by nix.

According to this page many mods actually do have a permalinks. Furthermore, if a mod does not have a permalink, we can ask the maintainers of the mod nicely if they would consider providing one. A link to a gitub repo would suffice.

We also do not need support all mods under the sun, only the most used ones (like the MSX tileset to start with). If someone wants to play with a mod that is not on our list, they can add it them self and open a PR.

@mnacamura, what do you think?

@svenkeidel
Copy link
Contributor

svenkeidel commented Apr 6, 2020

Other nix packages like Emacs also allow to add plugins. In case of emacs this is possible with the emacsWithPackages function (https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/emacs/wrapper.nix#L9).

For cataclysm I would imagine a function cataclysmWithMods( mods: [ mods.mod1 mods.mod2 ]). @mnacamura, it should be easy to convert your overlay to such a function.

@mnacamura
Copy link
Contributor

mnacamura commented Apr 8, 2020

@svenkeidel Thank you for providing me many of useful information. It seems likely to be going okay.

I created a package plugin interface. You can now define a mod package like this. You can also build games with mods like this:

cataclysm-dda.withMods (mods: with mods; [ tileset.UndeadPeople ...])

To add custom mods, you can do something like

let
  customMods = self: super: lib.recursiveUpdate super {
    soundpack.AwesomeSounds = cataclysmDDA.buildSoundPack { ... };
  };
in
cataclysm-dda.withMods (mods: with mods.extend customMods; [
  tileset.UndeadPeople
  soundpack.AwesomeSounds
])

Comments and suggestions are welcome.

@svenkeidel
Copy link
Contributor

svenkeidel commented Apr 8, 2020

@mnacamura, amazing work! This plugin architecture drastically improves the user friendliness of the game on nix.

I just tested it with nix-build -E 'with import ~/nixpkgs/ {}; pkgs.cataclysm-dda.withMods (mods: with mods; [ tileset.UndeadPeople ]) and it works perfectly. Edit: also works for cataclysm-dda-git.

Just one more thing. Could you please add the instructions of your previous message as documentation to the games/cataclysm-dda/default.nix file? This way users can learn how to use this plugin architecture.

@svenkeidel
Copy link
Contributor

I'm ok with merging, but I don't have commit rights.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review-may-2019/3032/144

@worldofpeace worldofpeace merged commit 55dcf62 into NixOS:master Apr 20, 2020
@worldofpeace
Copy link
Contributor

@mnacamura, amazing work! This plugin architecture drastically improves the user friendliness of the game on nix.

I just tested it with nix-build -E 'with import ~/nixpkgs/ {}; pkgs.cataclysm-dda.withMods (mods: with mods; [ tileset.UndeadPeople ]) and it works perfectly. Edit: also works for cataclysm-dda-git.

Just one more thing. Could you please add the instructions of your previous message as documentation to the games/cataclysm-dda/default.nix file? This way users can learn how to use this plugin architecture.

I'd recommend somehow adding that as documentation into the nixpkgs manual.

@mnacamura
Copy link
Contributor

@worldofpeace Thank you for merging. I am not sure how to correctly add a section to nixpkgs manual. The document is at the moment prepared as README.md in /pull/84873. Do you think it is sufficent to move the README to doc/builders/packages/?

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

5 participants