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

got: 0.97 -> 0.98.2 #307538

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
, stdenv
, fetchurl
, pkg-config
, openssl
, libressl
, libbsd
, libevent
, libuuid
Expand All @@ -12,21 +12,22 @@
, ncurses
, bison
, autoPatchelfHook
, testers
}:

stdenv.mkDerivation (finalAttrs: {
pname = "got";
version = "0.97";
version = "0.98.2";

src = fetchurl {
url = "https://gameoftrees.org/releases/portable/got-portable-${finalAttrs.version}.tar.gz";
hash = "sha256-4HpIlKRYUDoymCBH8GS8DDXaY0nYiVvotpBkwglOO3I=";
hash = "sha256-/11K2ZIu3xyAVbI5hlCXL9RjyAlZDb544uqxv3ihUMg=";
};

nativeBuildInputs = [ pkg-config bison ]
++ lib.optionals stdenv.isLinux [ autoPatchelfHook ];

buildInputs = [ openssl libbsd libevent libuuid libmd zlib ncurses ]
buildInputs = [ libressl libbsd libevent libuuid libmd zlib ncurses ]
++ lib.optionals stdenv.isDarwin [ libossp_uuid ];

configureFlags = [ "--enable-gotd" ];
Expand All @@ -45,13 +46,9 @@ stdenv.mkDerivation (finalAttrs: {
"-include getopt.h"
]);

doInstallCheck = true;

installCheckPhase = ''
runHook preInstallCheck
test "$($out/bin/got --version)" = "got ${finalAttrs.version}"
runHook postInstallCheck
'';
passthru.tests.version = testers.testVersion {
package = finalAttrs.finalPackage;
};
Comment on lines -48 to +51
Copy link
Member Author

Choose a reason for hiding this comment

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

@AndersonTorres, is this change a proper and correct improvement? I have yet to fully understand passthru and testers.testVersion, but from my current understanding this should be good. I'd truly appreciate your feedback and expertise on this.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, it is fine.

As I have explained before, installCheckPhase is meant to run checks provided by the upstream package developer. The difference between checkPhase and installCheckPhase is that installCheckPhase runs after installation while checkPhase runs after build.

Custom scripts are better suited to passthru.tests.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the explanation, @AndersonTorres, that's helpful!

Yet for some odd reason my 🧠 refuses to understand passthru (might be something to do with the wording that seems odd to me—not that it is, just that it makes it harder for me to grok it). Seems I need to revisit and re-read the available documentation

Copy link
Member

Choose a reason for hiding this comment

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

passthru is similar to meta in the sense that a modification in passthru does not trigger a mass rebuild.

Usually we use passthru in order to collect some useful info from the derivation and expose it to the external world.

E.G. suppose you have a parameter, uiType, that enables a fancy UI in got, and the end user wants to know which GUI type was used (say, cli, curses, gtk3, qt10).

Then you can write

passthru = {
   uiType =
     if enableCurses then "curses"
     else if enableGtk3 then "gtk3"
     else "cli";
};

This way, the end user can evaluate got.uiType to know what UI was enabled.


Obviously the code above is a crude example. Usually we do cleaner and more useful stuff.

E.G. in live555 we put a test:

passthru.tests = {
   inherit vlc;
};

This way we can test this by calling live555.tests.vlc.

The idea is that vlc depends on live555, and sometimes the vlc team does not update its code when live555 introduces a breaking change. So we at Nixpkgs catch this by running this test.


meta = {
changelog = "https://gameoftrees.org/releases/CHANGES";
Expand Down
2 changes: 0 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31383,8 +31383,6 @@ with pkgs;

goffice = callPackage ../development/libraries/goffice { };

got = darwin.apple_sdk_11_0.callPackage ../applications/version-management/got { };

gtkterm = callPackage ../tools/misc/gtkterm { };

gtk-pipe-viewer = perlPackages.callPackage ../applications/video/pipe-viewer { withGtk3 = true; };
Expand Down