Skip to content
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,11 +2,12 @@
, stdenv
, fetchFromGitHub
, autoreconfHook
, callPackage
, pkg-config
, pcre
}:

stdenv.mkDerivation {
stdenv.mkDerivation (finalAttrs: {
pname = "ucg";
version = "unstable-2022-09-03";

Expand All @@ -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/";
Expand All @@ -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
26 changes: 26 additions & 0 deletions pkgs/by-name/uc/ucg/tests/simple.nix
Original file line number Diff line number Diff line change
@@ -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;
}
2 changes: 0 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 { };
Expand Down