open-adventure: init at 1.20#370955
Conversation
SigmaSquadron
left a comment
There was a problem hiding this comment.
Welcome to Nixpkgs! Thanks for contributing this game.
|
@SigmaSquadron Thank you for your corrections! I've followed your suggestions and added the upstream tests. Btw, I am not quite sure if the commands I added under the |
SigmaSquadron
left a comment
There was a problem hiding this comment.
substituteInPlace was indeed the right call. It's pretty normal to substitute FHS paths with Nix paths in patchPhase.
|
|
|
@SigmaSquadron I have followed your corrections, and I had also created an issue on upstream to apply the fix, however they haven't answered. Furthermore, I was reviewing other issues on their repository and lately they are taking a long time to solve them (even some weeks), probably because it is not a project under development. So, maybe the package can be added now (I'll be paying attention to the appliance of the fix, and will update the package accordingly). Btw, I don't know if the commits should be squashed 😅. Regards, |
When in doubt, squash! This PR should have two commits total. |
There was a problem hiding this comment.
| python3Packages.pyyaml |
pyyaml isn't a program that can be executed, so it goes to buildInputs.
There was a problem hiding this comment.
| # Replace /bin/echo with the actual path in the nix store |
I'm a fan of superfluous comments myself, but this is a pretty well-known pattern in Nixpkgs, and doesn't really need to be there. If you feel strongly about it, feel free to leave it here; this isn't a blocking comment.
There was a problem hiding this comment.
| preInstall = '' | |
| mkdir -vp "$out/bin" "$out/share/man/man6" "$out/share/applications/" "$out/share/icons/hicolor/scalable/apps" | |
| ''; | |
| installPhase = '' | |
| runHook preInstall | |
| cp ./advent $out/bin | |
| runHook postInstall | |
| ''; | |
| postInstall = '' | |
| cp ./advent.6 $out/share/man/man6 | |
| cp ./advent.desktop $out/share/applications | |
| cp ./advent.svg $out/share/icons/hicolor/scalable/apps | |
| ''; | |
| installPhase = '' | |
| runHook preInstall | |
| mkdir -vp "$out/bin" "$out/share/man/man6" "$out/share/applications/" "$out/share/icons/hicolor/scalable/apps" | |
| cp ./advent $out/bin | |
| cp ./advent.6 $out/share/man/man6 | |
| cp ./advent.desktop $out/share/applications | |
| cp ./advent.svg $out/share/icons/hicolor/scalable/apps | |
| runHook postInstall | |
| ''; |
This should also use the install command whenever possible. I don't know the package filesystem layout to suggest an implementation.
bf9896c to
fc15b8a
Compare
|
Thank you for your corrections, I've applied them now |
There was a problem hiding this comment.
| buildFlags = '' | |
| advent.6 | |
| ''; | |
| buildFlags = [ | |
| "advent.6" | |
| ]; |
buildFlags is a list.
fc15b8a to
1bd30bd
Compare
|
Ahh ok thank you. |
There was a problem hiding this comment.
$ ./results/open-adventure-x86_64-linux/bin/advent
Welcome to Adventure!! Would you like instructions?
nixpkgs-review result
Generated using nixpkgs-review.
Command: nixpkgs-review pr 370955
x86_64-linux
✅ 1 package built:
- open-adventure
|
Gotta say, pretty fun game :) |
|
Jsjsj yeah. Thank you for guiding me in this process :) |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-already-reviewed/2617/2242 |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
TomaSajt
left a comment
There was a problem hiding this comment.
The changes look fine, left some possible improvement ideas.
| # https://gitlab.com/esr/open-adventure/-/issues/70 | ||
| substituteInPlace Makefile --replace-fail "--template " "--template=" | ||
|
|
||
| substituteInPlace tests/tapview --replace-fail "/bin/echo" ${lib.getExe' coreutils "echo"} |
There was a problem hiding this comment.
Does this only run during testing? If yes, I just recommend patching it to just be echo, since we know it's on our PATH.
| mkdir -vp "$out/bin" "$out/share/man/man6" "$out/share/applications/" "$out/share/icons/hicolor/scalable/apps" | ||
| install -m 555 ./advent $out/bin | ||
| install -m 444 ./advent.6 $out/share/man/man6 | ||
| install -m 444 ./advent.desktop $out/share/applications | ||
| install -m 444 ./advent.svg $out/share/icons/hicolor/scalable/apps |
There was a problem hiding this comment.
A possible alternative that doesn't need mkdir. You don't need to do this if you don't want to.
| mkdir -vp "$out/bin" "$out/share/man/man6" "$out/share/applications/" "$out/share/icons/hicolor/scalable/apps" | |
| install -m 555 ./advent $out/bin | |
| install -m 444 ./advent.6 $out/share/man/man6 | |
| install -m 444 ./advent.desktop $out/share/applications | |
| install -m 444 ./advent.svg $out/share/icons/hicolor/scalable/apps | |
| install -Dm555 ./advent -t $out/bin | |
| install -Dm444 ./advent.6 -t $out/share/man/man6 | |
| install -Dm444 ./advent.desktop -t $out/share/applications | |
| install -Dm444 ./advent.svg -t $out/share/icons/hicolor/scalable/apps |
Also, man-pages should ideally be installed via installManPage from the installShellFiles helper script collection. IMO this is not a hard requirement, so you can keep it as is.
| python3Packages.pyyaml | ||
| libedit | ||
| ]; | ||
|
|
There was a problem hiding this comment.
consider setting strictDeps = true; to ensure that you've added your deps to the correct place (native vs non-native inputs).
| strictDeps = true; | |
|
wow I just missed the merge by a minute :) Oh well, the improvements can still be made if you want to, |
|
Thanks! I will take into account this improvements in my future contributions :) |
|
Successfully created backport PR for |
open-adventure is a forward-port of the Crowther/Woods Adventure 2.5 game from 1995
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.