-
-
Notifications
You must be signed in to change notification settings - Fork 17k
go-pray: init at 0.1.13 #451927
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
base: master
Are you sure you want to change the base?
go-pray: init at 0.1.13 #451927
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome to nixpkgs! 👋 Thanks for your contribution.
pkgs/by-name/go/go-pray/package.nix
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are version.buildCommit
and version.buildTime
required? If not, you might want to simplify the code by embedding the version directly:
buildGoModule (finalAttrs: {
// ...
version = "0.1.13";
// ...
src = fetchFromGitHub {
// ...
tag = "v${finalAttrs.version}";
// ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build commit is not required but build time is required to have a value in order not to break version
subcommand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend using simplified version and a fixed timestamp 1970-01-01T00:00:00Z
for better maintainability.
For ref:
nixpkgs/pkgs/by-name/zs/zs/package.nix
Lines 25 to 27 in fe460b7
"-X=main.Version=${version}" | |
"-X=main.Commit=${src.rev}" | |
"-X=main.Build=1970-01-01T00:00:00+00:00" |
nixpkgs/pkgs/tools/networking/ivpn/default.nix
Lines 43 to 44 in 8204ce9
"-X github.com/ivpn/desktop-app/daemon/version._version=${version}" | |
"-X github.com/ivpn/desktop-app/daemon/version._time=1970-01-01" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, I used SOURCE_DATE_EPOCH
variable for the build time.
And, please squash the commits to:
|
pkgs/by-name/go/go-pray/package.nix
Outdated
alsa-lib | ||
installShellFiles | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alsa-lib | |
installShellFiles | |
]; | |
installShellFiles | |
]; | |
buildInputs = [ | |
alsa-lib | |
]; |
wait, alsa-lib is already in buildInputs below. Why do we need both? is there an alsa-config script or so?
also lets keep the inputs together
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing this out, I removed it from the nativeBuildInputs
but I require it as a runtime dependency so I will have to leave it in buildInputs
.
pkgs/by-name/go/go-pray/package.nix
Outdated
"-X github.com/0xzer0x/go-pray/internal/version.version=${finalAttrs.version}" | ||
]; | ||
|
||
preBuild = '' | ||
ldflags+=" -X github.com/0xzer0x/go-pray/internal/version.buildTime=$(date -u -d "@$SOURCE_DATE_EPOCH" "+%Y-%m-%dT%H:%M:%SZ")" | ||
''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"-X github.com/0xzer0x/go-pray/internal/version.version=${finalAttrs.version}" | |
]; | |
preBuild = '' | |
ldflags+=" -X github.com/0xzer0x/go-pray/internal/version.buildTime=$(date -u -d "@$SOURCE_DATE_EPOCH" "+%Y-%m-%dT%H:%M:%SZ")" | |
''; | |
"-X github.com/0xzer0x/go-pray/internal/version.version=${finalAttrs.version}" | |
"-X github.com/0xzer0x/go-pray/internal/version.buildTime=1980-01-01T00:00:00Z" | |
]; |
lets make this simple
pkgs/by-name/go/go-pray/package.nix
Outdated
buildInputs = [ alsa-lib ]; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
buildInputs = [ alsa-lib ]; |
6101fc2
to
9ce2ce0
Compare
go-pray: refactor to remove build commit and time workaround This approach of keeping the required metadata in the actual package.nix maintains reproducibility while keeping metadata required by upstream package. go-pray: remove manually added variables and use source date epoch for build time
Powerful and user-friendly command-line interface (CLI) application that helps Muslims stay on top of their daily prayers. With features like prayer time notifications, prayer calendars, and flexible configuration options.
Things done
passthru.tests
.nixpkgs-review
on this PR. See nixpkgs-review usage../result/bin/
.Add a 👍 reaction to pull requests you find important.