Merge pull request #116283 from AndersonTorres/new-tools

New tools
This commit is contained in:
Anderson Torres 2021-03-17 21:51:44 -03:00 committed by GitHub
commit 390e587696
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 183 additions and 25 deletions

View file

@ -0,0 +1,59 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, pkg-config
}:
stdenv.mkDerivation rec {
pname = "md4c";
version = "0.4.7";
src = fetchFromGitHub {
owner = "mity";
repo = pname;
rev = "release-${version}";
hash = "sha256-nfMXUP1wu3ifn1QVTO/+XcfFRsThG8PlmYRv+b8AYlQ=";
};
nativeBuildInputs = [
cmake
pkg-config
];
meta = with lib; {
homepage = "https://github.com/mity/md4c";
description = "Markdown parser made in C";
longDescription = ''
MD4C is Markdown parser implementation in C, with the following features:
- Compliance: Generally, MD4C aims to be compliant to the latest version
of CommonMark specification. Currently, we are fully compliant to
CommonMark 0.29.
- Extensions: MD4C supports some commonly requested and accepted
extensions. See below.
- Performance: MD4C is very fast.
- Compactness: MD4C parser is implemented in one source file and one
header file. There are no dependencies other than standard C library.
- Embedding: MD4C parser is easy to reuse in other projects, its API is
very straightforward: There is actually just one function, md_parse().
- Push model: MD4C parses the complete document and calls few callback
functions provided by the application to inform it about a start/end of
every block, a start/end of every span, and with any textual contents.
- Portability: MD4C builds and works on Windows and POSIX-compliant
OSes. (It should be simple to make it run also on most other platforms,
at least as long as the platform provides C standard library, including
a heap memory management.)
- Encoding: MD4C by default expects UTF-8 encoding of the input
document. But it can be compiled to recognize ASCII-only control
characters (i.e. to disable all Unicode-specific code), or (on Windows)
to expect UTF-16 (i.e. what is on Windows commonly called just
"Unicode"). See more details below.
- Permissive license: MD4C is available under the MIT license.
'';
license = licenses.mit;
maintainers = with maintainers; [ AndersonTorres ];
platforms = platforms.all;
};
}
# TODO: enable tests (needs Python)

View file

