You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.4 KiB

  1. #
  2. # This is free software, licensed under the GNU General Public License v2.
  3. # See /LICENSE for more information.
  4. #
  5. include $(TOPDIR)/rules.mk
  6. PKG_NAME:=2to3
  7. PKG_VERSION:=1.0
  8. PKG_RELEASE:=1
  9. PKG_MAINTAINER:=Gerald Kerma <gandalf@gk2.net>,Jeffery To <jeffery.to@gmail.com>
  10. PKG_LICENSE:=PSF-2.0
  11. PKG_LICENSE_FILES:=copyright
  12. PKG_HOST_ONLY:=1
  13. HOST_BUILD_DEPENDS:=python3/host
  14. include $(INCLUDE_DIR)/host-build.mk
  15. include $(INCLUDE_DIR)/package.mk
  16. define Package/2to3
  17. SUBMENU:=Python
  18. SECTION:=lang
  19. CATEGORY:=Languages
  20. TITLE:=2to3 binary using python3
  21. URL:=https://salsa.debian.org/cpython-team/python3-defaults
  22. BUILDONLY:=1
  23. endef
  24. define Package/2to3/description
  25. 2to3 is a Python program that reads Python 2.x source code and applies a
  26. series of fixers to transform it into valid Python 3.x code. The standard
  27. library contains a rich set of fixers that will handle almost all code. 2to3
  28. supporting library lib2to3 is, however, a flexible and generic library, so it
  29. is possible to write your own fixers for 2to3. lib2to3 could also be adapted
  30. to custom applications in which Python code needs to be edited automatically.
  31. endef
  32. define Host/Install
  33. $(INSTALL_DIR) $(1)/bin
  34. $(INSTALL_BIN) ./files/2to3.py $(1)/bin/2to3
  35. $(SED) '1c#!$(STAGING_DIR_HOSTPKG)/bin/python3' $(1)/bin/2to3
  36. endef
  37. define Host/Clean
  38. rm -f $(STAGING_DIR_HOSTPKG)/bin/2to3
  39. endef
  40. $(eval $(call HostBuild))
  41. $(eval $(call BuildPackage,2to3))