3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/science/chemistry/marvin/default.nix

49 lines
1.6 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, dpkg, makeWrapper, coreutils, gawk, gnugrep, gnused, jre }:
with stdenv.lib;
stdenv.mkDerivation rec {
pname = "marvin";
2020-11-18 21:03:39 +00:00
version = "20.20.0";
src = fetchurl {
name = "marvin-${version}.deb";
url = "http://dl.chemaxon.com/marvin/${version}/marvin_linux_${versions.majorMinor version}.deb";
2020-11-18 21:03:39 +00:00
sha256 = "1a8b0drb0c95c8arm3aa0z0sbdm9ilj4h1g90i0qyn4g2wk2xsal";
};
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";
2020-03-30 05:02:45 +01:00
homepage = "https://chemaxon.com/products/marvin";
maintainers = with maintainers; [ fusion809 ];
license = licenses.unfree;
platforms = platforms.linux;
};
2020-02-10 09:26:58 +00:00
}