2018-04-11 11:33:26 +02:00
|
|
|
{ stdenv
|
2018-07-12 22:31:52 +02:00
|
|
|
, lib
|
2018-04-11 11:33:26 +02:00
|
|
|
, fetchurl
|
|
|
|
, unzip
|
2017-12-04 19:53:36 +01:00
|
|
|
, makeDesktopItem
|
2018-04-11 11:33:26 +02:00
|
|
|
, jre
|
|
|
|
}:
|
|
|
|
|
2017-12-04 19:53:36 +01:00
|
|
|
let
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "jmol";
|
|
|
|
exec = "jmol";
|
|
|
|
desktopName = "JMol";
|
|
|
|
genericName = "Molecular Modeler";
|
2022-02-22 15:56:15 +01:00
|
|
|
mimeTypes = [
|
|
|
|
"chemical/x-pdb"
|
|
|
|
"chemical/x-mdl-molfile"
|
|
|
|
"chemical/x-mol2"
|
|
|
|
"chemical/seq-aa-fasta"
|
|
|
|
"chemical/seq-na-fasta"
|
|
|
|
"chemical/x-xyz"
|
|
|
|
"chemical/x-mdl-sdf"
|
|
|
|
];
|
|
|
|
categories = [ "Graphics" "Education" "Science" "Chemistry" ];
|
2017-12-04 19:53:36 +01:00
|
|
|
};
|
|
|
|
in
|
2018-04-11 11:33:26 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2022-09-25 23:24:47 +02:00
|
|
|
version = "14.32.75";
|
2018-04-11 11:33:26 +02:00
|
|
|
pname = "jmol";
|
|
|
|
|
2019-02-06 12:25:25 +01:00
|
|
|
src = let
|
2018-07-12 22:31:52 +02:00
|
|
|
baseVersion = "${lib.versions.major version}.${lib.versions.minor version}";
|
|
|
|
in fetchurl {
|
2018-04-11 11:33:26 +02:00
|
|
|
url = "mirror://sourceforge/jmol/Jmol/Version%20${baseVersion}/Jmol%20${version}/Jmol-${version}-binary.tar.gz";
|
2022-09-25 23:24:47 +02:00
|
|
|
sha256 = "sha256-2D2WBrBmmA84RVLsICFMeQKLvv5nIekbS/EGlmlvtYQ=";
|
2018-04-11 11:33:26 +02:00
|
|
|
};
|
|
|
|
|
2017-12-04 19:53:36 +01:00
|
|
|
patchPhase = ''
|
|
|
|
sed -i -e "4s:.*:command=${jre}/bin/java:" -e "10s:.*:jarpath=$out/share/jmol/Jmol.jar:" -e "11,21d" jmol
|
|
|
|
'';
|
2018-04-11 11:33:26 +02:00
|
|
|
|
|
|
|
installPhase = ''
|
2017-12-04 19:53:36 +01:00
|
|
|
mkdir -p "$out/share/jmol" "$out/bin"
|
2018-04-11 11:33:26 +02:00
|
|
|
|
|
|
|
${unzip}/bin/unzip jsmol.zip -d "$out/share/"
|
|
|
|
|
|
|
|
cp *.jar jmol.sh "$out/share/jmol"
|
2017-12-04 19:53:36 +01:00
|
|
|
cp -r ${desktopItem}/share/applications $out/share
|
|
|
|
cp jmol $out/bin
|
2018-04-11 11:33:26 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2018-04-11 11:33:26 +02:00
|
|
|
description = "A Java 3D viewer for chemical structures";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://sourceforge.net/projects/jmol";
|
2022-06-02 15:38:41 +02:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryBytecode ];
|
2018-04-11 11:33:26 +02:00
|
|
|
license = licenses.lgpl2;
|
|
|
|
platforms = platforms.all;
|
2020-11-17 20:41:33 +01:00
|
|
|
maintainers = with maintainers; [ mounium ] ++ teams.sage.members;
|
2018-04-11 11:33:26 +02:00
|
|
|
};
|
|
|
|
}
|