diff --git a/pkgs/tools/text/ucg/default.nix b/pkgs/by-name/uc/ucg/package.nix similarity index 67% rename from pkgs/tools/text/ucg/default.nix rename to pkgs/by-name/uc/ucg/package.nix index e546a604252a..99d1b90c43df 100644 --- a/pkgs/tools/text/ucg/default.nix +++ b/pkgs/by-name/uc/ucg/package.nix @@ -2,11 +2,12 @@ , stdenv , fetchFromGitHub , autoreconfHook +, callPackage , pkg-config , pcre }: -stdenv.mkDerivation { +stdenv.mkDerivation (finalAttrs: { pname = "ucg"; version = "unstable-2022-09-03"; @@ -28,20 +29,11 @@ stdenv.mkDerivation { pcre ]; - doInstallCheck = true; - installCheckPhase = '' - runHook preInstallCheck - - testFile=$(mktemp /tmp/ucg-test.XXXX) - echo -ne 'Lorem ipsum dolor sit amet\n2.7182818284590' > $testFile - $out/bin/ucg 'dolor' $testFile || { rm $testFile; exit -1; } - $out/bin/ucg --ignore-case 'lorem' $testFile || { rm $testFile; exit -1; } - $out/bin/ucg --word-regexp '2718' $testFile && { rm $testFile; exit -1; } - $out/bin/ucg 'pisum' $testFile && { rm $testFile; exit -1; } - rm $testFile - - runHook postInstallCheck - ''; + passthru.tests = { + simple = callPackage ./tests/simple.nix { + ucg = finalAttrs.finalPackage; + }; + }; meta = { homepage = "https://gvansickle.github.io/ucg/"; @@ -53,9 +45,10 @@ stdenv.mkDerivation { appropriate with grep. Search patterns are specified as PCRE regexes. ''; license = lib.licenses.gpl3Plus; + mainProgram = "ucg"; maintainers = with lib.maintainers; [ AndersonTorres ]; platforms = lib.platforms.unix; broken = stdenv.isAarch64 || stdenv.isDarwin; }; -} +}) # TODO: report upstream diff --git a/pkgs/by-name/uc/ucg/tests/simple.nix b/pkgs/by-name/uc/ucg/tests/simple.nix new file mode 100644 index 000000000000..09910d0829da --- /dev/null +++ b/pkgs/by-name/uc/ucg/tests/simple.nix @@ -0,0 +1,26 @@ +{ lib +, stdenv +, ucg +}: + +stdenv.mkDerivation { + pname = "ucg-test"; + inherit (ucg) version; + + nativeBuildInputs = [ ucg ]; + + dontInstall = true; + + buildCommand = '' + testFile=$(mktemp /tmp/ucg-test.XXXX) + echo -ne 'Lorem ipsum dolor sit amet\n2.7182818284590' > $testFile + ucg 'dolor' $testFile || { rm $testFile; exit -1; } + ucg --ignore-case 'lorem' $testFile || { rm $testFile; exit -1; } + ucg --word-regexp '2718' $testFile && { rm $testFile; exit -1; } + ucg 'pisum' $testFile && { rm $testFile; exit -1; } + rm $testFile + touch $out + ''; + + meta.timeout = 10; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e0141b8abb63..ec064e39fd7d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8864,8 +8864,6 @@ with pkgs; robodoc = callPackage ../tools/text/robodoc { }; - ucg = callPackage ../tools/text/ucg { }; - grive2 = callPackage ../tools/filesystems/grive2 { }; groff = callPackage ../tools/text/groff { };