Skip to content
Snippets Groups Projects
Commit 62f029e8 authored by Christoph Schmidt-Hieber's avatar Christoph Schmidt-Hieber
Browse files

Fixed installation location of _stf.so and *.py to comply with debian packaging rules

parent 539002e6
No related branches found
Tags 0.10.9linux
No related merge requests found
usr/lib/python2.*/dist-packages/stimfit.pth
usr/lib/python2.*/dist-packages/stimfit/*.so
usr/lib/python2.*/dist-packages/stimfit/*.py
usr/lib/stimfit/*.py
usr/lib/stimfit/*.so
usr/bin/stimfit
usr/lib/python2.*/dist-packages/stimfit.pth
usr/lib/python2.*/dist-packages/stimfit/*.so
usr/lib/python2.*/dist-packages/stimfit/*.py
usr/lib/stimfit/*.py
usr/lib/stimfit/*.so
usr/bin/stimfit
......@@ -14,14 +14,14 @@
int stf::Extension::n_extensions = 0;
#ifdef __WXMAC__
#if defined(__WXMAC__) || defined (__WXGTK__)
#include <wx/stdpaths.h>
wxString GetExecutablePath()
{
return wxStandardPaths::Get( ).GetExecutablePath();
}
#endif // __WXMAC__
#endif // __WXMAC__ || __WXGTK__
#ifdef _WINDOWS
#include <winreg.h>
......@@ -90,8 +90,22 @@ bool wxStfApp::Init_wxPython()
cwd << wxT("import numpy\n");
cwd << wxT("print numpy.version.version\n");
#endif // _STFDEBUG
#endif // __WXMAC__
#ifdef __WXGTK__
// Add the cwd to the present path:
wxString app_path = wxFileName( GetExecutablePath() ).GetPath();
wxString cwd;
cwd << wxT("import os\n");
cwd << wxT("cwd=\"") << app_path << wxT("/../lib/stimfit\"\n");
cwd << wxT("import sys\n");
cwd << wxT("sys.path.append(cwd)\n");
#ifdef _STFDEBUG
cwd << wxT("print sys.path\n");
cwd << wxT("import numpy\n");
cwd << wxT("print numpy.version.version\n");
#endif // _STFDEBUG
#endif // __WXGTK__
#ifdef _WINDOWS
// Add the cwd to the present path:
......@@ -103,15 +117,13 @@ bool wxStfApp::Init_wxPython()
<< wxT("\"\nimport sys\nsys.path.insert(0,cwd)\n");
#endif
#if defined(_WINDOWS) || defined(__WXMAC__)
int cwd_result = PyRun_SimpleString(cwd.utf8_str());
int cwd_result = PyRun_SimpleString(cwd.utf8_str());
if (cwd_result!=0) {
PyErr_Print();
ErrorMsg( wxT("Couldn't modify Python path") );
Py_Finalize();
return false;
}
#endif
// Load the wxPython core API. Imports the wx._core_ module and sets a
// local pointer to a function table located there. The pointer is used
......
......@@ -20,38 +20,28 @@ libstf_la_LIBADD = $(WX_LIBS)
EXTRA_DIST = stfswig.i ivtools.py mintools.py natools.py minidemo.py charlie.py stf.py mintools.py hdf5tools.py spells.py embedded_init.py embedded_stf.py embedded_mpl.py embedded_ipython.py unittest_stfio.py heka.py extensions.py Doxyfile
if BUILD_DEBIAN
LNTARGET="/usr/lib/stimfit/${STF_PYTHON_LIBNAME}"
else
LNTARGET="${prefix}/lib/stimfit/${STF_PYTHON_LIBNAME}"
endif
install-exec-hook:
$(MKDIR_P) ${PYTHON_SITE_PKG}/stimfit
cd ${PYTHON_SITE_PKG}/stimfit && ln -sf ${LNTARGET} _stf.so
cd ${prefix}/lib/stimfit && ln -sf ${STF_PYTHON_LIBNAME} _stf.so
rm -f ${prefix}/lib/stimfit/*.la
rm -f ${prefix}/lib/stimfit/*.a
cp -p $(srcdir)/ivtools.py ${PYTHON_SITE_PKG}/stimfit
cp -p $(srcdir)/mintools.py ${PYTHON_SITE_PKG}/stimfit
cp -p $(srcdir)/natools.py ${PYTHON_SITE_PKG}/stimfit
cp -p $(srcdir)/minidemo.py ${PYTHON_SITE_PKG}/stimfit
cp -p $(srcdir)/charlie.py ${PYTHON_SITE_PKG}/stimfit
cp -p $(srcdir)/hdf5tools.py ${PYTHON_SITE_PKG}/stimfit
cp -p $(srcdir)/stf.py ${PYTHON_SITE_PKG}/stimfit
cp -p $(srcdir)/stfio_plot.py ${PYTHON_SITE_PKG}/stimfit
cp -p $(srcdir)/spells.py ${PYTHON_SITE_PKG}/stimfit
cp -p $(srcdir)/embedded_init.py ${PYTHON_SITE_PKG}/stimfit
cp -p $(srcdir)/embedded_stf.py ${PYTHON_SITE_PKG}/stimfit
cp -p $(srcdir)/embedded_mpl.py ${PYTHON_SITE_PKG}/stimfit
cp -p $(srcdir)/embedded_ipython.py ${PYTHON_SITE_PKG}/stimfit
cp -p $(srcdir)/heka.py ${PYTHON_SITE_PKG}/stimfit
cp -p $(srcdir)/extensions.py ${PYTHON_SITE_PKG}/stimfit
chmod -x ${PYTHON_SITE_PKG}/stimfit/*.py
echo stimfit > ${PYTHON_SITE_PKG}/stimfit.pth
cp -p $(srcdir)/ivtools.py ${prefix}/lib/stimfit
cp -p $(srcdir)/mintools.py ${prefix}/lib/stimfit
cp -p $(srcdir)/natools.py ${prefix}/lib/stimfit
cp -p $(srcdir)/minidemo.py ${prefix}/lib/stimfit
cp -p $(srcdir)/charlie.py ${prefix}/lib/stimfit
cp -p $(srcdir)/hdf5tools.py ${prefix}/lib/stimfit
cp -p $(srcdir)/stf.py ${prefix}/lib/stimfit
cp -p $(srcdir)/stfio_plot.py ${prefix}/lib/stimfit
cp -p $(srcdir)/spells.py ${prefix}/lib/stimfit
cp -p $(srcdir)/embedded_init.py ${prefix}/lib/stimfit
cp -p $(srcdir)/embedded_stf.py ${prefix}/lib/stimfit
cp -p $(srcdir)/embedded_mpl.py ${prefix}/lib/stimfit
cp -p $(srcdir)/embedded_ipython.py ${prefix}/lib/stimfit
cp -p $(srcdir)/heka.py ${prefix}/lib/stimfit
cp -p $(srcdir)/extensions.py ${prefix}/lib/stimfit
chmod -x ${prefix}/lib/stimfit/*.py
uninstall-hook:
rm -rf ${PYTHON_SITE_PKG}/stimfit
rm -f ${PYTHON_SITE_PKG}/stimfit.pth
rm -rf ${prefix}/lib/stimfit
endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment