Ticket #21436: sparky-build.diff

File sparky-build.diff, 6.8 KB (added by howarth@…, 15 years ago)

build against python26

  • Makefile

    old new  
    2525INSTALL         = \cp
    2626INSTALLDIR      = \cp -R
    2727
    28 SPARKY          = /usr/local/src/sparky
     28SPARKY          = @BUILDDIR@
    2929SPARKY_SRC      = $(SPARKY)/c++
    3030SPARKY_OBJ      = $(SPARKY)/c++
    31 SPARKY_INSTALL  = /usr/local/sparky
     31SPARKY_INSTALL  = @DESTDIR@@PREFIX@/lib/sparky
    3232SPARKY_SCRIPT   = sparky
    3333SCRIPT_SUFFIX   =
    3434
     
    3838                  bruk2ucsf$(EXE_SUFFIX) peaks2ucsf$(EXE_SUFFIX) \
    3939                  matrix2ucsf$(EXE_SUFFIX)
    4040
    41 PYTHON_VERSION  = 2.5
     41PYTHON_VERSION  = 2.6
    4242PYTHON_DIR      =
    4343
    4444PYMOD_SUFFIX    = .so
     
    5151Makefile.dep TAGS: force
    5252        cd $(SPARKY_SRC) && $(MAKE) -f Makefile -e $@
    5353
    54 install: install-nopython $(SPARKY_INSTALL) install-python
     54install: install-nopython $(SPARKY_INSTALL)
    5555        cd $(SPARKY_OBJ) && \
    5656        $(MAKE) -f $(SPARKY_SRC)/Makefile -e install-python
    5757        cd $(SPARKY)/python && $(MAKE) -f Makefile -e install
     58        cp $(SPARKY_SRC)/_tkinter.so $(SPARKY_INSTALL)/python/lib-tk
     59        cp $(SPARKY_SRC)/spy.so $(SPARKY_INSTALL)/python/sparky
    5860
    5961install-nopython: install-bin install-example install-lib \
    6062                  install-man install-misc
     
    7981        cd $(SPARKY) ; $(INSTALL) LICENSE README $(SPARKY_INSTALL)
    8082        cd $(SPARKY_INSTALL) ; chmod 644 LICENSE README
    8183
    82 install-python: $(SPARKY_INSTALL) $(SPARKY_INSTALL)/python$(PYTHON_VERSION)
    83 ifdef PYTHON_DIR
    84         $(INSTALLDIR) $(PYTHON_DIR)/* $(SPARKY_INSTALL)/python$(PYTHON_VERSION)
    85 else
    86         echo "Not packaging Python with Sparky."
    87 endif
    88 
    8984install-mac:
    9085        cd $(SPARKY)/mac && $(MAKE) -f Makefile -e install
    9186
    92 $(SPARKY_INSTALL) $(SPARKY_INSTALL)/bin $(SPARKY_INSTALL)/python$(PYTHON_VERSION):
     87$(SPARKY_INSTALL) $(SPARKY_INSTALL)/bin:
    9388        mkdir $@
    9489        chmod 755 $@
    9590
  • bin/sparky

    old new  
    2525# If Python is available start Sparky as a Python extension.
    2626# Otherwise the standalone version of Sparky is started.
    2727#
    28 set PYTHON = "$SPARKY_INSTALL/python2.5/bin/python2.5"
     28set PYTHON = "@PREFIX@/bin/python2.6"
    2929if (! -e "$PYTHON") then
    30   set PYTHON = python2.5
     30  set PYTHON = python2.6
    3131endif
    3232
    3333# -----------------------------------------------------------------------------
    3434# Where to find Tcl/Tk shared libraries and resources.
    3535#
    36 setenv TCLTK_LIB                "$SPARKY_INSTALL/lib"
     36setenv TCLTK_LIB                "@PREFIX@/lib"
    3737setenv LD_LIBRARY_PATH          "$TCLTK_LIB"
    3838setenv LD_LIBRARYN32_PATH       "$TCLTK_LIB"
    3939setenv DYLD_LIBRARY_PATH        "$TCLTK_LIB"
    40 setenv TK_LIBRARY               "$TCLTK_LIB/tk8.4"
    41 setenv TCL_LIBRARY              "$TCLTK_LIB/tcl8.4"
     40setenv TK_LIBRARY               "$TCLTK_LIB/tk8.5"
     41setenv TCL_LIBRARY              "$TCLTK_LIB/tcl8.5"
    4242
    4343# -----------------------------------------------------------------------------
    4444# Other programs Sparky can use.
  • c++/Makefile

    old new  
    1515INSTALL         = \cp
    1616REMOVE          = \rm -f
    1717
    18 SPARKY          = /usr/local/src/sparky
     18SPARKY          = @BUILDDIR@
    1919SPARKY_SRC      = $(SPARKY)/c++
    20 PYTHON_VERSION  = 2.5
    21 PY_VER_WIN32    = 25
    22 PYTHON_PREFIX   = /usr/local
     20SPARKY_INSTALL = @DESTDIR@@PREFIX@/lib/sparky
     21PYTHON_VERSION  = 2.6
     22PY_VER_WIN32    = 26
     23PYTHON_PREFIX   = @PREFIX@/Library/Frameworks/Python.framework/Versions/$(PYTHON_VERSION)
    2324PYTHON_LIB      = $(PYTHON_PREFIX)/lib/python$(PYTHON_VERSION)
    2425PYTHON_INC      = $(PYTHON_PREFIX)/include/python$(PYTHON_VERSION)
    25 TCLTK_VERSION   = 8.4
    26 TCLTK_VER_WIN32 = 84
    27 TK_PREFIX       = /usr/local
     26TCLTK_VERSION   = 8.5
     27TCLTK_VER_WIN32 = 85
     28TK_PREFIX       = @PREFIX@
    2829TK_LIBNAME      = tk$(TCLTK_VERSION)
    2930TCL_LIBNAME     = tcl$(TCLTK_VERSION)
    3031PLATFORM        = unix
    3132
    3233CXX             = g++
    33 CXXFLAGS        =
     34CXXFLAGS        = -O3 -ffast-math -fno-common
    3435CC              = gcc
    35 CFLAGS          =
     36CFLAGS          = -O3 -ffast-math -fno-common
    3637PYFLAGS         = -I$(PYTHON_INC) -I$(PYTHON_LIB)/config
    37 TKFLAGS         = -I$(TK_PREFIX)/include
    38 TKLIBS          = -L$(TK_PREFIX)/lib -l$(TK_LIBNAME) -l$(TCL_LIBNAME) -lX11
     38TKFLAGS                = -I$(TK_PREFIX)/include -I@PREFIX@/include
     39TKLIBS          = -L$(TK_PREFIX)/lib -l$(TK_LIBNAME) -l$(TCL_LIBNAME) -L@PREFIX@/lib -lX11
    3940EXTRALIBS       =
    4041SYSLIBS         = -lm
    4142LDLIBS          = $(TKLIBS) $(SYSLIBS) $(EXTRALIBS)
    4243LDFLAGS         =
    43 LDSHARED        = -shared
     44LDSHARED        = -bundle -flat_namespace -undefined suppress
    4445DEPEND          = -MM
    4546
    4647CXX_RULE_PREFIX =
  • lib/Makefile

    old new  
    66INSTALL         = \cp
    77INSTALLDIR      = \cp -r
    88
    9 SPARKY_INSTALL  = /usr/local/sparky
     9SPARKY_INSTALL  = @DESTDIR@@PREFIX@/lib/sparky
    1010
    11 TCLTK_VERSION   = 8.4
     11TCLTK_VERSION   = 8.5
    1212TK_VERSION      = tk$(TCLTK_VERSION)
    1313TCL_VERSION     = tcl$(TCLTK_VERSION)
    14 TK_PREFIX       = /usr/local
     14TK_PREFIX       = @PREFIX@
    1515TCL_TK_LIB      = $(TK_PREFIX)/lib
    1616TCL_TK_SHLIB    = $(TCL_TK_LIB)
    17 TCLTK_SHLIB_SUFFIX      = .so
     17TCLTK_SHLIB_SUFFIX      = .dylib
    1818TCL_SHLIB       = lib$(TCL_VERSION)$(TCLTK_SHLIB_SUFFIX)
    1919TK_SHLIB        = lib$(TK_VERSION)$(TCLTK_SHLIB_SUFFIX)
    2020
    21 install: $(SPARKY_INSTALL)/lib install-tcl-tk
     21install: $(SPARKY_INSTALL)/lib
    2222        $(INSTALL) Sparky print-prolog.ps $(SPARKY_INSTALL)/lib
    2323        cd $(SPARKY_INSTALL)/lib ; \
    2424        chmod 644 Sparky print-prolog.ps
    2525
    26 install-tcl-tk: $(SPARKY_INSTALL)/lib
    27         $(INSTALL) $(TCL_TK_SHLIB)/$(TCL_SHLIB) $(SPARKY_INSTALL)/lib
    28         $(INSTALL) $(TCL_TK_SHLIB)/$(TK_SHLIB) $(SPARKY_INSTALL)/lib
    29         chmod 755 $(SPARKY_INSTALL)/lib/$(TCL_SHLIB)
    30         chmod 755 $(SPARKY_INSTALL)/lib/$(TK_SHLIB)
    31         $(INSTALLDIR) $(TCL_TK_LIB)/$(TCL_VERSION) $(TCL_TK_LIB)/$(TK_VERSION) \
    32                 $(SPARKY_INSTALL)/lib
    33 
    3426$(SPARKY_INSTALL)/lib:
    3527        mkdir $@
    3628        chmod 755 $@
  • manual/Makefile

    old new  
    1111
    1212INSTALL         = \cp
    1313
    14 SPARKY_INSTALL  = /usr/local/sparky
     14SPARKY_INSTALL  = @DESTDIR@@PREFIX@/lib/sparky
    1515MANUAL_WWW      = /usr/local/html/cgl/sparky/manual
    1616
    1717MANUAL_SECTIONS = overview.html intro.html views.html peaks.html \
  • python/Makefile

    old new  
    44
    55INSTALL         = \cp
    66
    7 SPARKY_INSTALL  = /usr/local/sparky
    8 PYTHON_PREFIX   = /usr/local
    9 PYTHON_VERSION  = 2.5
     7SPARKY_INSTALL  = @DESTDIR@@PREFIX@/lib/sparky
     8PYTHON_VERSION  = 2.6
     9PYTHON_PREFIX   = @PREFIX@/Library/Frameworks/Python.framework/Versions/$(PYTHON_VERSION)
    1010PYTHON          = $(PYTHON_PREFIX)/bin/python$(PYTHON_VERSION)
    1111PYTHON_LIB      = $(PYTHON_PREFIX)/lib/python$(PYTHON_VERSION)
    1212
     
    3535        chmod 644 $(SPARKY_INSTALL)/python/README
    3636        cd $(SPARKY_INSTALL)/python/sparky ; chmod 644 $(PYTHON_CODE)
    3737        chmod 644 $(SPARKY_INSTALL)/python/lib-tk/*.py
    38         $(PYTHON) $(PYTHON_LIB)/compileall.py $(SPARKY_INSTALL)/python/sparky
    39         $(PYTHON) $(PYTHON_LIB)/compileall.py $(SPARKY_INSTALL)/python/lib-tk
     38        $(PYTHON) $(PYTHON_LIB)/compileall.py -d @PREFIX@/lib/sparky/python/sparky $(SPARKY_INSTALL)/python/sparky
     39        $(PYTHON) $(PYTHON_LIB)/compileall.py -d @PREFIX@/lib/sparky/python/lib-tk $(SPARKY_INSTALL)/python/lib-tk
    4040
    4141$(SPARKY_INSTALL)/python $(SPARKY_INSTALL)/python/sparky \
    4242  $(SPARKY_INSTALL)/python/lib-tk: