WS-KCNHUB/overlays/smoldyn.nix

363 lines
7.5 KiB
Nix

final: final-py: prev-py: let
rust-new = p: p.fenix.stable;
rustPlatform = final.makeRustPlatform {
inherit (rust-new final) cargo rustc;
};
py = final-py;
pyenv-smoldyn = py.python.withPackages (p: with p; [
setuptools
wheel
pybind11
pip
]);
smoldyn = final.fastStdenv.mkDerivation rec {
pname = "smoldyn";
version = "2.74";
outputs = [ "out" "py" ];
env.NIX_CFLAGS_COMPILE = "-march=native -mtune=native";
src = final.fetchzip {
url = "https://www.smoldyn.org/smoldyn-${version}.zip";
hash = "sha256-cKUMGgnPrHf2dNyFHmjpERgIMU0OltUZ/uhBfxpU4e4=";
};
nativeBuildInputs = with final; [
cmake
];
cmakeFlags = [
"-DSMOLDYN_VERSION=${version}"
"-DOPTION_ZLIB=ON"
];
buildInputs = with final; [
libGL
libGLU
freeglut
libtiff
zlib
pyenv-smoldyn
];
postInstall = ''
cp -r py $py
'';
};
in {
libsbml = final.libsbml.override {
python=py.python;
withPython=true;
};
libcombine = py.buildPythonPackage rec {
pname = "libcombine";
version = "0.2.20";
src = final.fetchFromGitHub {
owner = "sbmlteam";
repo = "libcombine";
rev = "v${version}";
fetchSubmodules = true;
hash = "sha256-9MMQr0hQLo1l8B4nlzkk48zohCohdheojRTjKrCE6og=";
};
preBuild = ''
cd ..
cp src/bindings/python/setup.py .
'';
nativeBuildInputs = with final; [
swig cmake
];
buildInputs = with py; [
libsbml
final.zlib
];
};
libsedml = py.buildPythonPackage rec {
pname = "libsedml";
version = "2.0.28";
src = final.fetchFromGitHub {
owner = "fbergmann";
repo = "libSEDML";
rev = "v${version}";
fetchSubmodules = true;
hash = "sha256-Pxts0kKj3BlfrwhXJjNvL936aSXiTb1cnccsW2lbUaM=";
};
preBuild = ''
cp src/bindings/python/setup.py .
'';
buildInputs = [
final.cmake
];
};
pyomexmeta = py.buildPythonPackage rec {
pname = "pyomexmeta";
version = "1.2.14";
src = final.fetchFromGitHub {
owner = "sys-bio";
repo = "libOmexMeta";
rev = "v${version}";
hash = "sha256-OMCq8uR3kC5cZpFyy28A02OSiVO4b49lFyWmbCeaw6c=";
};
};
# https://github.com/simularium/simulariumio/blob/main/pyproject.toml
simulariumio = py.buildPythonPackage rec {
pname = "simulariumio";
version = "1.12.0";
src = final.fetchFromGitHub {
owner = "simularium";
repo = "simulariumio";
rev = "v${version}";
hash = "sha256-Jl7KXEXeheYJRpgVcHyK6YUzyQMafQnABlrZM9d7c9g=";
leaveDotGit = true;
};
format = "pyproject";
nativeBuildInputs = with py; [
setuptools
setuptools_scm
wheel
];
SETUPTOOLS_SCM_PRETEND_VERSION=version;
propagatedBuildInputs = with py; [
numpy
pandas
pint
];
};
# https://github.com/biosimulators/Biosimulators_simularium
biosimulator_simularium = py.buildPythonPackage rec {
pname = "biosimulator";
version = "0.6.3";
src = final.fetchFromGitHub {
owner = "biosimulators";
repo = "biosimulators_simularium";
rev = "v${version}";
hash = "sha256-t0YM5Ika6Glvw3wvV71w7IHo6AovXz+7012rueEkoFw=";
};
format = "pyproject";
nativeBuildInputs = with py; [
poetry-core
];
};
biosimulator_util = py.buildPythonPackage rec {
pname = "biosimulator";
version = "0.2.3";
src = final.fetchFromGitHub {
owner = "biosimulators";
repo = "biosimulators_utils";
rev = "${version}";
hash = "sha256-/4HxruGpyJ6Guk4or/i+XI1JnHh2y7tWmw0AgdP5bkU=";
};
nativeBuildInputs = with py; [
pip
];
propagatedBuildInputs = with py; [
capturer
pkg_utils
jsonschema
flaky
bezier
rdflib
kisao
appdirs
matplotlib
docker
cement
regex
biopython
lxml
natsort
simplejson
libcombine
libsedml
pyomexmeta
pyyaml
evalidate
];
doCheck = false;
};
# https://github.com/yaroslaff/evalidate
evalidate = py.buildPythonPackage rec {
pname = "evalidate";
version = "2.0.3";
format = "pyproject";
src = final.fetchFromGitHub {
owner = "yaroslaff";
repo = "evalidate";
rev = "v${version}";
hash = "sha256-0SdGjsddX/iYeXpB9AdD7hnBH8raGHvSZ7D30a3sRXE=";
};
nativeBuildInputs = with py; [
hatchling
];
propagatedBuildInputs = with py; [
uritools
];
};
pkg_utils = py.buildPythonPackage rec {
pname = "pkg_utils";
version = "0.0.5";
src = final.fetchFromGitHub {
owner = "KarrLab";
repo = "pkg_utils";
rev = "${version}";
hash = "sha256-u6t4z1MoEkgoPkZtJuTYUbL5HyrkYthSPu9bhm8IZwo=";
};
nativeBuildInputs = with py; [
pip
];
propagatedBuildInputs = with py; [
glob2
requirements-parser
configparser
];
};
pronto = py.buildPythonPackage rec {
pname = "pronto";
version = "2.7.0";
src = final.fetchFromGitHub {
owner = "althonos";
repo = "pronto";
rev = "v${version}";
hash = "sha256-e+Nf+0kOH8d8KU2U9imxfeP1AjY2g/oZwZmQG394cts=";
};
nativeBuildInputs = with py; [
setuptools
];
buildInputs = with py; [
python-dateutil
];
format = "pyproject";
};
kisao = py.buildPythonPackage rec {
pname = "kisao";
version = "2.34";
src = final.fetchFromGitHub {
owner = "SED-ML";
repo = "Kisao";
rev = "${version}";
hash = "sha256-ozL1G9ylRhQL+lUCLwb2LSjooF5P8AgiWRMOWrBrDl8=";
};
prePatch = ''
cd libkisao/python
'';
nativeBuildInputs = with py; [
pip
];
propagatedBuildInputs = with py; [
pkg_utils
termcolor
pronto
python-dateutil
networkx
fastobo
chardet
];
};
fastobo = py.buildPythonPackage rec {
pname = "fastobo";
version = "0.13.0";
src = final.fetchFromGitHub {
owner = "fastobo";
repo = "fastobo-py";
rev = "v${version}";
hash = "sha256-8v9KjYX6Fy/ALFlYfSXpW40p0z54F5tpr10TAWenizk=";
};
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
name = "${pname}-${version}";
hash = "sha256-USh7WK18I8A4VdGsUAnbrSiJuBYyq4539MlyS5ANSGo=";
};
format = "pyproject";
nativeBuildInputs = [
rustPlatform.cargoSetupHook
(rustPlatform.maturinBuildHook.override {
pkgsHostTarget = {
inherit (rust-new final.pkgsHostTarget) cargo rustc;
inherit (final.pkgsHostTarget) maturin;
};
})
];
};
bezier = py.buildPythonPackage rec {
pname = "bezier";
version = "2020.2.3";
src = final.fetchFromGitHub {
owner = "dhermes";
repo = "bezier";
rev = "${version}";
hash = "sha256-yuq2+Yy9XO2KwLlsB0IxjseG/axNBa5KuxBZ2J22ruE=";
};
BEZIER_NO_EXTENSION="1";
nativeBuildInputs = with py; [
pip
];
buildInputs = with py; [
pytest
matplotlib
seaborn
scipy
];
propagatedBuildInputs = with py; [
numpy
sympy
];
};
smoldyn-py = py.buildPythonPackage {
pname = "smoldyn";
version = smoldyn.version;
src = smoldyn.py;
postPatch = ''
sed -e '37,38d' -i setup.py
'';
propagatedBuildInputs = with py; [
biosimulator_util
biosimulator_simularium
simulariumio
numpy
pandas
h5py
openpyxl
pyvista
];
};
}