namd: Generalize of over specific version numbers

This commit is contained in:
Tyson Whitehead
2016-11-28 13:54:44 -05:00
parent 58985f7fa4
commit cbd2a47683

View File

@@ -1,26 +1,27 @@
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "namd-2.11";
stdenv.mkDerivation rec {
version = "2.11";
name = "namd-${version}";
src = fetchurl {
url = http://ppomorsk.sharcnet.ca/namd-2.11.tar.gz;
url = "http://ppomorsk.sharcnet.ca/namd-${version}.tar.gz";
md5 = "8a81eb4c883edbf977d0af05351f6914";
};
postUnpack = ''
cd namd-*
tar -xf charm-6.7.0.tar
cd namd-${version}
tar -xf charm-*.tar
tar -xzf fftw-linux-x86_64.tar.gz
mv linux-x86_64 fftw
tar -xzf tcl8.5.9-linux-x86_64.tar.gz
mv tcl8.5.9-linux-x86_64 tcl
tar -xzf tcl8.5.9-linux-x86_64-threaded.tar.gz
mv tcl8.5.9-linux-x86_64-threaded tcl-threaded
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 = ''
find charm-6.7.0 -type f | xargs sed -i \
find charm-*/ -type f | xargs sed -i \
-e 's,/bin/cp,cp,g' \
-e 's,/bin/rm,rm,g' \
-e 's,/lib/cpp,cpp,g'
@@ -29,7 +30,7 @@ stdenv.mkDerivation {
tcsh -f ./config Linux-x86_64-g++ --charm-arch multicore-linux64
'';
buildPhase = ''
cd charm-6.7.0
cd charm-*/
./build charm++ multicore-linux64 --no-build-shared --with-production
cd ..
cd Linux-x86_64-g++