2023-04-29 16:46:19 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildPythonApplication
|
2023-10-09 19:29:22 +00:00
|
|
|
, fetchpatch
|
2023-04-29 16:46:19 +00:00
|
|
|
, fetchPypi
|
|
|
|
, pytestCheckHook
|
|
|
|
, pkg-config
|
|
|
|
, cmake
|
|
|
|
, flex
|
|
|
|
, glib
|
|
|
|
, json-glib
|
|
|
|
, libxml2
|
|
|
|
, appdirs
|
|
|
|
, dbus-deviation
|
|
|
|
, faust-cchardet
|
|
|
|
, feedgen
|
|
|
|
, lxml
|
|
|
|
, networkx
|
|
|
|
, pkgconfig
|
|
|
|
, pyyaml
|
|
|
|
, schema
|
|
|
|
, setuptools
|
|
|
|
, toposort
|
|
|
|
, wheezy-template
|
2023-11-16 04:20:00 +00:00
|
|
|
, llvmPackages
|
2023-04-29 16:46:19 +00:00
|
|
|
, gst_all_1
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "hotdoc";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "0.15";
|
|
|
|
format = "setuptools";
|
2023-04-29 16:46:19 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-sfQ/iBd1Z+YqnaOg8j32rC2iucdiiK3Tff9NfYFnQyc=";
|
2023-04-29 16:46:19 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-test-hotdoc.patch";
|
|
|
|
url = "https://github.com/hotdoc/hotdoc/commit/d2415a520e960a7b540742a0695b699be9189540.patch";
|
|
|
|
hash = "sha256-9ORZ91c+/oRqEp2EKXjKkz7u8mLnWCq3uPsc3G4NB9E=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
cmake
|
|
|
|
flex
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
glib
|
|
|
|
json-glib
|
|
|
|
libxml2.dev
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
appdirs
|
|
|
|
dbus-deviation
|
|
|
|
faust-cchardet
|
|
|
|
feedgen
|
|
|
|
lxml
|
|
|
|
networkx
|
|
|
|
pkgconfig
|
|
|
|
pyyaml
|
|
|
|
schema
|
|
|
|
setuptools # for pkg_resources
|
|
|
|
toposort
|
|
|
|
wheezy-template
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
# CMake is used to build CMARK, but the build system is still python
|
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
|
|
|
# Ensure C+GI+GST extensions are built and can be imported
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"hotdoc.extensions.c.c_extension"
|
|
|
|
"hotdoc.extensions.gi.gi_extension"
|
|
|
|
"hotdoc.extensions.gst.gst_extension"
|
|
|
|
];
|
|
|
|
|
|
|
|
# Run the tests by package instead of current dir
|
|
|
|
pytestFlagsArray = [ "--pyargs" "hotdoc" ];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Test does not correctly handle path normalization for test comparison
|
|
|
|
"test_cli_overrides"
|
2024-09-26 11:04:55 +00:00
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
2023-04-29 16:46:19 +00:00
|
|
|
# Test does not correctly handle absolute /home paths on Darwin (even fake ones)
|
|
|
|
"test_index"
|
|
|
|
];
|
|
|
|
|
|
|
|
# Hardcode libclang paths
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace hotdoc/extensions/c/c_extension.py \
|
|
|
|
--replace "shutil.which('llvm-config')" 'True' \
|
2024-01-13 08:15:51 +00:00
|
|
|
--replace "subprocess.check_output(['llvm-config', '--version']).strip().decode()" '"${lib.versions.major llvmPackages.libclang.version}"' \
|
2023-11-16 04:20:00 +00:00
|
|
|
--replace "subprocess.check_output(['llvm-config', '--prefix']).strip().decode()" '"${llvmPackages.libclang.lib}"' \
|
|
|
|
--replace "subprocess.check_output(['llvm-config', '--libdir']).strip().decode()" '"${llvmPackages.libclang.lib}/lib"'
|
2023-04-29 16:46:19 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# Make pytest run from a temp dir to have it pick up installed package for cmark
|
|
|
|
preCheck = ''
|
|
|
|
pushd $TMPDIR
|
|
|
|
'';
|
|
|
|
postCheck = ''
|
|
|
|
popd
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.tests = {
|
|
|
|
inherit (gst_all_1) gstreamer gst-plugins-base;
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Tastiest API documentation system";
|
2023-04-29 16:46:19 +00:00
|
|
|
homepage = "https://hotdoc.github.io/";
|
|
|
|
license = [ licenses.lgpl21Plus ];
|
2024-07-31 10:19:44 +00:00
|
|
|
maintainers = [ ];
|
2023-04-29 16:46:19 +00:00
|
|
|
};
|
|
|
|
}
|