namd: Use upstream git repos for sources and nix dependencies

This commit is contained in:
Tyson Whitehead
2019-05-09 13:05:08 -04:00
parent d21031cf2a
commit 6ecbf29f61

View File

@@ -1,37 +1,54 @@
{ stdenv, fetchurl { stdenv, fetchgit, fetchFromGitHub
, bash, tcsh }: , tcsh, tcl-8_5, fftwSinglePrec }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "2.11"; version = "2.11";
name = "namd-${version}"; name = "namd-${version}";
src = fetchurl { srcs = [
url = "http://ppomorsk.sharcnet.ca/namd-${version}.tar.gz"; (fetchgit {
sha256 = "1ylrxy8iqmsr64z82nr9cf3vvq9hbdav128fs2czm46y999dpls1"; name = "namd-${version}-src";
}; url = "https://charm.cs.illinois.edu/gerrit/namd.git";
rev = "release-2-11";
sha256 = "0msxc1zwjsjb5iynm2hzyvk42wrkbaw234kjcmaxv4zvd3wb8qmw";
})
(fetchFromGitHub {
name = "charm-6.7.0-src";
owner = "UIUC-PPL";
repo = "charm";
rev = "v6.7.0";
sha256 = "0xcw0jnp8l7dkx3cq9qbyyvr8k5zbij7w1ings0xg6ryjmjgi92x";
})
];
sourceRoot = "namd-${version}-src";
postUnpack = '' postUnpack = ''
cd namd-${version} chmod -R u+w namd-${version}-src charm-*-src
tar -xf charm-*.tar mv charm-*-src namd-${version}-src/charm
tar -xzf fftw-linux-x86_64.tar.gz
mv linux-x86_64 fftw
tar -xzf tcl*-linux-x86_64.tar.gz
mv tcl*-linux-x86_64 tcl
tar -xzf tcl*-linux-x86_64-threaded.tar.gz
mv tcl*-linux-x86_64-threaded tcl-threaded
cd ..
''; '';
# postUnpack = ''
# cd namd-${version}
# tar -xf charm-*.tar
# tar -xzf fftw-linux-x86_64.tar.gz
# mv linux-x86_64 fftw
# tar -xzf tcl*-linux-x86_64.tar.gz
# mv tcl*-linux-x86_64 tcl
# tar -xzf tcl*-linux-x86_64-threaded.tar.gz
# mv tcl*-linux-x86_64-threaded tcl-threaded
# cd ..
# '';
patchPhase = '' patchPhase = ''
find charm-*/ -type f | xargs sed -i \ find charm -type f | xargs sed -i \
-e 's,/bin/cp,cp,g' \ -e 's,/bin/cp,cp,g' \
-e 's,/bin/rm,rm,g' \ -e 's,/bin/rm,rm,g' \
-e 's,/lib/cpp,cpp,g' -e 's,/lib/cpp,cpp,g'
''; '';
configurePhase = '' configurePhase = ''
tcsh -f ./config Linux-x86_64-g++ --charm-arch multicore-linux64 tcsh -f ./config Linux-x86_64-g++ --charm-arch multicore-linux64 --with-fftw3
''; '';
buildPhase = '' buildPhase = ''
cd charm-*/ cd charm
./build charm++ multicore-linux64 --no-build-shared --with-production ./build charm++ multicore-linux64 --no-build-shared --with-production
cd .. cd ..
cd Linux-x86_64-g++ cd Linux-x86_64-g++
@@ -49,7 +66,8 @@ stdenv.mkDerivation rec {
''; '';
buildInputs = [ buildInputs = [
bash
tcsh tcsh
tcl-8_5
fftwSinglePrec
]; ];
} }