Revert "Reapply "Update python binding to place some files in site-packages/Hamlib""

This reverts commit 704238da2f.
pull/1662/head
Michael Black W9MDB 2025-01-19 16:51:24 -06:00
rodzic 704238da2f
commit 4281a5ef7d
2 zmienionych plików z 41 dodań i 36 usunięć

Wyświetl plik

@ -83,47 +83,55 @@ uninstall-perl: ## Hamlib-pl.mk
endif
# Perl
if ENABLE_PYTHON
##########################################
# Python binding
##############################################################################
# 1. We declare a Python extension using 'pyexec_LTLIBRARIES'.
# - Tells Automake: “Install this .so into $(pyexecdir).”
# - We override 'pyexec_ltlibdir' to place it in a subdirectory: Hamlib
##############################################################################
pyexec_LTLIBRARIES = _Hamlib.la
pyexec_ltlibdir = $(pyexecdir)/Hamlib
pyexec_ltlib = _Hamlib.la
MOSTLYCLEANFILES += hamlibpy_wrap.c Hamlib.py *.pyc
BUILT_SOURCES += hamlibpy_wrap.c Hamlib.py
# Set by AM_CONDITIONAL in configure.ac
if PYVER_3
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_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)
##############################################################################
# 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
all-py: $(pyexec_ltlib)
# Place them in the exact same directory as the extension: $(pyexecdir)/Hamlib
myhamlibdir = $(pyexecdir)/Hamlib
check-py: all-py
$(AM_V_at)PYTHONPATH=$(builddir):$(builddir)/.libs \
$(PYTHON) $(srcdir)/$(pytest) \
|| echo "Python test failed" 1>&2
##############################################################################
# 3. Distribute these files (so they're included in 'make dist' tarballs).
##############################################################################
EXTRA_DIST += \
__init__.py \
Hamlib.py
Hamlib.py: hamlibpy_wrap.c
hamlibpy_wrap.c: hamlib.swg $(SWGDEP)
$(AM_V_GEN)$(SWIG) -python $(AM_CPPFLAGS) $(PYTHON_CPPFLAGS) -I$(top_srcdir)/bindings \
-o $@ $$(test -f hamlib.swg || echo '$(srcdir)/')hamlib.swg
all-py:
install-py:
@true
##############################################################################
# 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.
##############################################################################
clean-py:
distclean-py:
uninstall-py:
endif
# Python
endif # ENABLE_PYTHON
if ENABLE_TCL
##########################################

Wyświetl plik

@ -1,9 +1,8 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import site
# Change this path to match your "make install" path
sys.path.append('/usr/local/lib/python3.12/site-packages')
sys.path.append('/usr/local/lib/python3.10/site-packages')
## Uncomment to run this script from an in-tree build (or adjust to the
## build directory) without installing the bindings.
@ -18,9 +17,7 @@ def StartUp():
print("%s: Python %s; %s\n" \
% (sys.argv[0], sys.version.split()[0], Hamlib.cvar.hamlib_version))
print(site.getsitepackages())
Hamlib.rig_set_debug(0)
Hamlib.rig_set_debug(Hamlib.RIG_DEBUG_NONE)
# Init RIG_MODEL_DUMMY
my_rig = Hamlib.Rig(Hamlib.RIG_MODEL_DUMMY)