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

fallout-ce: init at 1.0.0 #239450

Merged
merged 2 commits into from
Oct 6, 2023
Merged

fallout-ce: init at 1.0.0 #239450

merged 2 commits into from
Oct 6, 2023

Conversation

hughobrien
Copy link
Contributor

@hughobrien hughobrien commented Jun 23, 2023

Description of changes

Introduce fallout-ce, an open source re-implementation of the classic game.

Note this is the engine only, the original game assets are still required (available on digital platforms). Build steps are adapted from their CI.

See also: fallout2-ce PR

REVIEW REQUESTS:

  1. This game uses the 'Sustainable Use License' which I do not see as listed in lib/licences.nix - how should we proceed? Here is the only other usage of it within nixpkgs. Edit: I've made a PR for the licence.
  2. The binary name is fallout-ce but the project is branded fallout1-ce, I have hewn to the original name but am open.
  3. I was unable to have substituteInPlace handle the ${foo} strings in the Makefile without triggering nix interpolation, so used a two pass process instead. I'm sure there's a better way of doing this.
Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • [] Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@hughobrien hughobrien mentioned this pull request Jun 23, 2023
12 tasks
@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1 labels Jun 23, 2023
@hughobrien hughobrien force-pushed the fallout-ce branch 3 times, most recently from 177abf7 to bd3b0bf Compare June 27, 2023 04:04
@hughobrien hughobrien requested a review from NobbZ June 28, 2023 19:17
@SuperSandro2000 SuperSandro2000 changed the title fallout-ce: init at v1.0.0 fallout-ce: init at 1.0.0 Jun 29, 2023
@hughobrien
Copy link
Contributor Author

@SuperSandro2000 fpattern PR #240569

@hughobrien hughobrien force-pushed the fallout-ce branch 2 times, most recently from eb9192e to bc8b9ed Compare June 30, 2023 21:06
@hughobrien hughobrien force-pushed the fallout-ce branch 3 times, most recently from 09fc7d2 to f9714a1 Compare July 3, 2023 17:19
@SuperSandro2000
Copy link
Member

Doesn't start for me

 ➜ ./result/bin/fallout-ce
free(): double free detected in tcache 2
Aborted (core dumped)

@hughobrien
Copy link
Contributor Author

hughobrien commented Jul 6, 2023

I haven't seen that error yet, are you on x86_64?

Remember the game needs the original assets, and further is particular about the casing of the file names (they describe this here).

I've tested it with the copy I have from Steam, but also from this copy on the Archive.

The correct way is to edit the fallout.cfg file but we can just use links as a test, the below works for me with the Archive version linked above.

curl -LO 'https://archive.org/download/FalloutAPostNuclearRolePlayingGameUSA/Fallout%20%28USA%29.zip'
unar Fallout%20%28USA%29.zip
unar "Fallout%20%28USA%29/Fallout - A Post Nuclear Role Playing Game (USA).bin"
cd "Fallout - A Post Nuclear Role Playing Game (USA)"
ln MASTER.DAT master.dat
ln CRITTER.DAT critter.dat
ln -s DATA data
nix-shell -I nixpkgs=/src/nixpkgs -p fallout-ce --command fallout-ce

screenshot-2023-07-06T00:08:00-04:00

@SuperSandro2000
Copy link
Member

I haven't seen that error yet, are you on x86_64?

Yes but I didn't do any of the setup steps. We should add a longDescription with a link to upstream or instructions how to get the game running. Or maybe we do a little setup script which guides you through it or takes a path as an argument.

@hughobrien
Copy link
Contributor Author

How about:

"fallout-ce is a community re-implmentation of the Fallout game engine, it does not include the necessary game data to run the game. To use fallout-ce, you must first obtain a copy of Fallout (available from e.g. Steam, GoG, or the Internet Archive). Depending on the version you acquire, some files may need to be renamed (in a case sensitive manner), or alternatively the fallout.cfg file updated to match. The game will not start if it cannot find the files it expects. By default the files master.dat, critter.dat and the data directory are all expected to be lowercase. For full details refer to the project's installation guide: https://github.com/alexbatalov/fallout1-ce#configuration"

@NobbZ
Copy link
Contributor

NobbZ commented Jul 12, 2023

There are other programs, that require much more setup.

Those do not have such a "longDescription". In my opinion this should not block the merge.

Also, there is no such thing for eg. openmw which also requires original game data.

In my opinion, people who want to use this software usually know in advance that they need the original game data, and if we want to provide helpers for setting everything up, we can provide them in another PR. This details should not block this PR to get the package in.

This extra PR could provide a wrapper and/or a module.

@TheBrainScrambler
Copy link
Contributor

TheBrainScrambler commented Aug 13, 2023

Are there strong feelings against pulling down one of archive.org's zips as part of the build process? I can find only one example of this in nixpkgs here

Yes there are: #208078
I believe fetching the full game from archive.org, or anywhere else, would be illegal.
From what I've found this asset downloading was committed in #185319 for an update of the package, which made it a bit hidden I guess ?
Now I don't know if providing a script to download the assets from somewhere illegal is permitted ? In any case the assets would end up as a different package since you can get them from many sources, be it from Steam, archive.org or anywhere else.

My take on this again would be to also provide a wrapper that chdir into ~/.local/share/fallout-ce and documents this somewhere, because that's how many other programs do it: #208078 (comment), I can also name OpenXcom, doom and quake ports, the Force Engine, gemrb, etc ... They normally all expect you to put the assets into some directory and read those at runtime.

Wargus was apparently an exception because it needs the assets at compile-time. sm64ex would be another such example.

@TheBrainScrambler
Copy link
Contributor

@TheBrainScrambler I've implemented your changes, would you mind taking a look? Also added you as a maintainer, hope you don't think it presumptive.

No it's fine to have me as maintainer, I would have eventually created a PR for this too had you not done it.
Did a review as PR: hughobrien#1

hughobrien added a commit to hughobrien/nixpkgs that referenced this pull request Aug 14, 2023
* review NixOS#239450

* Apply suggestions from code review

---------

Co-authored-by: Hugh O'Brien <github@hughobrien.ie>
@hughobrien
Copy link
Contributor Author

I used --run cd X instead of --chdir in makeWrapper as chdir doesn't appear to be able to handle dynamic targets (such as $HOME). Alternatives suggestions welcome.

@TheBrainScrambler
Copy link
Contributor

I used --run cd X instead of --chdir in makeWrapper as chdir doesn't appear to be able to handle dynamic targets (such as $HOME). Alternatives suggestions welcome.

Looks like there is the same problem at https://github.com/NixOS/nixpkgs/pull/248915/files (default.nix line 54). It got approved so I suppose right now there is no better way ...

@TheBrainScrambler
Copy link
Contributor

TheBrainScrambler commented Aug 14, 2023

I also noticed a problem: the wrapper ends up in $out/bin/wrapper.sh, but that means it will end up polluting $PATH. A simple workaround could be to rename it to .wrapper.sh. But it could be nice to use writeShellScript instead. It would also spare us of the shebang. I just fear that there might be a problem at line 7 of wrapper.sh with "${REQUIRED_FILES[@]}", which might be expanded by nix ? I suck at bash so would need your advice here.

@hughobrien
Copy link
Contributor Author

Good catches, fixed both I think by cribbing from Rise of the Triad.

unwrapped binary goes to libexec and we do the cd in the wrapper along with a direct exec.

@TheBrainScrambler
Copy link
Contributor

TheBrainScrambler commented Aug 15, 2023

hughobrien#2

Other than that it looks good to me

@TheBrainScrambler
Copy link
Contributor

TheBrainScrambler commented Aug 17, 2023

I just forgot something: you should squash all these commits into a single one with message "fallout-ce: init at 1.0.0". At least that would be if this PR only added one package. This should also include fallout2-ce somehow ... Not sure how it should be done, but there is definitively a need for squashing some commits.

@hughobrien
Copy link
Contributor Author

Yes absolutely, I'm just waiting for other feedback so I can avoid doing it twice.

@TheBrainScrambler
Copy link
Contributor

Well I was re-requested for a review because of the rebasing, so I suppose you didn't loose your time, but instead avoided the need for 2 reviews from others :p

@hughobrien
Copy link
Contributor Author

Polite request for a merge if everyone is satisfied.

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Sep 7, 2023
@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-already-reviewed/2617/1091

@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-already-reviewed/2617/1130

@amaxine amaxine merged commit 3374d2a into NixOS:master Oct 6, 2023
@hughobrien
Copy link
Contributor Author

Thank you @amaxine ! Please allow me to push my luck and invite you to take a look at this dosbox-x PR

@hughobrien hughobrien deleted the fallout-ce branch October 6, 2023 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes 12.approvals: 1 This PR was reviewed and approved by one reputable person
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants