nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 gfortran,
6 buildType ? "meson",
7 meson,
8 ninja,
9 cmake,
10 pkg-config,
11 python3,
12 mctc-lib,
13}:
14
15assert (
16 builtins.elem buildType [
17 "meson"
18 "cmake"
19 ]
20);
21
22stdenv.mkDerivation (finalAttrs: {
23 pname = "mstore";
24 version = "0.3.0";
25
26 src = fetchFromGitHub {
27 owner = "grimme-lab";
28 repo = "mstore";
29 rev = "v${finalAttrs.version}";
30 hash = "sha256-zfrxdrZ1Um52qTRNGJoqZNQuHhK3xM/mKfk0aBLrcjw=";
31 };
32
33 patches = [
34 # Fix wrong generation of package config include paths
35 ./pkgconfig.patch
36 ];
37
38 nativeBuildInputs = [
39 gfortran
40 pkg-config
41 python3
42 ]
43 ++ lib.optionals (buildType == "meson") [
44 meson
45 ninja
46 ]
47 ++ lib.optional (buildType == "cmake") cmake;
48
49 buildInputs = [ mctc-lib ];
50
51 outputs = [
52 "out"
53 "dev"
54 ];
55
56 postPatch = ''
57 patchShebangs --build config/install-mod.py
58 '';
59
60 meta = {
61 description = "Molecular structure store for testing";
62 license = lib.licenses.asl20;
63 homepage = "https://github.com/grimme-lab/mstore";
64 platforms = lib.platforms.linux;
65 maintainers = [ lib.maintainers.sheepforce ];
66 };
67})