tortoisehg: cleanup expression

Run check hooks, and make checkPhase much cleaner and simpler. Prevent
double wrapping. Don't copy a common COPYING file such as this.

+27 -20
+27 -20
pkgs/applications/version-management/tortoisehg/default.nix
··· 14 14 sha256 = "sha256-Xbvg/FcuX/AL2reWsaM2oaFyLby3+HDCfYtRyswE7DA="; 15 15 }; 16 16 17 - # Extension point for when thg's mercurial is lagging behind mainline. 18 - tortoiseMercurial = mercurial; 19 - 17 + nativeBuildInputs = [ 18 + qt5.wrapQtAppsHook 19 + ]; 20 20 propagatedBuildInputs = with python3Packages; [ 21 - tortoiseMercurial 21 + mercurial 22 + # The one from python3Packages 22 23 qscintilla-qt5 23 24 iniparse 24 25 ]; 25 - nativeBuildInputs = [ qt5.wrapQtAppsHook ]; 26 26 27 - doCheck = true; 27 + # In order to spare double wrapping, we use: 28 + preFixup = '' 29 + makeWrapperArgs+=("''${qtWrapperArgs[@]}") 30 + ''; 31 + # Convenient alias 28 32 postInstall = '' 29 - mkdir -p $out/share/doc/tortoisehg 30 - cp COPYING.txt $out/share/doc/tortoisehg/Copying.txt 31 - # convenient alias 32 33 ln -s $out/bin/thg $out/bin/tortoisehg 33 - wrapQtApp $out/bin/thg 34 34 ''; 35 35 36 + # In python3Packages.buildPythonApplication doCheck is always true, and we 37 + # override it to not run the default unittests 36 38 checkPhase = '' 37 - export QT_QPA_PLATFORM=offscreen 38 - echo "test: thg smoke test" 39 + runHook preCheck 40 + 41 + $out/bin/thg version | grep -q "${version}" 42 + # Detect breakage of thg in case of out-of-sync mercurial update. In that 43 + # case any thg subcommand just opens up an gui dialog with a description of 44 + # version mismatch. 45 + echo "thg smoke test" 39 46 $out/bin/thg -h > help.txt & 40 47 sleep 1s 41 - if grep "list of commands" help.txt; then 42 - echo "thg help output was captured. Seems like package in a working state." 43 - exit 0 44 - else 45 - echo "thg help output was not captured. Seems like package is broken." 46 - exit 1 47 - fi 48 + grep -q "list of commands" help.txt 49 + 50 + runHook postCheck 48 51 ''; 49 52 50 - passthru.mercurial = tortoiseMercurial; 53 + passthru = { 54 + # If at some point we'll override this argument, it might be useful to have 55 + # access to it here. 56 + inherit mercurial; 57 + }; 51 58 52 59 meta = { 53 60 description = "Qt based graphical tool for working with Mercurial";