1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
{ lib
, stdenv
, autoreconfHook
, buildPackages
, coreutils
, fetchFromGitHub
, jansson
, libiconv
, perl
, pkg-config
, python3
, libseccomp
, libyaml
, pcre2
, libxml2
}:
stdenv.mkDerivation (finalAttrs: {
pname = "universal-ctags";
version = "6.1.0";
src = fetchFromGitHub {
owner = "universal-ctags";
repo = "ctags";
rev = "v${finalAttrs.version}";
hash = "sha256-f8+Ifjn7bhSYozOy7kn+zCLdHGrH3iFupHUZEGynz9Y=";
};
depsBuildBuild = [
buildPackages.stdenv.cc
];
nativeBuildInputs = [
autoreconfHook
perl
pkg-config
(python3.withPackages (p: [ p.docutils ]))
];
buildInputs = [
libyaml
pcre2
libxml2
jansson
]
++ lib.optional stdenv.isDarwin libiconv
++ lib.optional stdenv.isLinux libseccomp;
configureFlags = [ "--enable-tmpdir=/tmp" ];
patches = [
./000-nixos-specific.patch
];
postPatch = ''
substituteInPlace Tmain/utils.sh \
--replace /bin/echo ${coreutils}/bin/echo
# fails on sandbox
rm -fr Tmain/ptag-proc-cwd.d/
patchShebangs misc/*
'';
doCheck = true;
checkFlags = [
"man-test" "tlib" "tmain" "tutil" "units"
];
meta = with lib; {
homepage = "https://docs.ctags.io/en/latest/";
description = "A maintained ctags implementation";
longDescription = ''
Universal Ctags (abbreviated as u-ctags) is a maintained implementation of
ctags. ctags generates an index (or tag) file of language objects found in
source files for programming languages. This index makes it easy for text
editors and other tools to locate the indexed items.
'';
license = licenses.gpl2Plus;
maintainers = [ maintainers.AndersonTorres ];
platforms = platforms.all;
mainProgram = "ctags";
priority = 1; # over the emacs implementation
};
})
|