openrasmol: new package (#21530)
This commit is contained in:
parent
ed1540efa3
commit
432625ca26
4 changed files with 119 additions and 0 deletions
68
var/spack/repos/builtin/packages/openrasmol/package.py
Normal file
68
var/spack/repos/builtin/packages/openrasmol/package.py
Normal file
|
@ -0,0 +1,68 @@
|
|||
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
|
||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
from spack import *
|
||||
|
||||
|
||||
class Openrasmol(MakefilePackage):
|
||||
"""RasMol is a molecular graphics program intended for the
|
||||
visualisation of proteins, nucleic acids and small molecules."""
|
||||
|
||||
homepage = "http://www.openrasmol.org/"
|
||||
url = "https://sourceforge.net/projects/openrasmol/files/RasMol/RasMol_2.7.5/RasMol-2.7.5.2.tar.gz"
|
||||
|
||||
version('2.7.5.2', sha256='b975e6e69d5c6b161a81f04840945d2f220ac626245c61bcc6c56181b73a5718')
|
||||
|
||||
depends_on('imake', type='build')
|
||||
depends_on('libxext', type='link')
|
||||
depends_on('libxi', type='link')
|
||||
|
||||
depends_on('cbflib@0.9.2', type='link')
|
||||
depends_on('cqrlib@1.1.2', type='link')
|
||||
depends_on('cvector@1.0.3', type='link')
|
||||
depends_on('neartree@3.1', type='link')
|
||||
depends_on('xforms@1.0.91', type='link')
|
||||
|
||||
patch('rasmol_noqa.patch')
|
||||
patch('rasmol_help.patch')
|
||||
|
||||
def edit(self, spec, prefix):
|
||||
with working_dir('src'):
|
||||
# Imakefile
|
||||
bash = which('bash')
|
||||
bash('./rasmol_build_options.sh')
|
||||
# host.def
|
||||
with open('host.def', 'w') as f:
|
||||
f.write('#ifdef AfterVendorCF\n')
|
||||
f.write('#define CcCmd {0}\n'.format(spack_cc))
|
||||
f.write('#endif\n')
|
||||
|
||||
def setup_build_environment(self, env):
|
||||
env.set('XFORMSLIB_DIR', self.spec['xforms'].prefix)
|
||||
env.set('CBFLIB_DIR', self.spec['cbflib'].prefix)
|
||||
env.set('CQRLIB_DIR', self.spec['cqrlib'].prefix)
|
||||
env.set('CVECTOR_DIR', self.spec['cvector'].prefix)
|
||||
env.set('NEARTREE_DIR', self.spec['neartree'].prefix)
|
||||
|
||||
def build(self, spec, prefix):
|
||||
with working_dir('src'):
|
||||
bash = which('bash')
|
||||
bash('./build_all.sh')
|
||||
|
||||
def install(self, spec, prefix):
|
||||
install_tree('./data', prefix.sample)
|
||||
install_tree('./doc', prefix.doc)
|
||||
with working_dir('src'):
|
||||
bash = which('bash')
|
||||
bash('./rasmol_install.sh', '--prefix={0}'.format(prefix))
|
||||
|
||||
def test(self):
|
||||
testdir = self.test_suite.current_test_data_dir
|
||||
opts = []
|
||||
opts.append('-insecure')
|
||||
opts.append('-script')
|
||||
opts.append(join_path(testdir, 'test.rsc'))
|
||||
opts.append(join_path(self.prefix.sample, '1crn.pdb'))
|
||||
self.run_test('rasmol', options=opts)
|
|
@ -0,0 +1,22 @@
|
|||
--- a/src/command.c 2021-02-04 01:59:48.968985028 +0900
|
||||
+++ b/src/command.c 2021-02-04 02:02:15.548984240 +0900
|
||||
@@ -118,6 +118,10 @@
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
+#include <limits.h>
|
||||
+#ifndef PATH_MAX
|
||||
+#define PATH_MAX 1024
|
||||
+#endif
|
||||
|
||||
#if !defined(IBMPC) && !defined(VMS) && !defined(APPLEMAC)
|
||||
#include <pwd.h>
|
||||
@@ -229,7 +233,7 @@
|
||||
|
||||
#define HelpPool 16
|
||||
static char *HelpFileName;
|
||||
-static char HelpFileBuf[80];
|
||||
+static char HelpFileBuf[PATH_MAX];
|
||||
static HlpEntry __far *FreeInfo;
|
||||
static HlpEntry __far *HelpInfo;
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
--- a/src/rasmol_install.sh 2021-01-23 02:35:53.420843463 +0900
|
||||
+++ b/src/rasmol_install.sh 2021-01-23 02:46:42.576839974 +0900
|
||||
@@ -226,11 +226,6 @@
|
||||
fi
|
||||
fi
|
||||
|
||||
-echo -n "Install rasmol into \"$RASMOLPATH\"? [y/N] ";
|
||||
-read ok
|
||||
-if [ "$ok" != "y" ] && [ "$ok" != "Y" ] ; then exit 1 ;
|
||||
-fi
|
||||
-
|
||||
savecurdir=`pwd` ;
|
||||
cd $RASMOLPATH ;
|
||||
rasmolpath=`pwd` ;
|
||||
@@ -245,11 +240,6 @@
|
||||
|
||||
fi
|
||||
|
||||
-echo -n "Install rasmol program wrapper in \"$bindest/rasmol\"? [y/N] ";
|
||||
-read ok
|
||||
-if [ "$ok" != "y" ] && [ "$ok" != "Y" ]; then unset bindest ;
|
||||
-fi
|
||||
-
|
||||
|
||||
if ! [ -d $bindest ] ; then
|
||||
mkdir -p $bindest ;
|
|
@ -0,0 +1,3 @@
|
|||
wireframe true
|
||||
write ps test.ps
|
||||
quit
|
Loading…
Reference in a new issue