diff options
author | mschubert | 2015-06-12 12:07:48 +0100 |
---|---|---|
committer | mschubert | 2015-06-12 12:07:48 +0100 |
commit | d882fe27828ed1d8d99f62414aeb2db3d8a399da (patch) | |
tree | 912244c71b6e40b75d481351376081c97eda36d6 | |
download | aur-d882fe27828ed1d8d99f62414aeb2db3d8a399da.tar.gz |
Initial import
-rw-r--r-- | .SRCINFO | 26 | ||||
-rw-r--r-- | PKGBUILD | 94 | ||||
-rw-r--r-- | opengltk.patch | 262 |
3 files changed, 382 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..d0a364bba3e5 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,26 @@ +pkgbase = mgltools + pkgdesc = Visualization and analysis of molecular structures; includes AutoDockTools, Vision and PythonMoleculeViewer + pkgver = 1.5.6 + pkgrel = 1 + url = http://mgltools.scripps.edu/ + arch = i686 + arch = x86_64 + license = custom + depends = swig + depends = tk + depends = python2-numpy + depends = python2-imaging + depends = python2-pmw + depends = glut + depends = zsi + depends = python2-simpy + depends = libxmu + optdepends = autodocksuite + options = !emptydirs + source = http://mgltools.scripps.edu/downloads/tars/releases/REL1.5.6/mgltools_source_1.5.6.tar.gz + source = opengltk.patch + md5sums = e37ceac50fd46bd89abb2ba44a812a65 + md5sums = 357fe047c8edcd89d9cf1b8f7f70d258 + +pkgname = mgltools + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..0d3b1ba449cb --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,94 @@ +# Maintainer: Michael Schubert <mschu.dev at gmail> + +pkgname=mgltools +pkgver=1.5.6 +pkgrel=1 +pkgdesc="Visualization and analysis of molecular structures; includes AutoDockTools, Vision and PythonMoleculeViewer" +arch=('i686' 'x86_64') +url="http://mgltools.scripps.edu/" +license=('custom') +depends=('swig' 'tk' 'python2-numpy' 'python2-imaging' 'python2-pmw' 'glut' 'zsi' 'python2-simpy' 'libxmu') +optdepends=('autodocksuite') +source=("http://mgltools.scripps.edu/downloads/tars/releases/REL${pkgver}/${pkgname}_source_${pkgver}.tar.gz" + opengltk.patch) +options=('!emptydirs') +md5sums=('e37ceac50fd46bd89abb2ba44a812a65' + '357fe047c8edcd89d9cf1b8f7f70d258') + +build() { + cd "$srcdir/${pkgname}_source_$pkgver" + sed -i "1s:python2.5:python2:" InstTools/install + + # replace path by os.path where needed + sed -i "s:path.exists:os.path.exists:; \ + s:os.os.path.exists:os.path.exists:; \ + s:path.join:os.path.join:; \ + s:os.os.path.join:os.path.join:" InstTools/install + + # do not install pmw since it is dependecy already + sed -i 's:getYesNo(msg, "Do you wish to install Pmw:False #:' InstTools/install + # fix include for strcmp in geomutils + sed -i "239i\ if (pkgname == \"geomutils\"): os.popen(\"sed -i '3i#include\ + <string.h>' src/geomAlgorithms/objfile.cpp\")" InstTools/install + # fix opengltk to work with tcl/tk 8.5 + sed -i "240i\ if (pkgname == \"opengltk\"): \ + os.popen(\"sed -i 's/stub8.4/stub8.5/g' setup.py\")" InstTools/install + + # disable license popup - we'll print it to the user later + cd "$srcdir/${pkgname}_source_$pkgver/MGLPACKS" + tar -xzf mglutil-$pkgver.tar.gz + rm -f mglutil-$pkgver.tar.gz + echo > mglutil-$pkgver/mglutil/splashregister/license.py + tar -czf mglutil-$pkgver.tar.gz mglutil-$pkgver + + # fix opengltk error + cd "$srcdir/${pkgname}_source_$pkgver/MGLPACKS" + tar -xzf opengltk-$pkgver.tar.gz + rm -f opengltk-$pkgver.tar.gz + patch -p0 < "$srcdir"/opengltk.patch + tar -czf opengltk-$pkgver.tar.gz opengltk-$pkgver +} + +package() { + cd "$srcdir/${pkgname}_source_$pkgver" + + # let python know about the new modules + pydir=`python2 -c "from distutils.sysconfig import get_python_lib; \ + print get_python_lib()"` + mkdir -p "$pkgdir/$pydir" + ./startInstallation --quiet --instDir="$pkgdir/$pydir" + + # link to bin directory + install -Dm755 "$pkgdir/$pydir/runAdt" "$pkgdir/usr/bin/adt" + install -Dm755 "$pkgdir/$pydir/runPmv" "$pkgdir/usr/bin/pmv" + install -Dm755 "$pkgdir/$pydir/runCADD" "$pkgdir/usr/bin/CADD" + install -Dm755 "$pkgdir/$pydir/runVision" "$pkgdir/usr/bin/vision" + + echo "MGLToolsPckgs" > "$pkgdir/$pydir/mgltools.pth" + + # fix some python 2.7 issues in the package + sed -i "/self.__debug__ = 0/d" \ + "$pkgdir/$pydir/MGLToolsPckgs/ViewerFramework/VF.py" + + # remove VCS entries + rm -rf `find "$pkgdir" -type d -name "CVS"` + + # some other fixes.. + cd "$pkgdir/$pydir/MGLToolsPckgs" + rm -f "mglutil/TestUtil/publishPack.csh" + + # change interpreter from python/2.5 to python2 + find . -name "*.py" | xargs sed -i "1s/python$/python2/;1s/python2.5$/python2/" + + # install licenses + for LICENSE in `find . -name LICENSE`; do + install -Dm755 "./$LICENSE" "$pkgdir/usr/share/licenses/mgltools/$LICENSE" + rm "$LICENSE" + done + mv *.egg-info "$pkgdir/usr/share/licenses/mgltools/" + + msg "LICENSE WARNING:" + msg "This software is free only for non-commercial usage" + msg "see /usr/share/licenses/mgltools/ for more information" +} + diff --git a/opengltk.patch b/opengltk.patch new file mode 100644 index 000000000000..d2490ae3546e --- /dev/null +++ b/opengltk.patch @@ -0,0 +1,262 @@ +diff -rupNb opengltk-1.5.6-orig/Togl2.0/togl.c opengltk-1.5.6/Togl2.0/togl.c +--- opengltk-1.5.6-orig/Togl2.0/togl.c 2009-05-14 21:43:34.000000000 +0100 ++++ opengltk-1.5.6/Togl2.0/togl.c 2014-02-01 20:50:21.172391074 +0000 +@@ -1,3 +1,5 @@ ++#define HAVE_UNISTD_H ++#define STDC_HEADERS + /* $Id: togl.c,v 1.2 2009/05/14 20:43:34 vareille Exp $ */ + + /* vi:set sw=4: */ +diff -rupNb opengltk-1.5.6-orig/include/tcltk84/tk/generic/tkFont.h opengltk-1.5.6/include/tcltk84/tk/generic/tkFont.h +--- opengltk-1.5.6-orig/include/tcltk84/tk/generic/tkFont.h 1970-01-01 01:00:00.000000000 +0100 ++++ opengltk-1.5.6/include/tcltk84/tk/generic/tkFont.h 2014-02-01 20:57:52.138795907 +0000 +@@ -0,0 +1,226 @@ ++/* ++ * tkFont.h -- ++ * ++ * Declarations for interfaces between the generic and platform- ++ * specific parts of the font package. This information is not ++ * visible outside of the font package. ++ * ++ * Copyright (c) 1996-1997 Sun Microsystems, Inc. ++ * ++ * See the file "license.terms" for information on usage and redistribution ++ * of this file, and for a DISCLAIMER OF ALL WARRANTIES. ++ * ++ * RCS: @(#) $Id: tkFont.h,v 1.1 2009/06/08 23:29:04 vareille Exp $ ++ */ ++ ++#ifndef _TKFONT ++#define _TKFONT ++ ++#ifdef BUILD_tk ++# undef TCL_STORAGE_CLASS ++# define TCL_STORAGE_CLASS DLLEXPORT ++#endif ++ ++/* ++ * The following structure keeps track of the attributes of a font. It can ++ * be used to keep track of either the desired attributes or the actual ++ * attributes gotten when the font was instantiated. ++ */ ++ ++typedef struct TkFontAttributes { ++ Tk_Uid family; /* Font family, or NULL to represent ++ * plaform-specific default system font. */ ++ int size; /* Pointsize of font, 0 for default size, or ++ * negative number meaning pixel size. */ ++ int weight; /* Weight flag; see below for def'n. */ ++ int slant; /* Slant flag; see below for def'n. */ ++ int underline; /* Non-zero for underline font. */ ++ int overstrike; /* Non-zero for overstrike font. */ ++} TkFontAttributes; ++ ++/* ++ * Possible values for the "weight" field in a TkFontAttributes structure. ++ * Weight is a subjective term and depends on what the company that created ++ * the font considers bold. ++ */ ++ ++#define TK_FW_NORMAL 0 ++#define TK_FW_BOLD 1 ++ ++#define TK_FW_UNKNOWN -1 /* Unknown weight. This value is used for ++ * error checking and is never actually stored ++ * in the weight field. */ ++ ++/* ++ * Possible values for the "slant" field in a TkFontAttributes structure. ++ */ ++ ++#define TK_FS_ROMAN 0 ++#define TK_FS_ITALIC 1 ++#define TK_FS_OBLIQUE 2 /* This value is only used when parsing X ++ * font names to determine the closest ++ * match. It is only stored in the ++ * XLFDAttributes structure, never in the ++ * slant field of the TkFontAttributes. */ ++ ++#define TK_FS_UNKNOWN -1 /* Unknown slant. This value is used for ++ * error checking and is never actually stored ++ * in the slant field. */ ++ ++/* ++ * The following structure keeps track of the metrics for an instantiated ++ * font. The metrics are the physical properties of the font itself. ++ */ ++ ++typedef struct TkFontMetrics { ++ int ascent; /* From baseline to top of font. */ ++ int descent; /* From baseline to bottom of font. */ ++ int maxWidth; /* Width of widest character in font. */ ++ int fixed; /* Non-zero if this is a fixed-width font, ++ * 0 otherwise. */ ++} TkFontMetrics; ++ ++/* ++ * The following structure is used to keep track of the generic information ++ * about a font. Each platform-specific font is represented by a structure ++ * with the following structure at its beginning, plus any platform- ++ * specific stuff after that. ++ */ ++ ++typedef struct TkFont { ++ /* ++ * Fields used and maintained exclusively by generic code. ++ */ ++ ++ int resourceRefCount; /* Number of active uses of this font (each ++ * active use corresponds to a call to ++ * Tk_AllocFontFromTable or Tk_GetFont). ++ * If this count is 0, then this TkFont ++ * structure is no longer valid and it isn't ++ * present in a hash table: it is being ++ * kept around only because there are objects ++ * referring to it. The structure is freed ++ * when resourceRefCount and objRefCount ++ * are both 0. */ ++ int objRefCount; /* The number of Tcl objects that reference ++ * this structure. */ ++ Tcl_HashEntry *cacheHashPtr;/* Entry in font cache for this structure, ++ * used when deleting it. */ ++ Tcl_HashEntry *namedHashPtr;/* Pointer to hash table entry that ++ * corresponds to the named font that the ++ * tkfont was based on, or NULL if the tkfont ++ * was not based on a named font. */ ++ Screen *screen; /* The screen where this font is valid. */ ++ int tabWidth; /* Width of tabs in this font (pixels). */ ++ int underlinePos; /* Offset from baseline to origin of ++ * underline bar (used for drawing underlines ++ * on a non-underlined font). */ ++ int underlineHeight; /* Height of underline bar (used for drawing ++ * underlines on a non-underlined font). */ ++ ++ /* ++ * Fields used in the generic code that are filled in by ++ * platform-specific code. ++ */ ++ ++ Font fid; /* For backwards compatibility with XGCValues ++ * structures. Remove when TkGCValues is ++ * implemented. */ ++ TkFontAttributes fa; /* Actual font attributes obtained when the ++ * the font was created, as opposed to the ++ * desired attributes passed in to ++ * TkpGetFontFromAttributes(). The desired ++ * metrics can be determined from the string ++ * that was used to create this font. */ ++ TkFontMetrics fm; /* Font metrics determined when font was ++ * created. */ ++ struct TkFont *nextPtr; /* Points to the next TkFont structure with ++ * the same name. All fonts with the ++ * same name (but different displays) are ++ * chained together off a single entry in ++ * a hash table. */ ++} TkFont; ++ ++/* ++ * The following structure is used to return attributes when parsing an ++ * XLFD. The extra information is of interest to the Unix-specific code ++ * when attempting to find the closest matching font. ++ */ ++ ++typedef struct TkXLFDAttributes { ++ Tk_Uid foundry; /* The foundry of the font. */ ++ int slant; /* The tristate value for the slant, which ++ * is significant under X. */ ++ int setwidth; /* The proportionate width, see below for ++ * definition. */ ++ Tk_Uid charset; /* The actual charset string. */ ++} TkXLFDAttributes; ++ ++/* ++ * Possible values for the "setwidth" field in a TkXLFDAttributes structure. ++ * The setwidth is whether characters are considered wider or narrower than ++ * normal. ++ */ ++ ++#define TK_SW_NORMAL 0 ++#define TK_SW_CONDENSE 1 ++#define TK_SW_EXPAND 2 ++#define TK_SW_UNKNOWN 3 /* Unknown setwidth. This value may be ++ * stored in the setwidth field. */ ++ ++/* ++ * The following defines specify the meaning of the fields in a fully ++ * qualified XLFD. ++ */ ++ ++#define XLFD_FOUNDRY 0 ++#define XLFD_FAMILY 1 ++#define XLFD_WEIGHT 2 ++#define XLFD_SLANT 3 ++#define XLFD_SETWIDTH 4 ++#define XLFD_ADD_STYLE 5 ++#define XLFD_PIXEL_SIZE 6 ++#define XLFD_POINT_SIZE 7 ++#define XLFD_RESOLUTION_X 8 ++#define XLFD_RESOLUTION_Y 9 ++#define XLFD_SPACING 10 ++#define XLFD_AVERAGE_WIDTH 11 ++#define XLFD_CHARSET 12 ++#define XLFD_NUMFIELDS 13 /* Number of fields in XLFD. */ ++ ++/* ++ * Low-level API exported by generic code to platform-specific code. ++ */ ++ ++#define TkInitFontAttributes(fa) memset((fa), 0, sizeof(TkFontAttributes)); ++#define TkInitXLFDAttributes(xa) memset((xa), 0, sizeof(TkXLFDAttributes)); ++ ++EXTERN int TkFontParseXLFD _ANSI_ARGS_((CONST char *string, ++ TkFontAttributes *faPtr, TkXLFDAttributes *xaPtr)); ++EXTERN char ** TkFontGetAliasList _ANSI_ARGS_((CONST char *faceName)); ++EXTERN char *** TkFontGetFallbacks _ANSI_ARGS_((void)); ++EXTERN int TkFontGetPixels _ANSI_ARGS_((Tk_Window tkwin, ++ int size)); ++EXTERN int TkFontGetPoints _ANSI_ARGS_((Tk_Window tkwin, ++ int size)); ++EXTERN char ** TkFontGetGlobalClass _ANSI_ARGS_((void)); ++EXTERN char ** TkFontGetSymbolClass _ANSI_ARGS_((void)); ++ ++/* ++ * Low-level API exported by platform-specific code to generic code. ++ */ ++ ++EXTERN void TkpDeleteFont _ANSI_ARGS_((TkFont *tkFontPtr)); ++EXTERN void TkpFontPkgInit _ANSI_ARGS_((TkMainInfo *mainPtr)); ++EXTERN TkFont * TkpGetFontFromAttributes _ANSI_ARGS_(( ++ TkFont *tkFontPtr, Tk_Window tkwin, ++ CONST TkFontAttributes *faPtr)); ++EXTERN void TkpGetFontFamilies _ANSI_ARGS_((Tcl_Interp *interp, ++ Tk_Window tkwin)); ++EXTERN TkFont * TkpGetNativeFont _ANSI_ARGS_((Tk_Window tkwin, ++ CONST char *name)); ++ ++# undef TCL_STORAGE_CLASS ++# define TCL_STORAGE_CLASS DLLIMPORT ++ ++#endif /* _TKFONT */ +diff -rupNb opengltk-1.5.6-orig/setup.py opengltk-1.5.6/setup.py +--- opengltk-1.5.6-orig/setup.py 2012-11-08 22:55:20.000000000 +0000 ++++ opengltk-1.5.6/setup.py 2014-02-01 20:59:59.720304555 +0000 +@@ -142,7 +142,7 @@ elif os.name == 'nt': #for Windows + ################################################################### + + if tcltk_ver == '8.4': +- tcl_libs = {'posix':[ "tclstub8.4", "tkstub8.4"], ++ tcl_libs = {'posix':[], + 'nt':[ "tclstub84", "tkstub84"]}.get(os.name,[]) + else: + tcl_libs = {'posix':[ "tclstub8.5", "tkstub8.5"], +@@ -295,8 +295,8 @@ if os.name == 'nt': + Togl ='Togl' + toglversion = '1.7' + else: +- Togl = "Togl2.1" +- toglversion = '2.1' ++ Togl = "Togl2.0" ++ toglversion = '2.0' + #elif sys.platform == 'darwin': + # Togl ='Togl2.0' + #else: |