perfect_dark: init at 0-unstable-2025-08-25#306767
perfect_dark: init at 0-unstable-2025-08-25#306767SigmaSquadron merged 2 commits intoNixOS:masterfrom
Conversation
|
In 35c30e19cd7a46597f336a08b1d9509a0fb4ba53 you add yourself as a maintainer, but this should be in a separate commit with the message: Also change the pull-request title to |
|
@yunfachi It's done! Sorry, I missed that the commit needed to be split.. that makes sense actually :) |
|
Upstream just accepted a PR I sent them, so I updated this PR too to remove the patch I had to carry. |
|
@qubitnano I'll create a new commit to make more changes. What do you think about the name Perfect Dark is trademarked by Microsoft. |
bdef7c2 to
4b6bed3
Compare
|
I now pushed a new squashed commit taking into account all the suggestions. Everyone is happy with the name |
I would prefer |
I read that part but it doesn't clear the ambiguity of this situation. And doesn't talk about potential trademark issues. That kind of projects already make many people anxious with respect to legality. For instance, the decomp of Ocarina of Time explicitly avoids any references to "Zelda" or "Ocarina of Time". I really don't like |
|
Also, the project says its license is MIT but I'm not even sure it's legal. It's obviously a derivative work of an unfree piece of software, so I don't really believe it can be MIT. I think it's important for us because if we mark it as free, its source and binary will be stored and distributed on This might become a source of pain if Microsoft decides to sue the project in the future, similarly to EDIT: For reference, sm64 and shipwright upstream projects don't have a license (and I think it makes sense) and are therefore considered |
The thing for me is that it kinda overly obscures what it's for, and usually shorter names are reserved for more 'fundamental' tools like Thankfully, the worst you can do is to have one or maybe several repos in nix-community that contain these packages, away from Big N's eyes... 👀 |
I am decidedly NOT a lawyer, but judging by the fact the repo contains reverse-engineered code that still compiles to the original binary, I think it would be easier to make the case that the repo contains the original developer's code and cannot be re-licensed under the MIT license by the reverse engineer. However, this is an upstream issue and for now we should follow what's written on the tin. Maybe add a generic unfree license in the mix of licenses so that it's marked as unfree software with (possibly) FOSS parts? |
Oh, it's really not about hiding it, or that there exists mentions of it in the project. We can mention trademark and registered name as much as we want. But naming a piece of software with a registered name, that's exactly what registering a name is supposed to protect from. For instance, the shipwright project is careful about not naming their project with a trademarked name but "Zelda" and "Ocarina of Time" are present hundreds of times in the source code and assets. Also, everyone knows what they are about, including Nintendo, so they're not hiding from anything. The issue I see here, is officially presenting this piece of software with a trademarked name that we don't own or have a license for. I think the shipwright project have the exact same understanding of the situation as me on this. They and I can be wrong as IANAL. |
This review is now outdated, as it has become clear that the potential legal issues with upstream will not affect us, as derivations are generally not considered to be derivative works of a project.
|
More changes
diff --git a/pkgs/by-name/pe/perfect_dark/package.nix b/pkgs/by-name/pe/perfect_dark/package.nix
index 0c5fc63652de..875980016495 100644
--- a/pkgs/by-name/pe/perfect_dark/package.nix
+++ b/pkgs/by-name/pe/perfect_dark/package.nix
@@ -54,7 +54,8 @@ stdenv.mkDerivation (finalAttrs: {
--replace-fail "git rev-parse --abbrev-ref HEAD" \
"echo port"
''
- # Point toward the compiled binary and not the shell wrapper.
+ # Point toward the compiled binary and not the shell wrapper since
+ # the rom auto-detection logic is not needed in this build.
+ ''
substituteInPlace dist/linux/io.github.fgsfdsfgs.perfect_dark.desktop \
--replace-fail "Exec=io.github.fgsfdsfgs.perfect_dark.sh" \
@@ -77,17 +78,17 @@ stdenv.mkDerivation (finalAttrs: {
installPhase = ''
runHook preInstall
- pushd ..
+ pushd ..
install -Dm755 build/pd.* $out/bin/io.github.fgsfdsfgs.perfect_dark
install -Dm644 dist/linux/io.github.fgsfdsfgs.perfect_dark.desktop \
- -t $out/share/applications/
+ -t $out/share/applications
install -Dm644 dist/linux/io.github.fgsfdsfgs.perfect_dark.png \
- -t $out/share/icons/hicolor/scalable/apps/
+ -t $out/share/icons/hicolor/256x256/apps
install -Dm644 dist/linux/io.github.fgsfdsfgs.perfect_dark.metainfo.xml \
- -t $out/share/metainfo/
-
+ -t $out/share/metainfo
popd
+
runHook postInstall
'';
@@ -98,18 +99,16 @@ stdenv.mkDerivation (finalAttrs: {
shooter Perfect Dark to modern systems.
You'll need to provide a copy of the ROM at
- `$HOME/.local/share/perfectdark/data/pd.${romID}.z64`
- to launch the game.
-
- You can also change the ROM variant of this game with an
- expression like this:
+ `$HOME/.local/share/perfectdark/data/pd.${romID}.z64` to launch
+ the game.
- `pd.override { romID = "jpn-final" }`
+ Though `ntsc-final` is the recommended default, you can change
+ the ROM variant of this game via an override like so:
- Supported romIDs are `${lib.generators.toPretty { } roms}`.
+ `perfect_dark.override { romID = "jpn-final"; }`
- `ntsc-final` the default as it is the only recommended one by
- upstream.
+ Supported `romID` values are are `${lib.generators.toPretty { }
+ roms}`.
'';
homepage = "https://github.com/fgsfdsfgs/perfect_dark/";
license = with lib.licenses; [
@@ -117,10 +116,6 @@ stdenv.mkDerivation (finalAttrs: {
mit
# tools/mkrom/gzip
gpl3Plus
- # The project's original work is licensed under MIT, but a lot of
- # it can be seen as a derivative work of an unfree piece of
- # software. We account for that here.
- # unfree
];
maintainers = with lib.maintainers; [
PaulGrandperrin
|
|
I don’t want to wade into the discussion about whether this constitutes warez we shouldn’t be trying to package at all, but there is seriously no way we can merge a derivative work of a byte‐for‐byte decompilation as |
|
Or |
|
If this was packaging the original decompilation and not a modified fork, then the output produced by building it would be bit‐for‐bit identical to the copyrighted executable code in the original game. I really don’t think there’s any argument for the outputs of this derivation not being encumbered by proprietary copyright. |
|
Oh, sorry, that was my bad. This is supposed to be unfree, and I forgot to remove the comment. |
9ba2736 to
7901c55
Compare
|
suggestion (non-blocking): Rewrite diff --git a/pkgs/by-name/pe/perfect_dark/package.nix b/pkgs/by-name/pe/perfect_dark/package.nix
index dcffb421d8eb..3c3b598551c1 100644
--- a/pkgs/by-name/pe/perfect_dark/package.nix
+++ b/pkgs/by-name/pe/perfect_dark/package.nix
@@ -116,9 +116,7 @@ stdenv.mkDerivation (finalAttrs: {
mit
# tools/mkrom/gzip
gpl3Plus
- # The project's original work is licensed under MIT, but a lot of
- # it can be seen as a derivative work of an unfree piece of
- # software. We account for that here.
+ # Derivative work of "Perfect Dark" (C) 2000 RARE Ltd.
unfree
];
maintainers = with lib.maintainers; [
I think having this licensing comment would be more concise and informative as it references the copyright holder by name instead of being vague ("it can be seen", "we account for 'that'") |
qubitnano
left a comment
There was a problem hiding this comment.
nixpkgs-review result
Generated using nixpkgs-review.
Command: nixpkgs-review pr 306767
Commit: e8808468d434f582bea786c21a06e43c0352b6d1
x86_64-linux
✅ 1 package built:
- perfect_dark
A PC port of Perfect Dark based on the decompilation of the Nintendo 64 game Co-authored-by: Jasi <normalc@posteo.net> Co-authored-by: Fernando Rodrigues <alpha@sigmasquadron.net> Signed-off-by: Fernando Rodrigues <alpha@sigmasquadron.net>
|
I went through all the comments and changes and this is great! There's only one thing that annoys me, the "qualified application domain name" @normalcea wouldn't |
|
About the conversation about the "unfree" license, I just want to add that we had a similar conversation at the beginning of the PR and that we came to the same conclusion: hydra should never build this package and that an "unfree" license both achieved this goal and made sense in and of itself. |
This ultimately isn't that much of an issue because Also this would involve also having to patch the desktop file as well and not just the executable which just adds more noise to the derivation to solve an issue that isn't ours to solve. |
| ''; | ||
|
|
||
| preConfigure = '' | ||
| patchShebangs --build . |
There was a problem hiding this comment.
| patchShebangs --build . | |
| patchShebangs --build tools/assetmgr |
(non-blocking): Don't recursively patch all files in source, but only the files we need for building.
There was a problem hiding this comment.
These types of changes can be done in a follow-up PR, but it doesn't hurt to document them here for reference.
keenanweaver
left a comment
There was a problem hiding this comment.
Game playing as expected on x86_64-linux. Compiled and played with all three supported ROM regions.
Did not test aarch64.
nixpkgs-review result for #306767
Generated using nixpkgs-review-gha
Command: nixpkgs-review pr 306767
Commit: cad17194fe73ab224313a157856c08a36bcbf15e (subsequent changes)
Merge: 967262ac17224e11c5604a847c7d9b9d7c7db1c5
Logs: https://github.com/keenanweaver/nixpkgs-review-gha/actions/runs/17384040207
x86_64-linux
✅ 1 package built:
- perfect_dark
aarch64-linux
✅ 1 package built:
- perfect_dark
|
Thank you everyone for sticking around through such a turbulent PR. It should now be easier to collaboratively make changes to this package. |
Description of changes
A PC port of Perfect Dark based on the decompilation of the Nintendo 64 game
https://github.com/fgsfdsfgs/perfect_dark
To play the game, you need to put the corresponding ROM at
$XDG_DATA_HOME/perfectdark/data/pd.ntsc-final.z64and thennix run github:NixOS/nixpkgs/pull/306767/head#pd.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.