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

walksnail-osd-tool: init at 0.3.0 #310812

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ilya-epifanov
Copy link
Contributor

@ilya-epifanov ilya-epifanov commented May 11, 2024

Description of changes

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.

@ilya-epifanov
Copy link
Contributor Author

depends on #310808

@ilya-epifanov
Copy link
Contributor Author

moved to pkgs/by-name @eclairevoyant

@ilya-epifanov ilya-epifanov force-pushed the walksnail-osd-tool branch 3 times, most recently from f54d9f0 to 76d08da Compare May 12, 2024 08:59
buildInputs = [
openssl
];
OPENSSL_NO_VENDOR = 1;
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
OPENSSL_NO_VENDOR = 1;
env = {
OPENSSL_NO_VENDOR = 1;
};

Comment on lines 53 to 59
postFixup =
let
rpath = lib.makeLibraryPath [ libGL ];
in
''
patchelf --add-rpath ${rpath} $out/bin/.${pname}-wrapped
'';
Copy link
Contributor

Choose a reason for hiding this comment

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

Could be simplified.

Suggested change
postFixup =
let
rpath = lib.makeLibraryPath [ libGL ];
in
''
patchelf --add-rpath ${rpath} $out/bin/.${pname}-wrapped
'';
postFixup = ''
patchelf $out/bin/.${pname}-wrapped \
--add-rpath ${lib.makeLibraryPath [ libGL ]}
'';

src = fetchFromGitHub {
owner = "avsaase";
repo = pname;
rev = "1044026bab773386fe96e20b544f60ad73d24e3f";
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 = "1044026bab773386fe96e20b544f60ad73d24e3f";
rev = "refs/tags/v${version}";

Comment on lines 9 to 12
+ println!("cargo:rustc-env=VERGEN_CARGO_TARGET_TRIPLE=x86_64-unknown-linux-gnu");
+ println!("cargo:rustc-env=VERGEN_RUSTC_SEMVER=nixos-unstable-latest");
+ println!("cargo:rustc-env=GIT_VERSION=v0.3.0");
+ println!("cargo:rustc-env=GIT_COMMIT_HASH=1044026bab773386fe96e20b544f60ad73d24e3f");
Copy link
Contributor

Choose a reason for hiding this comment

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

Put these variables into env, like OPENSSL_NO_VENDOR. Hardcoding version and hashes would break automated updating scripts. VERGEN_CARGO_TARGET_TRIPLE should not be tied to a particular architecture (x86_64).

Also, does it need each of these variables at all?

pkgs/by-name/wa/walksnail-osd-tool/package.nix Outdated Show resolved Hide resolved
@xzfc
Copy link
Contributor

xzfc commented May 12, 2024

Please follow the commit conventions. Squash both of your commits into a single commit named walksnail-osd-tool: init at 0.3.0. And the same for other your PRs.

@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 May 13, 2024
@ilya-epifanov ilya-epifanov changed the title walksnail-osd-tool 0.3.0 (new) walksnail-osd-tool: init at 0.3.0 May 13, 2024
@ilya-epifanov
Copy link
Contributor Author

@xzfc Thanks for the review! I've now addressed all your comments.

@ilya-epifanov ilya-epifanov requested a review from xzfc May 13, 2024 20:27
@ilya-epifanov
Copy link
Contributor Author

@MikaelFangel @eclairevoyant sorry for pulling you in on completely unrelated PRs, but could you please review this one?
@xzfc could you please also take a look at it?

@ilya-epifanov
Copy link
Contributor Author

@JohnRTitor I know you have nothing to do with this PR but I don't know whom to ask to move things forward. Please help me with this.


rustPlatform.buildRustPackage rec {
pname = "walksnail-osd-tool";
version = "0.3.0"; # don't forget to update the make-build-reproducible.patch
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 = "0.3.0"; # don't forget to update the make-build-reproducible.patch
version = "0.3.0";

we'll notice that when the patch no longer applies 😅

cargo
cmake
copyDesktopItems
openssl.dev
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need that in nativeBuildInputs?

Comment on lines +48 to +52
buildInputs = [
openssl
];
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
buildInputs = [
openssl
];
buildInputs = [
openssl
];

Comment on lines +60 to +63
patchelf $out/bin/.${pname}-wrapped \
--add-rpath ${lib.makeLibraryPath [ libGL ]}
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
patchelf $out/bin/.${pname}-wrapped \
--add-rpath ${lib.makeLibraryPath [ libGL ]}
patchelf $out/bin/.walksnail-osd-tool-wrapped \
--add-rpath ${lib.makeLibraryPath [ libGL ]}

Also doing that preFixup if possible, would allow us to use the unwrapped name.

Comment on lines +65 to +69
name = pname;
exec = pname;
icon = pname;
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
name = pname;
exec = pname;
icon = pname;
name = "walksnail-osd-tool";
exec = "walksnail-osd-tool";
icon = "walksnail-osd-tool";

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 awaiting_changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants