summary refs log tree commit diff
path: root/pkgs/applications/science/biology/dssp/default.nix
blob: febfde548fd7a743930195d9ae0d1f92c69de01a (plain) (blame)
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
{ lib
, stdenv
, cmake
, eigen
, fetchFromGitHub
, fetchpatch
, libcifpp
, libmcfp
, zlib
}:
let
  libcifpp' = libcifpp.overrideAttrs (oldAttrs: {
    # dssp 4.4.3 requires specific version "5.2.0" of libcifpp
    version = "5.2.0";
    src = fetchFromGitHub {
      inherit (oldAttrs.src) owner repo rev;
      hash = "sha256-Sj10j6HxUoUvQ66cd2B8CO7CVBRd7w9CTovxkwPDOvs=";
    };
    patches = [
      (fetchpatch {
        # https://github.com/PDB-REDO/libcifpp/issues/51
        name = "fix-build-on-darwin.patch";
        url = "https://github.com/PDB-REDO/libcifpp/commit/641f06a7e7c0dc54af242b373820f2398f59e7ac.patch";
        hash = "sha256-eWNfp9nA/+2J6xjZR6Tj+5OM3L5MxdfRi0nBzyaqvS0=";
      })
    ];
  });
in

stdenv.mkDerivation (finalAttrs: {
  pname = "dssp";
  version = "4.4.4.1";

  src = fetchFromGitHub {
    owner = "PDB-REDO";
    repo = "dssp";
    rev = "refs/tags/v${finalAttrs.version}";
    hash = "sha256-sy6GBCnTGRD1YP00dKIolkr1RMboLGcd0f4kU8gCOnA=";
  };

  nativeBuildInputs = [
    cmake
  ];

  buildInputs = [
    eigen
    libcifpp'
    libmcfp
    zlib
  ];

  meta = with lib; {
    description = "Calculate the most likely secondary structure assignment given the 3D structure of a protein";
    homepage = "https://github.com/PDB-REDO/dssp";
    changelog = "https://github.com/PDB-REDO/libcifpp/releases/tag/${finalAttrs.src.rev}";
    license = licenses.bsd2;
    maintainers = with maintainers; [ natsukium ];
    platforms = platforms.unix;
  };
})