nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6
7 # build-system
8 cmake,
9 scikit-build-core,
10 numpy,
11 ninja,
12 pybind11,
13 setuptools-scm,
14
15 # dependencies
16 typing-extensions,
17
18 # tests
19 pytestCheckHook,
20 pyyaml,
21}:
22
23buildPythonPackage rec {
24 pname = "spglib";
25 version = "2.7.0";
26 pyproject = true;
27
28 src = fetchFromGitHub {
29 owner = "spglib";
30 repo = "spglib";
31 tag = "v${version}";
32 hash = "sha256-RFvd/j/14YRIcQTpnYPx5edeF3zbHbi90jb32i3ZU/c=";
33 };
34
35 build-system = [
36 cmake
37 scikit-build-core
38 numpy
39 pybind11
40 ninja
41 setuptools-scm
42 ];
43
44 dontUseCmakeConfigure = true;
45
46 dependencies = [
47 numpy
48 ]
49 ++ lib.optionals (pythonOlder "3.13") [
50 typing-extensions
51 ];
52
53 nativeCheckInputs = [
54 pytestCheckHook
55 pyyaml
56 ];
57
58 pythonImportsCheck = [ "spglib" ];
59
60 meta = {
61 description = "Python bindings for C library for finding and handling crystal symmetries";
62 homepage = "https://spglib.github.io/spglib/";
63 changelog = "https://github.com/spglib/spglib/raw/${src.tag}/ChangeLog";
64 license = lib.licenses.bsd3;
65 maintainers = with lib.maintainers; [ psyanticy ];
66 };
67}