ucg: cleanup

- Use rec-less, overlay-style overridable recursive attributes (in effect since
https://github.com/NixOS/nixpkgs/pull/119942);
- Remove installCheckPhase
- Change it to a separated derivation inside passthru.tests
- Set meta.mainProgram

+35 -18
+26
pkgs/by-name/uc/ucg/tests/simple.nix
··· 1 + { lib 2 + , stdenv 3 + , ucg 4 + }: 5 + 6 + stdenv.mkDerivation { 7 + pname = "ucg-test"; 8 + inherit (ucg) version; 9 + 10 + nativeBuildInputs = [ ucg ]; 11 + 12 + dontInstall = true; 13 + 14 + buildCommand = '' 15 + testFile=$(mktemp /tmp/ucg-test.XXXX) 16 + echo -ne 'Lorem ipsum dolor sit amet\n2.7182818284590' > $testFile 17 + ucg 'dolor' $testFile || { rm $testFile; exit -1; } 18 + ucg --ignore-case 'lorem' $testFile || { rm $testFile; exit -1; } 19 + ucg --word-regexp '2718' $testFile && { rm $testFile; exit -1; } 20 + ucg 'pisum' $testFile && { rm $testFile; exit -1; } 21 + rm $testFile 22 + touch $out 23 + ''; 24 + 25 + meta.timeout = 10; 26 + }
+9 -16
pkgs/tools/text/ucg/default.nix pkgs/by-name/uc/ucg/package.nix
··· 2 2 , stdenv 3 3 , fetchFromGitHub 4 4 , autoreconfHook 5 + , callPackage 5 6 , pkg-config 6 7 , pcre 7 8 }: 8 9 9 - stdenv.mkDerivation { 10 + stdenv.mkDerivation (finalAttrs: { 10 11 pname = "ucg"; 11 12 version = "unstable-2022-09-03"; 12 13 ··· 28 29 pcre 29 30 ]; 30 31 31 - doInstallCheck = true; 32 - installCheckPhase = '' 33 - runHook preInstallCheck 34 - 35 - testFile=$(mktemp /tmp/ucg-test.XXXX) 36 - echo -ne 'Lorem ipsum dolor sit amet\n2.7182818284590' > $testFile 37 - $out/bin/ucg 'dolor' $testFile || { rm $testFile; exit -1; } 38 - $out/bin/ucg --ignore-case 'lorem' $testFile || { rm $testFile; exit -1; } 39 - $out/bin/ucg --word-regexp '2718' $testFile && { rm $testFile; exit -1; } 40 - $out/bin/ucg 'pisum' $testFile && { rm $testFile; exit -1; } 41 - rm $testFile 42 - 43 - runHook postInstallCheck 44 - ''; 32 + passthru.tests = { 33 + simple = callPackage ./tests/simple.nix { 34 + ucg = finalAttrs.finalPackage; 35 + }; 36 + }; 45 37 46 38 meta = { 47 39 homepage = "https://gvansickle.github.io/ucg/"; ··· 53 45 appropriate with grep. Search patterns are specified as PCRE regexes. 54 46 ''; 55 47 license = lib.licenses.gpl3Plus; 48 + mainProgram = "ucg"; 56 49 maintainers = with lib.maintainers; [ AndersonTorres ]; 57 50 platforms = lib.platforms.unix; 58 51 broken = stdenv.isAarch64 || stdenv.isDarwin; 59 52 }; 60 - } 53 + }) 61 54 # TODO: report upstream
-2
pkgs/top-level/all-packages.nix
··· 8864 8864 8865 8865 robodoc = callPackage ../tools/text/robodoc { }; 8866 8866 8867 - ucg = callPackage ../tools/text/ucg { }; 8868 - 8869 8867 grive2 = callPackage ../tools/filesystems/grive2 { }; 8870 8868 8871 8869 groff = callPackage ../tools/text/groff { };