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

perfect_dark: init at 0-unstable-2024-09-02 #306767

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

PaulGrandperrin
Copy link
Contributor

@PaulGrandperrin PaulGrandperrin commented Apr 25, 2024

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.z64 and then nix run github:NixOS/nixpkgs/pull/306767/head#pd.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • 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/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 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.

Add a 👍 reaction to pull requests you find important.

@PaulGrandperrin PaulGrandperrin changed the title pd: init at b4f7f467c New package: pd (PC port of Perfect Dark) Apr 25, 2024
@PaulGrandperrin PaulGrandperrin marked this pull request as ready for review April 25, 2024 12:43
@yunfachi
Copy link
Member

yunfachi commented Apr 25, 2024

In 35c30e1 you add yourself as a maintainer, but this should be in a separate commit with the message: maintainers: add <handle>.

Also change the pull-request title to pd: init at <version>.

@PaulGrandperrin
Copy link
Contributor Author

@yunfachi It's done!

Sorry, I missed that the commit needed to be split.. that makes sense actually :)

@PaulGrandperrin
Copy link
Contributor Author

Upstream just accepted a PR I sent them, so I updated this PR too to remove the patch I had to carry.

@PaulGrandperrin PaulGrandperrin changed the title pd: init at b4f7f467c pd: init at a0f855003 Apr 25, 2024
pkgs/by-name/pd/pd/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/pd/pd/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/pd/pd/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/pd/pd/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/pd/pd/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/pd/pd/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/pd/pd/package.nix Outdated Show resolved Hide resolved
@PaulGrandperrin PaulGrandperrin changed the title pd: init at a0f855003 pd: init at 0-unstable-2024-04-25 Apr 26, 2024
@PaulGrandperrin
Copy link
Contributor Author

@qubitnano I'll create a new commit to make more changes.

What do you think about the name pd? That's what upstream uses for the binary, but the repo is named "perfect_dark".

Perfect Dark is trademarked by Microsoft.

pkgs/by-name/pd/pd/package.nix Outdated Show resolved Hide resolved
@PaulGrandperrin
Copy link
Contributor Author

I now pushed a new squashed commit taking into account all the suggestions.
The version has been updated in the commit message and this PR title.

Everyone is happy with the name pd?

@yunfachi
Copy link
Member

yunfachi commented Apr 26, 2024

Everyone is happy with the name pd?

I would prefer perfect-dark, but I won't insist.
You can read https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md#package-naming to make a choice.
In addition, please consider the ripgrep package, which has a single executable rg, but is called ripgrep.

@PaulGrandperrin
Copy link
Contributor Author

You can read https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md#package-naming to make a choice.

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 pd (it's slang for fagg*t in french) but I thought maintainers might push back on perfect_dark.

@PaulGrandperrin
Copy link
Contributor Author

PaulGrandperrin commented Apr 26, 2024

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 cache.nixos.org.

This might become a source of pain if Microsoft decides to sue the project in the future, similarly to yuzu.

EDIT: For reference, sm64 and shipwright upstream projects don't have a license (and I think it makes sense) and are therefore considered unfree by NixOS.

@pluiedev
Copy link
Contributor

You can read https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md#package-naming to make a choice.

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 pd (it's slang for fagg*t in french) but I thought maintainers might push back on perfect_dark.

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 ar and cc, and it's kinda silly to me that Perfect Dark gets to have pd purely to disguise it from Nintendo's eyes. Really, if that's the sole purpose, then there needs to be a formal policy drafted regarding the status of Nintendo property, or other pieces of software that could contain Nintendo property, on Nixpkgs.

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... 👀

@pluiedev
Copy link
Contributor

pluiedev commented Apr 26, 2024

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 cache.nixos.org.

This might become a source of pain if Microsoft decides to sue the project in the future, similarly to yuzu.

EDIT: For reference, sm64 and shipwright upstream projects don't have a license (and I think it makes sense) and are therefore considered unfree by NixOS.

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?

@PaulGrandperrin
Copy link
Contributor Author

PaulGrandperrin commented Apr 26, 2024

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 ar and cc, and it's kinda silly to me that Perfect Dark gets to have pd purely to disguise it from Nintendo's eyes. Really, if that's the sole purpose, then there needs to be a formal policy drafted regarding the status of Nintendo property, or other pieces of software that could contain Nintendo property, on Nixpkgs.

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... 👀

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.

@PaulGrandperrin
Copy link
Contributor Author

In the end, I don't care too much because I think the risks are minimal. It's Microsoft, not Nintendo, and yes, they are less crazy about this kind of stuff.

So just tell me what you would like:

  • pd/perfect_dark/perfect-dark
  • MIT/non-free

@PaulGrandperrin
Copy link
Contributor Author

Oh, and for information, I did put "Perfect Dark" in the description so that it'll show up when searching for it on search.nixos.org. Just like Shipwright with Ocarina of Time.

@PaulGrandperrin
Copy link
Contributor Author

I pushed a new version with an added unfree license and some comment explaining why, as suggested by @pluiedev

@PaulGrandperrin
Copy link
Contributor Author

I forgot to say that I added the pie hardening flag as it is disabled by default.
I know it's not too important, but a networking multiplayer version is being worked on.

@PaulGrandperrin
Copy link
Contributor Author

I pushed 3 changes:

  • The expression now supports providing the 3 alternative ROM variants.
  • I created a longdescription to explain how to select a ROM variant and how to provide it.
  • I removed the explicitly set -Og optimization flag so that the one from stdenv is used (defaults to-O2)

@PaulGrandperrin
Copy link
Contributor Author

For info, at this point, I really don't see anything to add.
I can't really add a desktop shortcut as the project doesn't provide any icons and official ones would be copyrighted.
All the suggestions from all the reviewers have been implemented.
I played the game a few hours and everything is working perfectly.

So, feel free to merge whenever you like.

@PaulGrandperrin PaulGrandperrin changed the title pd: init at 0-unstable-2024-04-25 pd: init at 0-unstable-2024-05-31 Jun 5, 2024
@PaulGrandperrin
Copy link
Contributor Author

Hi @yunfachi @qubitnano @pluiedev !

I was thinking that last month wasn't a good time to get this PR merged as maintainers were working on 24.05..
Now that it's released, should I do something more to get it merged? Like, mention some people in particular?

I also just updated it to the latest version.

Have a good day

pkgs/by-name/pd/pd/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/pd/pd/package.nix Outdated Show resolved Hide resolved
@PaulGrandperrin
Copy link
Contributor Author

@yunfachi I merged and squashed your suggestions, thanks!

@PaulGrandperrin
Copy link
Contributor Author

@qubitnano I merged and squashed your suggestion, substituteInPlace is cool, thanks!

@PaulGrandperrin PaulGrandperrin changed the title pd: init at 0-unstable-2024-05-31 perfectdark: init at 0-unstable-2024-08-06 Aug 12, 2024
@PaulGrandperrin
Copy link
Contributor Author

Hi!

I just pushed the latest version!

I also changed my mind about the name of the package, I'm finally going for "perfectdark" because that's the name that the app is using in $XDG_DATA_HOME and it feels right. ("perfect_dark" only exist in the github URL and "perfect-dark" is never mentioned).

And finally, I'm now pretty sure this PR slipped through the eyes of the committers, so I'm going to ping 2 handles that comes to my mind: @ElvishJerricco @SuperSandro2000 ;)

A PC port of Perfect Dark based on the decompilation of the Nintendo 64 game
@PaulGrandperrin PaulGrandperrin changed the title perfectdark: init at 0-unstable-2024-08-06 perfect_dark: init at 0-unstable-2024-09-02 Sep 7, 2024
@PaulGrandperrin
Copy link
Contributor Author

  • updated to latest version
  • added .desktop and icon
  • changed name to perfect_dark to be the same as the flatpak
  • updated descriptions with the ones from the flatpak metadata
  • ran nix-fmt
  • rebased on latest master branch

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