about summary refs log tree commit diff
path: root/pkgs/by-name/li/libsbml/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/li/libsbml/package.nix')
-rw-r--r--pkgs/by-name/li/libsbml/package.nix58
1 files changed, 58 insertions, 0 deletions
diff --git a/pkgs/by-name/li/libsbml/package.nix b/pkgs/by-name/li/libsbml/package.nix
new file mode 100644
index 0000000000000..ce895beee0060
--- /dev/null
+++ b/pkgs/by-name/li/libsbml/package.nix
@@ -0,0 +1,58 @@
+{
+  lib,
+  stdenv,
+  fetchFromGitHub,
+  fetchpatch,
+  cmake,
+  pkg-config,
+  bzip2,
+  libxml2,
+  swig,
+}:
+stdenv.mkDerivation (attrs: {
+  pname = "libsbml";
+  version = "5.20.2";
+
+  src = fetchFromGitHub {
+    owner = "sbmlteam";
+    repo = "libsbml";
+    rev = "v${attrs.version}";
+    hash = "sha256-8JT2r0zuf61VewtZaOAccaOUmDlQPnllA0fXE9rT5X8=";
+  };
+
+  patches = [
+    # This should be in next release, remember to remove fetchpatch
+    (fetchpatch {
+      name = "fix-xmlerror-conversion.patch";
+      url = "https://github.com/sbmlteam/libsbml/pull/358.patch";
+      hash = "sha256-uirG6XJ+w0hqBUEAGDnzhHoVtJVRdN1eqBYeneKMBao=";
+    })
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+    swig
+  ];
+
+  buildInputs = [
+    bzip2.dev
+    libxml2
+  ];
+
+  # libSBML doesn't always make use of pkg-config
+  cmakeFlags = [
+    "-DLIBXML_INCLUDE_DIR=${lib.getDev libxml2}/include/libxml2"
+    "-DLIBXML_LIBRARY=${lib.getLib libxml2}/lib/libxml2${stdenv.hostPlatform.extensions.sharedLibrary}"
+    "-DPKG_CONFIG_EXECUTABLE=${lib.getBin pkg-config}/bin/pkg-config"
+    "-DSWIG_EXECUTABLE=${lib.getBin swig}/bin/swig"
+  ];
+
+  meta = with lib; {
+    description = "Library for manipulating Systems Biology Markup Language (SBML)";
+    homepage = "https://github.com/sbmlteam/libsbml";
+    license = licenses.lgpl21Only;
+    maintainers = [maintainers.kupac];
+    platforms = platforms.all;
+  };
+})