2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchurl
|
|
|
|
, unzip
|
|
|
|
, makeDesktopItem
|
|
|
|
, jre
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "jmol";
|
|
|
|
exec = "jmol";
|
|
|
|
desktopName = "JMol";
|
|
|
|
genericName = "Molecular Modeler";
|
2022-03-05 16:20:37 +00: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" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2023-08-22 20:05:09 +00:00
|
|
|
version = "16.1.33";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "jmol";
|
|
|
|
|
|
|
|
src = let
|
|
|
|
baseVersion = "${lib.versions.major version}.${lib.versions.minor version}";
|
|
|
|
in fetchurl {
|
|
|
|
url = "mirror://sourceforge/jmol/Jmol/Version%20${baseVersion}/Jmol%20${version}/Jmol-${version}-binary.tar.gz";
|
2023-08-22 20:05:09 +00:00
|
|
|
hash = "sha256-vOFGmLsCQNYRBMuDRVrdjWE6/MxY7IucB1OpV4cdZrs=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patchPhase = ''
|
|
|
|
sed -i -e "4s:.*:command=${jre}/bin/java:" -e "10s:.*:jarpath=$out/share/jmol/Jmol.jar:" -e "11,21d" jmol
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out/share/jmol" "$out/bin"
|
|
|
|
|
|
|
|
${unzip}/bin/unzip jsmol.zip -d "$out/share/"
|
|
|
|
|
|
|
|
cp *.jar jmol.sh "$out/share/jmol"
|
|
|
|
cp -r ${desktopItem}/share/applications $out/share
|
|
|
|
cp jmol $out/bin
|
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A Java 3D viewer for chemical structures";
|
|
|
|
homepage = "https://sourceforge.net/projects/jmol";
|
2022-06-16 17:23:12 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryBytecode ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.lgpl2;
|
|
|
|
platforms = platforms.all;
|
2020-11-21 19:51:51 +00:00
|
|
|
maintainers = with maintainers; [ mounium ] ++ teams.sage.members;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|