summaryrefslogtreecommitdiffstats
path: root/pkgs/applications/science
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/science')
-rw-r--r--pkgs/applications/science/biology/bcftools/default.nix11
-rw-r--r--pkgs/applications/science/biology/bedtools/default.nix10
-rw-r--r--pkgs/applications/science/logic/elan/0001-dynamically-patchelf-binaries.patch40
-rw-r--r--pkgs/applications/science/logic/elan/default.nix34
-rw-r--r--pkgs/applications/science/logic/lean/default.nix4
-rw-r--r--pkgs/applications/science/medicine/xmedcon/default.nix36
-rw-r--r--pkgs/applications/science/misc/snakemake/default.nix8
-rw-r--r--pkgs/applications/science/physics/professor/default.nix41
8 files changed, 170 insertions, 14 deletions
diff --git a/pkgs/applications/science/biology/bcftools/default.nix b/pkgs/applications/science/biology/bcftools/default.nix
index e15cac60295e..80506bb79b6c 100644
--- a/pkgs/applications/science/biology/bcftools/default.nix
+++ b/pkgs/applications/science/biology/bcftools/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchurl, htslib, zlib, bzip2, lzma, curl, perl, python, bash }:
+{ lib, stdenv, fetchurl, htslib, zlib, bzip2, lzma, curl, perl, python3, bash }:
stdenv.mkDerivation rec {
pname = "bcftools";
@@ -9,7 +9,14 @@ stdenv.mkDerivation rec {
sha256 = "0r508mp15pqzf8r1269kb4v5naw9zsvbwd3cz8s1yj7carsf9viw";
};
- buildInputs = [ htslib zlib bzip2 lzma curl perl python ];
+ nativeBuildInputs = [
+ perl
+ python3
+ ];
+
+ buildInputs = [ htslib zlib bzip2 lzma curl ];
+
+ strictDeps = true;
makeFlags = [
"HSTDIR=${htslib}"
diff --git a/pkgs/applications/science/biology/bedtools/default.nix b/pkgs/applications/science/biology/bedtools/default.nix
index d0553bb0649a..f5aad5d05543 100644
--- a/pkgs/applications/science/biology/bedtools/default.nix
+++ b/pkgs/applications/science/biology/bedtools/default.nix
@@ -1,4 +1,4 @@
-{lib, stdenv, fetchFromGitHub, zlib, python, bzip2, lzma}:
+{lib, stdenv, fetchFromGitHub, zlib, python3, bzip2, lzma}:
stdenv.mkDerivation rec {
pname = "bedtools";
@@ -11,7 +11,13 @@ stdenv.mkDerivation rec {
sha256 = "sha256-NqKldF7ePJn3pT+AkESIQghBKSFFOEBBsTaKEbU+oaQ=";
};
- buildInputs = [ zlib python bzip2 lzma ];
+ strictDeps = true;
+
+ nativeBuildInputs = [
+ python3
+ ];
+
+ buildInputs = [ zlib bzip2 lzma ];
cxx = if stdenv.cc.isClang then "clang++" else "g++";
cc = if stdenv.cc.isClang then "clang" else "gcc";
buildPhase = "make prefix=$out SHELL=${stdenv.shell} CXX=${cxx} CC=${cc} -j $NIX_BUILD_CORES";
diff --git a/pkgs/applications/science/logic/elan/0001-dynamically-patchelf-binaries.patch b/pkgs/applications/science/logic/elan/0001-dynamically-patchelf-binaries.patch
new file mode 100644
index 000000000000..b382e6f9e754
--- /dev/null
+++ b/pkgs/applications/science/logic/elan/0001-dynamically-patchelf-binaries.patch
@@ -0,0 +1,40 @@
+diff --git a/src/elan-dist/src/component/package.rs b/src/elan-dist/src/component/package.rs
+index fd9fe74..0fefa39 100644
+--- a/src/elan-dist/src/component/package.rs
++++ b/src/elan-dist/src/component/package.rs
+@@ -50,11 +50,35 @@ fn unpack_without_first_dir<R: Read>(archive: &mut tar::Archive<R>, path: &Path)
+ };
+
+ try!(entry.unpack(&full_path).chain_err(|| ErrorKind::ExtractingPackage));
++ nix_patchelf_if_needed(&full_path);
+ }
+
+ Ok(())
+ }
+
++fn nix_patchelf_if_needed(dest_path: &Path) {
++ let (is_bin, is_lib) = if let Some(p) = dest_path.parent() {
++ (p.ends_with("bin"), p.ends_with("lib"))
++ } else {
++ (false, false)
++ };
++
++ if is_bin {
++ let _ = ::std::process::Command::new("@patchelf@/bin/patchelf")
++ .arg("--set-interpreter")
++ .arg("@dynamicLinker@")
++ .arg(dest_path)
++ .output();
++ }
++ else if is_lib {
++ let _ = ::std::process::Command::new("@patchelf@/bin/patchelf")
++ .arg("--set-rpath")
++ .arg("@libPath@")
++ .arg(dest_path)
++ .output();
++ }
++}
++
+ #[derive(Debug)]
+ pub struct ZipPackage<'a>(temp::Dir<'a>);
+
diff --git a/pkgs/applications/science/logic/elan/default.nix b/pkgs/applications/science/logic/elan/default.nix
index bb10998b2f45..fab930e2c7b8 100644
--- a/pkgs/applications/science/logic/elan/default.nix
+++ b/pkgs/applications/science/logic/elan/default.nix
@@ -1,24 +1,46 @@
-{ lib, pkg-config, curl, openssl, zlib, fetchFromGitHub, rustPlatform }:
+{ stdenv, lib, runCommand, patchelf, makeWrapper, pkg-config, curl
+, openssl, gmp, zlib, fetchFromGitHub, rustPlatform }:
+
+let
+ libPath = lib.makeLibraryPath [ gmp ];
+in
rustPlatform.buildRustPackage rec {
pname = "elan";
- version = "0.10.3";
+ version = "0.11.0";
src = fetchFromGitHub {
owner = "kha";
repo = "elan";
rev = "v${version}";
- sha256 = "sha256-YkGfuqtvVfPcxJ8UqD5QidcNEy5brTWGEK4fR64Yz70=";
+ sha256 = "1sl69ygdwhf80sx6m76x5gp1kwsw0rr1lv814cgzm8hvyr6g0jqa";
};
- cargoSha256 = "sha256-2fYicpoEERwD4OjdpseKQOkDvZlb7NnOZcb6Tu+rQdA=";
+ cargoSha256 = "1f881maf8jizd5ip7pc1ncbiq7lpggp0byma13pvqk7gisnqyr4r";
- nativeBuildInputs = [ pkg-config ];
+ nativeBuildInputs = [ pkg-config makeWrapper ];
+ OPENSSL_NO_VENDOR = 1;
buildInputs = [ curl zlib openssl ];
cargoBuildFlags = [ "--features no-self-update" ];
+ patches = lib.optionals stdenv.isLinux [
+ # Run patchelf on the downloaded binaries.
+ # This necessary because Lean 4 now dynamically links to GMP.
+ (runCommand "0001-dynamically-patchelf-binaries.patch" {
+ CC = stdenv.cc;
+ patchelf = patchelf;
+ libPath = "$ORIGIN/../lib:${libPath}";
+ } ''
+ export dynamicLinker=$(cat $CC/nix-support/dynamic-linker)
+ substitute ${./0001-dynamically-patchelf-binaries.patch} $out \
+ --subst-var patchelf \
+ --subst-var dynamicLinker \
+ --subst-var libPath
+ '')
+ ];
+
postInstall = ''
pushd $out/bin
mv elan-init elan
@@ -27,6 +49,8 @@ rustPlatform.buildRustPackage rec {
done
popd
+ wrapProgram $out/bin/elan --prefix "LD_LIBRARY_PATH" : "${libPath}"
+
# tries to create .elan
export HOME=$(mktemp -d)
mkdir -p "$out/share/"{bash-completion/completions,fish/vendor_completions.d,zsh/site-functions}
diff --git a/pkgs/applications/science/logic/lean/default.nix b/pkgs/applications/science/logic/lean/default.nix
index d57db0fd0d70..b57ee0f61f13 100644
--- a/pkgs/applications/science/logic/lean/default.nix
+++ b/pkgs/applications/science/logic/lean/default.nix
@@ -2,13 +2,13 @@
stdenv.mkDerivation rec {
pname = "lean";
- version = "3.27.0";
+ version = "3.28.0";
src = fetchFromGitHub {
owner = "leanprover-community";
repo = "lean";
rev = "v${version}";
- sha256 = "sha256-DSIWuMlweu9dsah5EdVCNQ9ADjYoEZongfw/Yh7/N/A=";
+ sha256 = "sha256-IzoFE92F559WeSUCiYZ/fx2hrsyRzgOACr3/pzJ4OOY=";
};
nativeBuildInputs = [ cmake ];
diff --git a/pkgs/applications/science/medicine/xmedcon/default.nix b/pkgs/applications/science/medicine/xmedcon/default.nix
new file mode 100644
index 000000000000..e4a5f22891e8
--- /dev/null
+++ b/pkgs/applications/science/medicine/xmedcon/default.nix
@@ -0,0 +1,36 @@
+{ stdenv
+, lib
+, fetchurl
+, gtk3
+, glib
+, pkg-config
+, libpng
+, zlib
+}:
+
+stdenv.mkDerivation rec {
+ pname = "xmedcon";
+ version = "0.21.0";
+
+ src = fetchurl {
+ url = "https://prdownloads.sourceforge.net/${pname}/${pname}-${version}.tar.bz2";
+ sha256 = "0yfnbrcil5i76z1wbg308pb1mnjbcxy6nih46qpqs038v1lhh4q8";
+ };
+
+ buildInputs = [
+ gtk3
+ glib
+ libpng
+ zlib
+ ];
+
+ nativeBuildInputs = [ pkg-config ];
+
+ meta = with lib; {
+ description = "An open source toolkit for medical image conversion ";
+ homepage = "https://xmedcon.sourceforge.io/Main/HomePage";
+ license = licenses.lgpl2Plus;
+ maintainers = with maintainers; [ arianvp flokli ];
+ platforms = with platforms; [ darwin linux ];
+ };
+}
diff --git a/pkgs/applications/science/misc/snakemake/default.nix b/pkgs/applications/science/misc/snakemake/default.nix
index edf26f7ec230..b2afc4701a55 100644
--- a/pkgs/applications/science/misc/snakemake/default.nix
+++ b/pkgs/applications/science/misc/snakemake/default.nix
@@ -2,13 +2,14 @@
python3Packages.buildPythonApplication rec {
pname = "snakemake";
- version = "5.28.0";
+ version = "6.0.5";
propagatedBuildInputs = with python3Packages; [
appdirs
ConfigArgParse
datrie
docutils
+ filelock
GitPython
jsonschema
nbformat
@@ -17,19 +18,20 @@ python3Packages.buildPythonApplication rec {
pyyaml
ratelimiter
requests
+ smart_open
toposort
wrapt
];
src = python3Packages.fetchPypi {
inherit pname version;
- sha256 = "2367ce91baf7f8fa7738d33aff9670ffdf5410bbac49aeb209f73b45a3425046";
+ sha256 = "9441169034cce46086a8b45486d75175db645b932e766d28fed312ec837792d3";
};
doCheck = false; # Tests depend on Google Cloud credentials at ${HOME}/gcloud-service-key.json
meta = with lib; {
- homepage = "https://snakemake.readthedocs.io";
+ homepage = "https://snakemake.github.io";
license = licenses.mit;
description = "Python-based execution environment for make-like workflows";
longDescription = ''
diff --git a/pkgs/applications/science/physics/professor/default.nix b/pkgs/applications/science/physics/professor/default.nix
new file mode 100644
index 000000000000..6d52951ee9c9
--- /dev/null
+++ b/pkgs/applications/science/physics/professor/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchurl, eigen, makeWrapper, python3 }:
+
+stdenv.mkDerivation rec {
+ pname = "professor";
+ version = "2.3.3";
+
+ src = fetchurl {
+ name = "Professor-${version}.tar.gz";
+ url = "https://professor.hepforge.org/downloads/?f=Professor-${version}.tar.gz";
+ sha256 = "17q026r2fpfxzf74d1013ksy3a9m57rcr2q164n9x02ci40bmib0";
+ };
+
+ postPatch = lib.optionalString stdenv.isDarwin ''
+ substituteInPlace Makefile \
+ --replace '-shared -o' '-shared -install_name "$(out)/$@" -o'
+ '';
+
+ nativeBuildInputs = [ python3.pkgs.cython makeWrapper ];
+ buildInputs = [ python3 eigen ];
+ propagatedBuildInputs = with python3.pkgs; [ iminuit numpy matplotlib yoda ];
+
+ CPPFLAGS = [ "-I${eigen}/include/eigen3" ];
+ PREFIX = placeholder "out";
+
+ postInstall = ''
+ for prog in "$out"/bin/*; do
+ wrapProgram "$prog" --set PYTHONPATH "$PYTHONPATH:$(toPythonPath "$out")"
+ done
+ '';
+
+ doInstallCheck = true;
+ installCheckTarget = "check";
+
+ meta = with lib; {
+ description = "A tuning tool for Monte Carlo event generators";
+ homepage = "https://professor.hepforge.org/";
+ license = licenses.unfree; # no license specified
+ maintainers = [ maintainers.veprbl ];
+ platforms = platforms.unix;
+ };
+}