packages/lang/python/python3/files/python3-package-dev.mk
Jeffery To 3c36696a56 python-packages: Add usr/bin symlinks without "3" suffix
Previously, binaries installed by Python packages will have a
non-suffixed Python 2 version and a suffixed Python 3 version, e.g. pip
and pip3. With the removal of Python 2, the non-suffixed names are no
longer taken.

This adds symlinks for the non-suffixed names linking to the suffixed
scripts (or in the case of pip, easy_install, and python-config, to the
fully-versioned scripts).

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-05-22 03:57:55 +08:00

31 lines
1.2 KiB
Makefile

#
# Copyright (C) 2006-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
define Package/python3-dev
$(call Package/python3/Default)
TITLE:=Python $(PYTHON3_VERSION) development files
DEPENDS:=+python3 +python3-lib2to3
endef
define Py3Package/python3-dev/install
$(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/bin/python$(PYTHON3_VERSION)-config $(1)/usr/bin
$(LN) python$(PYTHON3_VERSION)-config $(1)/usr/bin/python3-config
$(LN) python$(PYTHON3_VERSION)-config $(1)/usr/bin/python-config
$(LN) python$(PYTHON3_VERSION)/config-$(PYTHON3_VERSION)/libpython$(PYTHON3_VERSION).a $(1)/usr/lib/
# This depends on being called before filespec is processed
$(SED) 's|$(TARGET_AR)|ar|g;s|$(TARGET_CROSS)readelf|readelf|g;s|$(TARGET_CC)|gcc|g;s|$(TARGET_CXX)|g++|g' \
$(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON3_VERSION)/config-$(PYTHON3_VERSION)/Makefile
endef
$(eval $(call Py3BasePackage,python3-dev, \
/usr/lib/python$(PYTHON3_VERSION)/config-$(PYTHON3_VERSION) \
/usr/include/python$(PYTHON3_VERSION) \
/usr/lib/pkgconfig \
, \
DO_NOT_ADD_TO_PACKAGE_DEPENDS \
))