@ -1,52 +1,69 @@
{ lib, stdenv, fetchFromGitHub
, python3Packages
{ lib
, stdenv
, fetchFromGitHub
, clang-unwrapped
, cmake
, llvmPackages
, libffi, libxml2, zlib
, withMan ? true
, libclang
, libffi
, libxml2
, llvm
, sphinx
, zlib
, withManual ? true
, withHTML ? true
}:
stdenv.mkDerivation rec {
pname = "CastXML";
version = "0.3.4";
stdenv.mkDerivation rec {
pname = "CastXML";
version = "0.4.3";
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "v${version}";
sha256 = "0ypj67xrgj228myp7l1gsjw1ja97q68nmj98dsd33srmiayqraj4";
owner = pname;
repo = pname;
rev = "v${version}";
hash = "sha256-MschwCEkZrZmNgr8a1ocdukjXzHbXl2gmkPmygJaA6k=";
};
nativeBuildInputs = [ cmake ] ++ lib.optionals withMan [ python3Packages.sphinx ];
clangVersion = lib.getVersion llvmPackages.clang;
nativeBuildInputs = [
cmake
llvm
] ++ lib.optionals (withManual || withHTML) [
sphinx
];
cmakeFlags = [
"-DCLANG_RESOURCE_DIR=${llvmPackages.clang-unwrapped}/lib/clang/${clangVersion}/"
"-DSPHINX_MAN=${if withMan then "ON" else "OFF"}"
"-DCLANG_RESOURCE_DIR=${clang-unwrapped}/lib/clang/${lib.getVersion clang-unwrapped}/"
"-DSPHINX_HTML=${if withHTML then "ON" else "OFF"}"
"-DSPHINX_MAN=${if withManual then "ON" else "OFF"}"
];
buildInputs = [
llvmPackages.clang-unwrapped
llvmPackages.llvm
libffi libxml2 zlib
clang-unwrapped
libffi
libxml2
zlib
];
propagatedBuildInputs = [ llvmPackages.libclang ];
propagatedBuildInputs = [
libclang
];
# 97% tests passed, 97 tests failed out of 2881
# mostly because it checks command line and nix append -isystem and all
doCheck = false;
# -E exclude 4 tests based on names
# see https://github.com/CastXML/CastXML/issues/90
checkPhase = ''
# -E exclude 4 tests based on names
# see https://github.com/CastXML/CastXML/issues/90
runHook preCheck
ctest -E 'cmd.cc-(gnu|msvc)-((c-src-c)|(src-cxx))-cmd'
runHook postCheck
'';
meta = with lib; {
homepage = "https://github.com/CastXML/CastXML";
description = "C-family Abstract Syntax Tree XML Output";
license = licenses.asl20;
description = "Abstract syntax tree XML output tool";
maintainers = with maintainers; [ AndersonTorres ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,32 @@
{ lib
, buildPythonApplication
, fetchFromGitHub
, docutils
, mistune
, pygments
}:
buildPythonApplication rec {
pname = "m2r";
version = "0.2.1";
src = fetchFromGitHub {
owner = "miyakogi";
repo = pname;
rev = "v${version}";
hash = "sha256-JNLPEXMoiISh4RnKP+Afj9/PJp9Lrx9UYHsfuGAL7uI=";
};
buildInputs = [
docutils
mistune
pygments
];
meta = with lib; {
homepage = "https://github.com/miyakogi/m2r";
description = "Markdown-to-RestructuredText converter";
license = licenses.mit;
maintainers = with maintainers; [ AndersonTorres ];
};
}

View file

@ -0,0 +1,41 @@
{ lib
, buildPythonApplication
, fetchFromGitHub
, lxml
, six
}:
buildPythonApplication rec {
pname = "xmldiff";
version = "2.4";
src = fetchFromGitHub {
owner = "Shoobx";
repo = pname;
rev = version;
hash = "sha256-xqudHYfwOce2C0pcFzId0JDIIC6R5bllmVKsH+CvTdE=";
};
buildInputs = [
lxml
six
];
meta = with lib; {
homepage = "https://xmldiff.readthedocs.io/en/stable/";
description = "A library and command line utility for diffing xml";
longDescription = ''
xmldiff is a library and a command-line utility for making diffs out of
XML. This may seem like something that doesn't need a dedicated utility,
but change detection in hierarchical data is very different from change
detection in flat data. XML type formats are also not only used for
computer readable data, it is also often used as a format for hierarchical
data that can be rendered into human readable formats. A traditional diff
on such a format would tell you line by line the differences, but this
would not be be readable by a human. xmldiff provides tools to make human
readable diffs in those situations.
'';
license = licenses.mit;
maintainers = with maintainers; [ AndersonTorres ];
};
}

View file

@ -190,7 +190,10 @@ in
castget = callPackage ../applications/networking/feedreaders/castget { };
castxml = callPackage ../development/tools/castxml { };
castxml = callPackage ../development/tools/castxml {
inherit (llvmPackages) clang-unwrapped libclang llvm;
inherit (python3Packages) sphinx;
};
cen64 = callPackage ../misc/emulators/cen64 { };
@ -5835,6 +5838,8 @@ in
mcfly = callPackage ../tools/misc/mcfly { };
m2r = python3Packages.callPackage ../tools/text/m2r { };
mdbook = callPackage ../tools/text/mdbook {
inherit (darwin.apple_sdk.frameworks) CoreServices;
};
@ -9305,6 +9310,8 @@ in
xml2 = callPackage ../tools/text/xml/xml2 { };
xmldiff = python3Packages.callPackage ../tools/text/xml/xmldiff { };
xmlformat = callPackage ../tools/text/xml/xmlformat { };
xmlroff = callPackage ../tools/typesetting/xmlroff { };
@ -16052,6 +16059,8 @@ in
mdctags = callPackage ../development/tools/misc/mdctags { };
md4c = callPackage ../development/libraries/md4c { };
mdds = callPackage ../development/libraries/mdds { };
mediastreamer = callPackage ../development/libraries/mediastreamer { };