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 sha256 = "sha256-Xbvg/FcuX/AL2reWsaM2oaFyLby3+HDCfYtRyswE7DA="; 15 }; 16 17 - # Extension point for when thg's mercurial is lagging behind mainline. 18 - tortoiseMercurial = mercurial; 19 - 20 propagatedBuildInputs = with python3Packages; [ 21 - tortoiseMercurial 22 qscintilla-qt5 23 iniparse 24 ]; 25 - nativeBuildInputs = [ qt5.wrapQtAppsHook ]; 26 27 - doCheck = true; 28 postInstall = '' 29 - mkdir -p $out/share/doc/tortoisehg 30 - cp COPYING.txt $out/share/doc/tortoisehg/Copying.txt 31 - # convenient alias 32 ln -s $out/bin/thg $out/bin/tortoisehg 33 - wrapQtApp $out/bin/thg 34 ''; 35 36 checkPhase = '' 37 - export QT_QPA_PLATFORM=offscreen 38 - echo "test: thg smoke test" 39 $out/bin/thg -h > help.txt & 40 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 ''; 49 50 - passthru.mercurial = tortoiseMercurial; 51 52 meta = { 53 description = "Qt based graphical tool for working with Mercurial";
··· 14 sha256 = "sha256-Xbvg/FcuX/AL2reWsaM2oaFyLby3+HDCfYtRyswE7DA="; 15 }; 16 17 + nativeBuildInputs = [ 18 + qt5.wrapQtAppsHook 19 + ]; 20 propagatedBuildInputs = with python3Packages; [ 21 + mercurial 22 + # The one from python3Packages 23 qscintilla-qt5 24 iniparse 25 ]; 26 27 + # In order to spare double wrapping, we use: 28 + preFixup = '' 29 + makeWrapperArgs+=("''${qtWrapperArgs[@]}") 30 + ''; 31 + # Convenient alias 32 postInstall = '' 33 ln -s $out/bin/thg $out/bin/tortoisehg 34 ''; 35 36 + # In python3Packages.buildPythonApplication doCheck is always true, and we 37 + # override it to not run the default unittests 38 checkPhase = '' 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" 46 $out/bin/thg -h > help.txt & 47 sleep 1s 48 + grep -q "list of commands" help.txt 49 + 50 + runHook postCheck 51 ''; 52 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 + }; 58 59 meta = { 60 description = "Qt based graphical tool for working with Mercurial";