octopus: Switch to new version structure

This commit is contained in:
Tyson Whitehead
2018-02-07 13:39:27 -05:00
parent bb7076d9f0
commit 1c1f16a2b3
5 changed files with 100 additions and 85 deletions

View File

@@ -8,11 +8,16 @@ self: super: pkgs: with pkgs; {
#firedrake = callPackage ./firedrake { };
libxc3 = callPackage ./octopus/libxc3.nix { };
inherit (callPackages ./octopus/libxc.nix { }) libxc301 libxc404;
libxc3 = libxc301;
libxc4 = libxc404;
libxc = libxc4;
#meraculous = callPackage ./meraculous.nix { };
octopus = callPackage ./octopus { };
inherit (callPackages ./octopus/octopus.nix { }) octopus72;
octopus7 = octopus72;
octopus = octopus7;
openfoam = callPackage ./openfoam.nix { };

View File

@@ -1,59 +0,0 @@
# The following optional dependencies are not currently available
#
# pfft, pnfft, etdf_io, berkeleygw, sparskit, blacs elpa, parpack,
# feast, libfm (think this is actually scafacos) poke, parmetis
# (requires metis)
#
# The following optional dependencies are not suitable for given reason
#
# nlopt (only provides libnlopt_cxx which requires c++ compiler for linking)
#
{ stdenv, fetchurl, overrideCC, gcc5, gfortran5, perl, openmpi
, libxc3, blas, liblapack, gsl, fftw, netcdffortran
, arpack, libyaml }:
(overrideCC stdenv gcc5).mkDerivation rec {
version = "7.2";
name = "octopus-${version}";
src = fetchurl {
url = "http://www.tddft.org/programs/octopus/down.php?file=${version}/octopus-${version}.tar.gz";
sha256 = "03zzmq72zdnjkhifbmlxs7ig7x6sf6mv8zv9mxhakm9hzwa9yn7m";
};
buildInputs = [
gfortran5
perl
openmpi
libxc3
blas
liblapack
gsl
fftw
netcdffortran
arpack
libyaml
];
# Extend netcdf library combo test to include just -lnetcdff
postPatch = ''
patchShebangs build
sed -i -e 's/in "" -lnetcdf "-lnetcdff -lnetcdf";/in "" -lnetcdf "-lnetcdff -lnetcdf" -lnetcdff;/' configure
'';
configureFlags = [
"--enable-mpi"
"--with-libxc-prefix=${libxc3}"
"--with-fftw-prefix=${fftw.dev}"
"--with-netcdf-prefix=${netcdffortran}"
];
meta = with stdenv.lib; {
homepage = http://octopus-code.org/wiki/Main_Page;
description = "Octopus is a scientific program aimed at the ab initio virtual experimentation.";
platforms = platforms.all;
license = licenses.gpl2;
};
}

30
pkgs/octopus/libxc.nix Normal file
View File

@@ -0,0 +1,30 @@
{ stdenv, fetchurl, gfortran, perl }:
let
common = scripts: version: sha256: stdenv.mkDerivation rec {
inherit version;
name = "libxc-${version}";
src = fetchurl {
url = "http://www.tddft.org/programs/octopus/down.php?file=libxc/${version}/libxc-${version}.tar.gz";
inherit sha256;
};
buildInputs = [ gfortran perl ];
postPatch = ''
patchShebangs ${scripts}
'';
meta = with stdenv.lib; {
homepage = http://octopus-code.org/wiki/Libxc;
description = "Libxc is a library of exchange-correlation functionals for density-functional theory.";
platforms = platforms.all;
license = licenses.gpl3;
};
};
in {
libxc404 = common "scripts" "4.0.4" "1l43wcxn51ivy5wzdwfvvhim6vql82rw8fy5wk6s0p54xikhsgzn";
libxc301 = common "src testsuite" "3.0.1" "1xyac89yx03vm86rvk07ps1d39xss3amw46a1k53mv30mgr94rl3";
}

View File

@@ -1,24 +0,0 @@
{ stdenv, fetchurl, gfortran, perl }:
stdenv.mkDerivation rec {
version = "3.0.1";
name = "libxc-${version}";
src = fetchurl {
url = "http://www.tddft.org/programs/octopus/down.php?file=libxc/${version}/libxc-${version}.tar.gz";
sha256 = "1xyac89yx03vm86rvk07ps1d39xss3amw46a1k53mv30mgr94rl3";
};
buildInputs = [ gfortran perl ];
postPatch = ''
patchShebangs src testsuite
'';
meta = with stdenv.lib; {
homepage = http://octopus-code.org/wiki/Libxc;
description = "Libxc is a library of exchange-correlation functionals for density-functional theory.";
platforms = platforms.all;
license = licenses.gpl3;
};
}

63
pkgs/octopus/octopus.nix Normal file
View File

@@ -0,0 +1,63 @@
# The following optional dependencies are not currently available
#
# pfft, pnfft, etdf_io, berkeleygw, sparskit, blacs elpa, parpack,
# feast, libfm (think this is actually scafacos) poke, parmetis
# (requires metis)
#
# The following optional dependencies are not suitable for given reason
#
# nlopt (only provides libnlopt_cxx which requires c++ compiler for linking)
#
{ stdenv, fetchurl, overrideCC, gcc5, gfortran5, perl, openmpi
, libxc3, blas, liblapack, gsl, fftw, netcdffortran
, arpack, libyaml }:
let
common = version: sha256: (overrideCC stdenv gcc5).mkDerivation rec {
inherit version;
name = "octopus-${version}";
src = fetchurl {
url = "http://www.tddft.org/programs/octopus/down.php?file=${version}/octopus-${version}.tar.gz";
inherit sha256;
};
buildInputs = [
gfortran5
perl
openmpi
libxc3
blas
liblapack
gsl
fftw
netcdffortran
arpack
libyaml
];
# Extend netcdf library combo test to include just -lnetcdff
postPatch = ''
patchShebangs build
sed -i -e 's/in "" -lnetcdf "-lnetcdff -lnetcdf";/in "" -lnetcdf "-lnetcdff -lnetcdf" -lnetcdff;/' configure
'';
configureFlags = [
"--enable-mpi"
"--with-libxc-prefix=${libxc3}"
"--with-fftw-prefix=${fftw.dev}"
"--with-netcdf-prefix=${netcdffortran}"
];
meta = with stdenv.lib; {
homepage = http://octopus-code.org/wiki/Main_Page;
description = "Octopus is a scientific program aimed at the ab initio virtual experimentation.";
platforms = platforms.all;
license = licenses.gpl2;
};
};
in {
octopus72 = common "7.2" "03zzmq72zdnjkhifbmlxs7ig7x6sf6mv8zv9mxhakm9hzwa9yn7m";
}