Skip to content

phira{,-unwrapped,-free}: init at 0.6.7#426525

Merged
SuperSandro2000 merged 1 commit intoNixOS:masterfrom
UlyssesZh:phira
Nov 6, 2025
Merged

phira{,-unwrapped,-free}: init at 0.6.7#426525
SuperSandro2000 merged 1 commit intoNixOS:masterfrom
UlyssesZh:phira

Conversation

@UlyssesZh
Copy link
Member

@UlyssesZh UlyssesZh commented Jul 18, 2025

I wrote a patch to make the game load assets from and download data to ~/.local/share/phira instead of the installation dir (among other patches to fix the build). Currently it seems to work without flaw on Linux.

The build on macOS cannot launch because the window creation with GL capabilities fails, but it can probably be due to I am testing in a VM (where I cannot seem to write some code myself to use GLFW to create a window, either). More testing is needed.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and others READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 9.needs: reviewer This PR currently has no reviewers requested and needs attention. labels Jul 18, 2025
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. labels Jul 19, 2025
@nixpkgs-ci nixpkgs-ci bot removed the 9.needs: reviewer This PR currently has no reviewers requested and needs attention. label Jul 19, 2025
Copy link
Member

@Bot-wxt1221 Bot-wxt1221 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

patch lgtm

Copy link
Member

@Bot-wxt1221 Bot-wxt1221 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All thing worked!

Copy link
Member

@Bot-wxt1221 Bot-wxt1221 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Package work for me with x11

Image

@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jul 19, 2025
@Bot-wxt1221 Bot-wxt1221 self-requested a review July 19, 2025 07:32
@Bot-wxt1221 Bot-wxt1221 removed the 12.approvals: 1 This PR was reviewed and approved by one person. label Jul 19, 2025
@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jul 19, 2025
@Bot-wxt1221 Bot-wxt1221 removed the 12.approvals: 1 This PR was reviewed and approved by one person. label Jul 19, 2025
@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jul 19, 2025
@Bot-wxt1221
Copy link
Member

Let's unfree.

TeamFlos/phira#578 (comment)

@UlyssesZh
Copy link
Member Author

He didn't understand the question at first. He thought you were talking about some source codes.

@UlyssesZh
Copy link
Member Author

I added unfree for now. Will remove if fine after further response from upstream.

@Bot-wxt1221
Copy link
Member

Bot-wxt1221 commented Jul 19, 2025

Could there be a bin package?

TeamFlos/phira#298

Maybe we can replace the missing file with nixos logos.

@UlyssesZh
Copy link
Member Author

Unfortunately, their binary releases do not contain unfree features, either. Only the Android and iOS releases have unfree features.

@Bot-wxt1221
Copy link
Member

I suggest seperate the package and assests to prevent building on user's computer.

@UlyssesZh
Copy link
Member Author

UlyssesZh commented Jul 19, 2025

Maybe we can replace the missing file with nixos logos.

I suggest seperate the package and assests to prevent building on user's computer.

Yeah I think replacing unfree assets with free assets to make the package free is a good idea, but NixOS logos may not be suitable for a background. I will figure this out after the upstream developers respond to the question about assets copyright issues.

If the assets are unfree, I am thinking of having the package phira free, and it has an overridable parameter that specifies the assets. If unset, free substitute assets will be used. And then we can have another package phira-unfree, defined as phira.override { overrideAssets = somePackageContainingUnfreeAssets }.

The names of the two packages may alternatively be phira-free and phira respectively. I personally think either naming is okay.

makeWrapper $out/bin/phira-main $out/bin/phira \
${lib.optionalString stdenv.hostPlatform.isLinux "--suffix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libGL ]}"} \
--run '
export PHIRA_ROOT=''${PHIRA_ROOT-"$HOME/.local/share/phira"}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think putting the logic here is a good one. And without it we can make use of makeBinaryWrapper which should be faster.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to maintain a patch with too much logic. The performance impact from makeWrapper is very minimal.

@nixpkgs-ci nixpkgs-ci bot removed 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Jul 22, 2025
@UlyssesZh UlyssesZh changed the title phira: init at 0.6.7 phira{,-unwrapped}: init at 0.6.7 Jul 22, 2025
@UlyssesZh
Copy link
Member Author

I separated it into two packages phira and phira-unwrapped. The unwrapped package does not have assets but is free. This will fix the binary cache problem.

@Aleksanaa
Copy link
Member

  1. What are phira-main, phira-monitor and prpr-pbc in $out/bin? Are they supposed to work? Currently they just exit with segfault.
  2. It is copying the whole assets to ~/.local/share/phira on launch. Can we prevent that? Downloaded files should be in ~/.local/share/phira/data I guess.
  3. Would be good to provide a desktop file and an icon.

@UlyssesZh
Copy link
Member Author

What are phira-main, phira-monitor and prpr-pbc in $out/bin? Are they supposed to work? Currently they just exit with segfault.

phira-monitor needs to be wrapped with libGL and PHIRA_ROOT, and you also need to put a monitor-config.yml in PHIRA_ROOT with the fields email, password, server, roomId. Otherwise, it will just exist with segfault. It is used to see the current status of a multiplayer stage.

prpr-pbc is a command line tool to convert between different chart formats. It exits with segfaul if you do not provide any command line options.

phira-main is just unwrapped phira.

It is copying the whole assets to ~/.local/share/phira on launch. Can we prevent that? Downloaded files should be in ~/.local/share/phira/data I guess.

I would like to put assets and downloaded files in different locations, but then I need to do some large refactoring of the code base.

@UlyssesZh UlyssesZh changed the title phira{,-unwrapped}: init at 0.6.7 phira{,-unwrapped,-free}: init at 0.6.7 Jul 24, 2025
@UlyssesZh
Copy link
Member Author

A desktop file is now added.

phira-main and phira-monitor are now wrapped so that one can run them directly.

I added the package phira-free, which has a pure-color image as background and a free font (Ubuntu regular). The font does not support CJK, so it is a bit bad.

@Bot-wxt1221
Copy link
Member

could you rebase and nixfmt?

@UlyssesZh
Copy link
Member Author

Thank you for reminding. I will do that tomorrow.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to upstream this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See TeamFlos/phira#573. It currently cannot be merged upstream because it breaks build on Windows.

@SuperSandro2000 SuperSandro2000 added this pull request to the merge queue Nov 6, 2025
Merged via the queue into NixOS:master with commit 2f405ce Nov 6, 2025
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants