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

zxtune: init at r5054 #265519

Merged
merged 2 commits into from
Nov 24, 2023
Merged

zxtune: init at r5054 #265519

merged 2 commits into from
Nov 24, 2023

Conversation

EBADBEEF
Copy link
Contributor

@EBADBEEF EBADBEEF commented Nov 4, 2023

Description of changes

zxtune is a cross-platform chiptunes music player.

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/)
  • 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.

@NixOSInfra NixOSInfra added the 12. first-time contribution This PR is the author's first one; please be gentle! label Nov 4, 2023
@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 Nov 4, 2023
Copy link
Member

@FliegendeWurst FliegendeWurst left a comment

Choose a reason for hiding this comment

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

Thanks for packaging zxtune!

Package builds and zxtune-qt launches.

Result of nixpkgs-review pr 265519 run on x86_64-linux 1

1 package built:
  • zxtune

in with lib;
stdenv.mkDerivation rec {
pname = "zxtune";
version = "r5054";
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
version = "r5054";
version = "5054";

Usually the version attribute starts with a digit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

src = fetchFromBitbucket {
owner = "zxtune";
repo = "zxtune";
rev = "${version}";
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
rev = "${version}";
rev = "r${version}";

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

platformName = "linux";
staticBuildInputs = [ boost zlib ]
++ lib.optional withQt (if (supportWayland) then qt5.qtwayland else qt5.qtbase);
in with lib;
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure, but I believe with lib; should be avoided in front of package definitions. This one uses only a few lib.* functions.

@EBADBEEF EBADBEEF force-pushed the master branch 2 times, most recently from d05c42a to f0e92db Compare November 12, 2023 19:34
@EBADBEEF
Copy link
Contributor Author

Thanks for the review!

Copy link
Member

@FliegendeWurst FliegendeWurst left a comment

Choose a reason for hiding this comment

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

Result of nixpkgs-review pr 265519 run on x86_64-linux 1

1 package built:
  • zxtune

I'm assuming you tested the off-by-default file/audio backends.

'';
homepage = "https://zxtune.bitbucket.io/";
license = licenses.gpl3;
platforms = platforms.linux;
Copy link
Member

Choose a reason for hiding this comment

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

This is set to Linux because you can't test on Darwin, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exactly. I suspect there will need to be some more tricks in the makefile stuff.

Copy link
Member

Choose a reason for hiding this comment

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

Good to know (and perfectly acceptable, most maintainers can't test on Darwin). It was a bit confusing to see all those isLinux / isDarwin checks and then this line at the end.

I'd put a short comment above the "platforms =" line so future readers are not confused.

"support_${name}=" + (if (var) then "1" else "");
makeOptsCommon = [
''-j$NIX_BUILD_CORES''
''root.version=${version}''
Copy link
Member

@FliegendeWurst FliegendeWurst Nov 12, 2023

Choose a reason for hiding this comment

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

Not r${version}?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, should be, will do.

@EBADBEEF
Copy link
Contributor Author

Result of nixpkgs-review pr 265519 run on x86_64-linux 1

1 package built:
I'm assuming you tested the off-by-default file/audio backends.

Uh oh. You caught me! It doesn't build with SDL2 enabled.

@EBADBEEF EBADBEEF force-pushed the master branch 2 times, most recently from 7a9afe6 to 855771c Compare November 13, 2023 19:59
@EBADBEEF
Copy link
Contributor Author

OK, I think I have addressed all the review feedback now! Thanks for the thoughtful comments.

  • tested build and functionality with all optional flags
  • added comment about darwin/windows platform support

Copy link
Member

@FliegendeWurst FliegendeWurst left a comment

Choose a reason for hiding this comment

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

Result of nixpkgs-review pr 265519 run on x86_64-linux 1

1 package built:
  • zxtune

@FliegendeWurst FliegendeWurst added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Nov 13, 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-ready-for-review/3032/2919

Copy link
Member

@pbsds pbsds left a comment

Choose a reason for hiding this comment

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

Result of nixpkgs-review pr 265519 run on x86_64-linux 1

1 package built:
  • zxtune

Welcome to nixpkgs! This one is looking pretty good!

Runs fine on my end, just some small nits and improvements

preFixup = lib.optionalString withQt ''
wrapQtApp "$out/bin/zxtune-qt"
'';

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
passthru.updateScript = nix-update-script {
attrPath = "zxtune";
extraArgs = [ "--version-regex" "r(.*)" ];
};

{ lib
, stdenv
, fetchFromBitbucket
, boost
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
, boost
, nix-update-script
, boost

];

postPatch = ''
sed -e 's@OpenAL/@AL/@g' -i src/sound/backends/gates/openal_api.h
Copy link
Member

@pbsds pbsds Nov 19, 2023

Choose a reason for hiding this comment

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

Suggested change
sed -e 's@OpenAL/@AL/@g' -i src/sound/backends/gates/openal_api.h
substituteInPlace src/sound/backends/gates/openal_api.h \
--replace "OpenAL/" "AL/"

Comment on lines 94 to 97
make ${builtins.toString makeOptsCommon} -C apps/xtractor
make ${builtins.toString makeOptsCommon} -C apps/zxtune123
'' + lib.optionalString withQt ''
make ${builtins.toString (makeOptsCommon ++ makeOptsQt)} -C apps/zxtune-qt
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
make ${builtins.toString makeOptsCommon} -C apps/xtractor
make ${builtins.toString makeOptsCommon} -C apps/zxtune123
'' + lib.optionalString withQt ''
make ${builtins.toString (makeOptsCommon ++ makeOptsQt)} -C apps/zxtune-qt
runHook preBuild
make ${builtins.toString makeOptsCommon} -C apps/xtractor
make ${builtins.toString makeOptsCommon} -C apps/zxtune123
'' + lib.optionalString withQt ''
make ${builtins.toString (makeOptsCommon ++ makeOptsQt)} -C apps/zxtune-qt
'' + ''
runHook postBuild

@EBADBEEF
Copy link
Contributor Author

Changes:

  • Rebased (darn it is hard to track my changes with this, sorry... not really sure the best way to work with github here)
  • Moved to pkgs/by-name
  • Enabled flac, mp3, vorbis by default (it's already a big package, might as well add this functionality)
  • Followed @pbsds review suggestions (build hooks, substituteInPlace instead of sed, nix-update)
  • Regarding nix-update... I didn't know that existed, thanks! However, it doesn't support bitbucket! Hopefully that will change soon => Support bitbucket.org Mic92/nix-update#208 ;-) Also noticed I can't use "refs/tags" syntax for rev with nix-update.

@pbsds
Copy link
Member

pbsds commented Nov 22, 2023

@ofborg eval

I've been listening to my old game soundtrack rips for nearly an hour now. Love this

longDescription = ''
Player of computer music from ZX Spectrum, Amstrad, Sam Coupe, PC, Amiga,
Atari, Acorn, C64, SNES, Nes, Sega Master System, GameBoy, TurboGrafX,
MSX, NDS, and more.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
MSX, NDS, and more.
MSX, NDS, and more. Powered by vgmstream.

For the sake of discoverability

Copy link
Member

@pbsds pbsds Nov 22, 2023

Choose a reason for hiding this comment

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

(ofborg seems to need the force push anyway)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice idea. Updated description and included other notable libraries. Also bumped version to r5055.

Copy link
Contributor

Successfully created backport PR for release-23.11:

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 10.rebuild-linux: 1 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 12. first-time contribution This PR is the author's first one; please be gentle!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants