kopia lustrzana https://github.com/Hamlib/Hamlib
Update python binding to place some files in site-packages/Hamlib
https://github.com/Hamlib/Hamlib/issues/1645pull/1662/head
rodzic
35f86232fa
commit
8aa487afb8
|
@ -83,55 +83,47 @@ uninstall-perl: ## Hamlib-pl.mk
|
||||||
endif
|
endif
|
||||||
# Perl
|
# Perl
|
||||||
|
|
||||||
|
|
||||||
if ENABLE_PYTHON
|
if ENABLE_PYTHON
|
||||||
##########################################
|
|
||||||
# Python binding
|
|
||||||
|
|
||||||
pyexec_ltlib = _Hamlib.la
|
##############################################################################
|
||||||
|
# 1. We declare a Python extension using 'pyexec_LTLIBRARIES'.
|
||||||
MOSTLYCLEANFILES += hamlibpy_wrap.c Hamlib.py *.pyc
|
# - Tells Automake: “Install this .so into $(pyexecdir).”
|
||||||
BUILT_SOURCES += hamlibpy_wrap.c Hamlib.py
|
# - We override 'pyexec_ltlibdir' to place it in a subdirectory: Hamlib
|
||||||
|
##############################################################################
|
||||||
# Set by AM_CONDITIONAL in configure.ac
|
pyexec_LTLIBRARIES = _Hamlib.la
|
||||||
if PYVER_3
|
pyexec_ltlibdir = $(pyexecdir)/Hamlib
|
||||||
pytest = py3test.py
|
|
||||||
else !PYVER_3
|
|
||||||
pytest = pytest.py
|
|
||||||
endif
|
|
||||||
# PYVER_3
|
|
||||||
|
|
||||||
example_DATA += $(pytest)
|
|
||||||
|
|
||||||
nodist_pyexec_PYTHON = Hamlib.py
|
|
||||||
nodist__Hamlib_la_SOURCES = hamlibpy_wrap.c
|
|
||||||
|
|
||||||
|
_Hamlib_la_SOURCES = hamlibpy_wrap.c
|
||||||
_Hamlib_la_LDFLAGS = -no-undefined -module -avoid-version
|
_Hamlib_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||||
_Hamlib_la_LIBADD = $(top_builddir)/src/libhamlib.la $(PYTHON_LIBS)
|
_Hamlib_la_LIBADD = $(top_builddir)/src/libhamlib.la $(PYTHON_LIBS)
|
||||||
_Hamlib_ladir = $(pyexecdir)
|
|
||||||
_Hamlib_la_LTLIBRARIES = $(pyexec_ltlib)
|
|
||||||
|
|
||||||
all-py: $(pyexec_ltlib)
|
##############################################################################
|
||||||
|
# 2. We declare a set of Python (.py) files using a custom primary, e.g.
|
||||||
|
# 'myhamlib_PYTHON'. Automake installs them into 'myhamlibdir' by default.
|
||||||
|
##############################################################################
|
||||||
|
myhamlib_PYTHON = \
|
||||||
|
__init__.py \
|
||||||
|
Hamlib.py
|
||||||
|
|
||||||
check-py: all-py
|
# Place them in the exact same directory as the extension: $(pyexecdir)/Hamlib
|
||||||
$(AM_V_at)PYTHONPATH=$(builddir):$(builddir)/.libs \
|
myhamlibdir = $(pyexecdir)/Hamlib
|
||||||
$(PYTHON) $(srcdir)/$(pytest) \
|
|
||||||
|| echo "Python test failed" 1>&2
|
|
||||||
|
|
||||||
Hamlib.py: hamlibpy_wrap.c
|
##############################################################################
|
||||||
|
# 3. Distribute these files (so they're included in 'make dist' tarballs).
|
||||||
hamlibpy_wrap.c: hamlib.swg $(SWGDEP)
|
##############################################################################
|
||||||
$(AM_V_GEN)$(SWIG) -python $(AM_CPPFLAGS) $(PYTHON_CPPFLAGS) -I$(top_srcdir)/bindings \
|
EXTRA_DIST += \
|
||||||
-o $@ $$(test -f hamlib.swg || echo '$(srcdir)/')hamlib.swg
|
__init__.py \
|
||||||
|
Hamlib.py
|
||||||
|
|
||||||
|
all-py:
|
||||||
install-py:
|
install-py:
|
||||||
clean-py:
|
@true
|
||||||
distclean-py:
|
##############################################################################
|
||||||
uninstall-py:
|
# 4. Remove any custom 'install-py:' or 'install-exec-local: install-py'
|
||||||
|
# You do NOT need them. Automake already knows how to install these files.
|
||||||
endif
|
##############################################################################
|
||||||
# Python
|
|
||||||
|
|
||||||
|
endif # ENABLE_PYTHON
|
||||||
|
|
||||||
if ENABLE_TCL
|
if ENABLE_TCL
|
||||||
##########################################
|
##########################################
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import sys
|
import sys
|
||||||
|
import site
|
||||||
# Change this path to match your "make install" path
|
# Change this path to match your "make install" path
|
||||||
sys.path.append('/usr/local/lib/python3.10/site-packages')
|
sys.path.append('/usr/local/lib/python3.12/site-packages')
|
||||||
|
|
||||||
## Uncomment to run this script from an in-tree build (or adjust to the
|
## Uncomment to run this script from an in-tree build (or adjust to the
|
||||||
## build directory) without installing the bindings.
|
## build directory) without installing the bindings.
|
||||||
|
@ -17,7 +18,9 @@ def StartUp():
|
||||||
print("%s: Python %s; %s\n" \
|
print("%s: Python %s; %s\n" \
|
||||||
% (sys.argv[0], sys.version.split()[0], Hamlib.cvar.hamlib_version))
|
% (sys.argv[0], sys.version.split()[0], Hamlib.cvar.hamlib_version))
|
||||||
|
|
||||||
Hamlib.rig_set_debug(Hamlib.RIG_DEBUG_NONE)
|
print(site.getsitepackages())
|
||||||
|
|
||||||
|
Hamlib.rig_set_debug(0)
|
||||||
|
|
||||||
# Init RIG_MODEL_DUMMY
|
# Init RIG_MODEL_DUMMY
|
||||||
my_rig = Hamlib.Rig(Hamlib.RIG_MODEL_DUMMY)
|
my_rig = Hamlib.Rig(Hamlib.RIG_MODEL_DUMMY)
|
||||||
|
|
Ładowanie…
Reference in New Issue