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

Adding stl-thumb derivation #370942

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

Conversation

SyntaxualSugar
Copy link

stl-thumb is a thumbnail generator for STL and OBJ files (helpful for file managers). It is tested against Gnome and KDE (KDE with an extra plugin needed), and Windows, but any file manager should work.

stl-thumb

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/)
  • 25.05 Release Notes (or backporting 24.11 and 25.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.

Add a 👍 reaction to pull requests you find important.

@SyntaxualSugar SyntaxualSugar marked this pull request as ready for review January 4, 2025 19:37
@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin and removed 10.rebuild-darwin: 1-10 labels Jan 4, 2025
Copy link
Contributor

@SigmaSquadron SigmaSquadron left a comment

Choose a reason for hiding this comment

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

  1. For consistency with other packages, consider running nix-shell -p nixpkgs-hammering --run "nixpkgs-hammer stl-thumb" in the root Nixpkgs directory, and make the edits the program tells you to.

  2. Please review the Commit Conventions and squash your commits appropriately. There should be two commits total:

    1. maintainers: add SyntaxualSugar
    2. stl-thumb: init at 0.5.0

@@ -0,0 +1,62 @@
{
lib,
pkgs,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
pkgs,

We don't call pkgs inside Nixpkgs.

{
lib,
pkgs,
stdenv,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
stdenv,

Please remove all unused inputs.

--add-needed ${libGL}/lib/libEGL.so \
$out/bin/stl-thumb
'';
meta = with lib; {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
meta = with lib; {
meta = {

Nested with; expressions is an anti-pattern.

src = fetchFromGitHub {
owner = "unlimitedbacon";
repo = pname;
rev = "6bc90573b2cddda3f8916b2716898298475406c0";
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
rev = "6bc90573b2cddda3f8916b2716898298475406c0";
tag = "v${version}";


src = fetchFromGitHub {
owner = "unlimitedbacon";
repo = pname;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
repo = pname;
repo = "stl-thumb";

Avoid interpolating pname.

}:
pkgs.rustPlatform.buildRustPackage rec {
pname = "stl-thumb";
version = "0.5.0-6bc9057";
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
version = "0.5.0-6bc9057";
version = "0.5.0";

sha256 = "sha256-G5zk1FR18rhWdC1S1cGOcsAHRpq03A7+ivNs4sUpl54=";
};

doCheck = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a comment explaining why we're skipping tests.

Copy link
Author

Choose a reason for hiding this comment

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

There are 3 tests in the project and all of them need an xdg runtime configured. I haven't been able to figure out how to get it working within the check phase.

Copy link
Contributor

Choose a reason for hiding this comment

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

If they only need a dir create a dir with mktemp -d then and pass it to a environment variable in preCheck

fontconfig
libX11
];
propagatedBuildInputs = [
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we propagating these?

Copy link
Author

Choose a reason for hiding this comment

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

I believe I was propagating them while trying to get the tests to work. For my education, what is the downside of propagating inputs?

@SyntaxualSugar
Copy link
Author

  1. For consistency with other packages, consider running nix-shell -p nixpkgs-hammering --run "nixpkgs-hammer stl-thumb" in the root Nixpkgs directory, and make the edits the program tells you to.

    1. Please review the Commit Conventions and squash your commits appropriately. There should be two commits total:

      1. maintainers: add SyntaxualSugar
      2. stl-thumb: init at 0.5.0

Thank you for all of the feedback! I will clean up the changes and come back with a new pull request.

@SigmaSquadron
Copy link
Contributor

There's... really no need. Just force-push this one. It's best if we don't lose the review history.

@SigmaSquadron SigmaSquadron reopened this Jan 4, 2025
@SyntaxualSugar SyntaxualSugar force-pushed the master branch 3 times, most recently from c5966af to 419da30 Compare January 5, 2025 20:40
@github-actions github-actions bot added 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux 10.rebuild-linux: 1-10 and removed 10.rebuild-linux: 1-10 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Jan 5, 2025
@lucasew
Copy link
Contributor

lucasew commented Jan 6, 2025

the maintainers commit has a weird diff

@lucasew
Copy link
Contributor

lucasew commented Jan 6, 2025

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 370942


x86_64-linux

✅ 1 package built:
  • stl-thumb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants