Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 75 lines 1.8 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchurl, 5 dpkg, 6 makeWrapper, 7 coreutils, 8 gawk, 9 gnugrep, 10 gnused, 11 openjdk17, 12}: 13 14stdenv.mkDerivation rec { 15 pname = "marvin"; 16 version = "23.17.0"; 17 18 src = fetchurl { 19 name = "marvin-${version}.deb"; 20 url = "http://dl.chemaxon.com/marvin/${version}/marvin_linux_${lib.versions.majorMinor version}.deb"; 21 hash = "sha256-zE/9EaOsNJwzE4Doasm9N8QG4t7wDOxqpV/Nhc4p7Ws="; 22 }; 23 24 nativeBuildInputs = [ 25 dpkg 26 makeWrapper 27 ]; 28 29 unpackPhase = '' 30 dpkg-deb -x $src opt 31 ''; 32 33 installPhase = '' 34 wrapBin() { 35 makeWrapper $1 $out/bin/$(basename $1) \ 36 --set INSTALL4J_JAVA_HOME "${openjdk17}" \ 37 --prefix PATH : ${ 38 lib.makeBinPath [ 39 coreutils 40 gawk 41 gnugrep 42 gnused 43 ] 44 } 45 } 46 cp -r opt $out 47 mkdir -p $out/bin $out/share/pixmaps $out/share/applications 48 for name in LicenseManager MarvinSketch MarvinView; do 49 wrapBin $out/opt/chemaxon/marvinsuite/$name 50 ln -s {$out/opt/chemaxon/marvinsuite/.install4j,$out/share/pixmaps}/$name.png 51 done 52 for name in cxcalc cxtrain evaluate molconvert mview msketch; do 53 wrapBin $out/opt/chemaxon/marvinsuite/bin/$name 54 done 55 ${lib.concatStrings ( 56 map 57 (name: '' 58 substitute ${./. + "/${name}.desktop"} $out/share/applications/${name}.desktop --subst-var out 59 '') 60 [ 61 "LicenseManager" 62 "MarvinSketch" 63 "MarvinView" 64 ] 65 )} 66 ''; 67 68 meta = with lib; { 69 description = "Chemical modelling, analysis and structure drawing program"; 70 homepage = "https://chemaxon.com/products/marvin"; 71 maintainers = with maintainers; [ fusion809 ]; 72 license = licenses.unfree; 73 platforms = platforms.linux; 74 }; 75}