about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/science/chemistry/marvin/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-02-07 15:19:21 +0000
committerAlyssa Ross <hi@alyssa.is>2019-02-07 23:35:47 +0000
commite5013c05a2f845255debf94318ab38ecef1c186b (patch)
treebec11a0bd31d3432a16899e5539f1098f1c168a4 /nixpkgs/pkgs/applications/science/chemistry/marvin/default.nix
parent4fc07c92ec07cafcf6d56143ea7334693143ef88 (diff)
parent2d2f10475138b7206572dc3ec288184df2be022e (diff)
downloadnixlib-e5013c05a2f845255debf94318ab38ecef1c186b.tar
nixlib-e5013c05a2f845255debf94318ab38ecef1c186b.tar.gz
nixlib-e5013c05a2f845255debf94318ab38ecef1c186b.tar.bz2
nixlib-e5013c05a2f845255debf94318ab38ecef1c186b.tar.lz
nixlib-e5013c05a2f845255debf94318ab38ecef1c186b.tar.xz
nixlib-e5013c05a2f845255debf94318ab38ecef1c186b.tar.zst
nixlib-e5013c05a2f845255debf94318ab38ecef1c186b.zip
Merge commit '2d2f10475138b7206572dc3ec288184df2be022e'
Diffstat (limited to 'nixpkgs/pkgs/applications/science/chemistry/marvin/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/marvin/default.nix49
1 files changed, 49 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/science/chemistry/marvin/default.nix b/nixpkgs/pkgs/applications/science/chemistry/marvin/default.nix
new file mode 100644
index 000000000000..948aed03fe5e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/marvin/default.nix
@@ -0,0 +1,49 @@
+{ stdenv, fetchurl, dpkg, makeWrapper, coreutils, gawk, gnugrep, gnused, jre }:
+
+with stdenv.lib;
+
+stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+  pname = "marvin";
+  version = "19.1.0";
+
+  src = fetchurl {
+    name = "marvin-${version}.deb";
+    url = "http://dl.chemaxon.com/marvin/${version}/marvin_linux_${versions.majorMinor version}.deb";
+    sha256 = "1ccsimfvms5q4prjyk6sg5hsc3hkcjjfq3gl7jjm8dgd2173zzyc";
+  };
+
+  nativeBuildInputs = [ dpkg makeWrapper ];
+
+  unpackPhase = ''
+    dpkg-deb -x $src opt
+  '';
+
+  installPhase = ''
+    wrapBin() {
+      makeWrapper $1 $out/bin/$(basename $1) \
+        --set INSTALL4J_JAVA_HOME "${jre}" \
+        --prefix PATH : ${makeBinPath [ coreutils gawk gnugrep gnused ]}
+    }
+    cp -r opt $out
+    mkdir -p $out/bin $out/share/pixmaps $out/share/applications
+    for name in LicenseManager MarvinSketch MarvinView; do
+      wrapBin $out/opt/chemaxon/marvinsuite/$name
+      ln -s {$out/opt/chemaxon/marvinsuite/.install4j,$out/share/pixmaps}/$name.png
+    done
+    for name in cxcalc cxtrain evaluate molconvert mview msketch; do
+      wrapBin $out/opt/chemaxon/marvinsuite/bin/$name
+    done
+    ${concatStrings (map (name: ''
+      substitute ${./. + "/${name}.desktop"} $out/share/applications/${name}.desktop --subst-var out
+    '') [ "LicenseManager" "MarvinSketch" "MarvinView" ])}
+  '';
+
+  meta = {
+    description = "A chemical modelling, analysis and structure drawing program";
+    homepage = https://chemaxon.com/products/marvin;
+    maintainers = with maintainers; [ fusion809 ];
+    license = licenses.unfree;
+    platforms = platforms.linux;
+  };
+}
\ No newline at end of file