-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdefault-2019.nix
70 lines (65 loc) · 2.85 KB
/
default-2019.nix
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
63
64
65
66
67
68
69
70
# Nix script to set up appropriate environment to run python-based SST sequence designer, defaulting to python3.
# Type 'nix-shell' to run this script.
#
# Shipped with DNA single-stranded tile (SST) sequence designer used in the following publication.
# "Diverse and robust molecular algorithms using reprogrammable DNA self-assembly"
# Woods*, Doty*, Myhrvold, Hui, Zhou, Yin, Winfree. (*Joint first co-authors). Nature, 2019
with import <nixpkgs>{}; # import nixos packages
let
pkgs = import (builtins.fetchGit {
name = "2019-03-revision";
url = "https://github.com/NixOS/nixpkgs/";
ref = "refs/heads/nixpkgs-unstable";
rev = "25b53f32236b308172673c958f570b5b488c7b73";
}) { };
nupack=stdenv.mkDerivation{
name="nupack";
#src=./nupack_viennaRNA/nupack3.0.6.tar.gz; # nix knows to unzip and untar and run make
src = fetchurl {
url = "http://www.dna.caltech.edu/SupplementaryMaterial/Algorithmic_SST/archived_software/nupack3.0.6.tar.gz";
sha256 = "1kv5irz8n57875dgzr5w3zc9xsy8dbvcfk3iszw5ask942dpdpvw";
};
buildPhase = ''
# -fcommon is required for modern versions of gcc to compile nupack3.0.6 without a
# multiple definitions error.
export NUPACK_CFLAGS="-std=c99 -O3 -Wall -Wmissing-prototypes -Wmissing-declarations -fcommon"
export NUPACK_CXXFLAGS="-Wall -Wmissing-prototypes -Wmissing-declarations -fcommon"
CFLAGS=-fcommon make'';
installPhase = '' # installPhase interprets double-quoted string as a bash script
mkdir -p $out; # $out is bash variable that nix sets before running this bash script
cp -r bin $out;
cp -r parameters $out;
'';
};
viennaRNA=stdenv.mkDerivation{
name="viennaRNA";
src = fetchurl {
url = "http://www.dna.caltech.edu/SupplementaryMaterial/Algorithmic_SST/archived_software/ViennaRNA-2.1.9.tar.gz";
sha256 = "1swjnfir5gx424srsnggw4sf8x0p8kiqfzgzp5m34zdzvn4nlzrn";
};
# if one has a local copy of the source one can replace the above src instruction with:
# src=./ViennaRNA-2.1.9.tar.gz;
buildInputs = with pkgs; [ which perl gnumake ];
NIX_CFLAGS_COMPILE = "-fcommon";
NIX_CXXFLAGS_COMPILE = "-std=c++14";
buildPhase = ''
echo "Running the viennaRNA build phase"
export CFLAGS="-fcommon"
export CXXFLAGS="-std=c++14"
./configure --prefix=$out --without-perl --without-doc --without-doc-html --without-doc-pdf --without-kinfold --without-svm --without-forester
make'';
installPhase = ''
make install
'';
}; in
stdenv.mkDerivation{
name="nupack_viennaRNA";
buildInputs = with pkgs; [
coreutils
(python3.withPackages (ps: [ ps.numpy ps.matplotlib ]))
nupack
viennaRNA
]; # here I put a list of names of packages I want to install
NUPACKHOME = "${nupack.out}";
VIENNARNA_PARAMS_PATH="${viennaRNA.out}/share/ViennaRNA/";
}