1 { lib, stdenv, fetchurl, dpkg, makeWrapper, coreutils, gawk, gnugrep, gnused, openjdk17 }:
3 stdenv.mkDerivation rec {
8 name = "marvin-${version}.deb";
9 url = "http://dl.chemaxon.com/marvin/${version}/marvin_linux_${lib.versions.majorMinor version}.deb";
10 hash = "sha256-zE/9EaOsNJwzE4Doasm9N8QG4t7wDOxqpV/Nhc4p7Ws=";
13 nativeBuildInputs = [ dpkg makeWrapper ];
21 makeWrapper $1 $out/bin/$(basename $1) \
22 --set INSTALL4J_JAVA_HOME "${openjdk17}" \
23 --prefix PATH : ${lib.makeBinPath [ coreutils gawk gnugrep gnused ]}
26 mkdir -p $out/bin $out/share/pixmaps $out/share/applications
27 for name in LicenseManager MarvinSketch MarvinView; do
28 wrapBin $out/opt/chemaxon/marvinsuite/$name
29 ln -s {$out/opt/chemaxon/marvinsuite/.install4j,$out/share/pixmaps}/$name.png
31 for name in cxcalc cxtrain evaluate molconvert mview msketch; do
32 wrapBin $out/opt/chemaxon/marvinsuite/bin/$name
34 ${lib.concatStrings (map (name: ''
35 substitute ${./. + "/${name}.desktop"} $out/share/applications/${name}.desktop --subst-var out
36 '') [ "LicenseManager" "MarvinSketch" "MarvinView" ])}
40 description = "Chemical modelling, analysis and structure drawing program";
41 homepage = "https://chemaxon.com/products/marvin";
42 maintainers = with maintainers; [ fusion809 ];
43 license = licenses.unfree;
44 platforms = platforms.linux;