Skip to content

Commit 39f96ce

Browse files
committed
python3Packages.pycolmap: init at unstable-3.12.5-openimageio
1 parent c9b6fb7 commit 39f96ce

4 files changed

Lines changed: 3116 additions & 0 deletions

File tree

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
{
2+
lib,
3+
buildPythonPackage,
4+
setuptools,
5+
cmake,
6+
colmap,
7+
boost,
8+
numpy,
9+
scikit-build-core,
10+
ruff,
11+
ninja,
12+
pybind11,
13+
pybind11-stubgen,
14+
clang-tools,
15+
perl,
16+
mypy,
17+
enlighten,
18+
pytestCheckHook,
19+
}:
20+
let
21+
# Add COLMAP's pybind11 fixes, see COLMAP's pyproject.toml.
22+
# TODO: remove when https://github.com/sizmailov/pybind11-stubgen/pull/263 is merged
23+
# Generated with; git diff ac46c10e229f1fc570600a14a644238b86ae4f99 a138210fd4f0b548f5195421a9b5b31091078ad6
24+
pybind11-stubgen-pybind-3 = pybind11-stubgen.overrideAttrs (old: {
25+
patches = (old.patches or [ ]) ++ [ ./pybind11-stubgen-fix-pybind-3.0.0.patch ];
26+
});
27+
in
28+
buildPythonPackage {
29+
pname = "pycolmap";
30+
31+
inherit (colmap) src version;
32+
33+
patches = (colmap.patches or [ ]) ++ [ ./remove-version-bounds.patch ];
34+
35+
pyproject = true;
36+
37+
dontUseCmakeConfigure = true;
38+
dontWrapQtApps = true;
39+
40+
build-system = [
41+
scikit-build-core
42+
ruff
43+
ninja
44+
pybind11
45+
pybind11-stubgen-pybind-3
46+
cmake
47+
clang-tools
48+
perl
49+
];
50+
51+
cmakeFlags = [ "-DGENERATE_STUBS=ON" ];
52+
53+
buildInputs = [ colmap ] ++ colmap.depsAlsoForPycolmap;
54+
55+
dependencies = [ numpy ];
56+
57+
pythonImportsCheck = "pycolmap";
58+
59+
nativeCheckInputs = [
60+
pytestCheckHook
61+
mypy
62+
enlighten
63+
];
64+
65+
enabledTestPaths = [ "python/examples" ];
66+
67+
postInstallCheck = ''
68+
python -m mypy --package pycolmap --implicit-optional
69+
'';
70+
71+
meta = with lib; {
72+
description = "Structure-From-Motion and Multi-View Stereo pipeline";
73+
longDescription = ''
74+
COLMAP is a general-purpose Structure-from-Motion (SfM) and Multi-View Stereo (MVS) pipeline
75+
with a graphical and command-line interface.
76+
'';
77+
homepage = "https://colmap.github.io/pycolmap/index.html";
78+
license = licenses.bsd3;
79+
platforms = platforms.unix;
80+
maintainers = with maintainers; [ chpatrick ];
81+
};
82+
}

0 commit comments

Comments
 (0)