summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/laszip/default.nix
blob: fa9a57c1d9db968c03c4c2fd6bacb71f6afb0fe8 (plain)
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
{
  lib,
  stdenv,
  buildPythonPackage,
  fetchFromGitHub,
  fetchpatch,
  scikit-build-core,
  pybind11,
  cmake,
  laszip,
  ninja,
}:

buildPythonPackage rec {
  pname = "laszip-python";
  version = "0.2.3";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "tmontaigu";
    repo = "laszip-python";
    rev = version;
    hash = "sha256-MiPzL9TDCf1xnCv7apwdfcpkFnBRi4PO/atTQxqL8cw=";
  };

  patches = [
    # Removes depending on the cmake and ninja PyPI packages, since we can pass
    # in the tools directly, and scikit-build-core can use them.
    # https://github.com/tmontaigu/laszip-python/pull/9
    (fetchpatch {
      name = "remove-cmake-ninja-pypi-dependencies.patch";
      url = "https://github.com/tmontaigu/laszip-python/commit/17e648d04945fa2d095d6d74d58c790a4fcde84a.patch";
      hash = "sha256-k58sS1RqVzT1WPh2OVt/D4Y045ODtj6U3bUjegd44VY=";
    })
  ];

  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-std=c++17";

  nativeBuildInputs = [
    cmake
    ninja
    pybind11
    scikit-build-core
  ];

  dontUseCmakeConfigure = true;

  buildInputs = [ laszip ];

  # There are no tests
  doCheck = false;

  pythonImportsCheck = [ "laszip" ];

  meta = {
    description = "Unofficial bindings between Python and LASzip made using pybind11";
    homepage = "https://github.com/tmontaigu/laszip-python";
    changelog = "https://github.com/tmontaigu/laszip-python/blob/${src.rev}/Changelog.md";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ matthewcroughan ];
  };
}