2024-01-25 14:12:00 +00:00
|
|
|
{ lib, stdenv, fetchurl, dpkg, makeWrapper, coreutils, gawk, gnugrep, gnused, openjdk17 }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "marvin";
|
2024-01-25 14:12:00 +00:00
|
|
|
version = "23.17.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
name = "marvin-${version}.deb";
|
2024-09-19 14:19:46 +00:00
|
|
|
url = "http://dl.chemaxon.com/marvin/${version}/marvin_linux_${lib.versions.majorMinor version}.deb";
|
2024-01-25 14:12:00 +00:00
|
|
|
hash = "sha256-zE/9EaOsNJwzE4Doasm9N8QG4t7wDOxqpV/Nhc4p7Ws=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ dpkg makeWrapper ];
|
|
|
|
|
|
|
|
unpackPhase = ''
|
|
|
|
dpkg-deb -x $src opt
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
wrapBin() {
|
|
|
|
makeWrapper $1 $out/bin/$(basename $1) \
|
2024-01-25 14:12:00 +00:00
|
|
|
--set INSTALL4J_JAVA_HOME "${openjdk17}" \
|
2024-09-19 14:19:46 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ coreutils gawk gnugrep gnused ]}
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|
|
|
|
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
|
2024-09-19 14:19:46 +00:00
|
|
|
${lib.concatStrings (map (name: ''
|
2020-04-24 23:36:52 +00:00
|
|
|
substitute ${./. + "/${name}.desktop"} $out/share/applications/${name}.desktop --subst-var out
|
|
|
|
'') [ "LicenseManager" "MarvinSketch" "MarvinView" ])}
|
|
|
|
'';
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Chemical modelling, analysis and structure drawing program";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://chemaxon.com/products/marvin";
|
|
|
|
maintainers = with maintainers; [ fusion809 ];
|
|
|
|
license = licenses.unfree;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|