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.

55 lines
1.5 KiB

micropython-lib: workaround the `install` build rule So, I chose to workaround it in the Makefile. A proper fix is a bit more work that I would like to do now, and I have no suggestion/idea for a good fix right now. The problem is with the `CMD` part that's used in the install rule, together with the fact that PREFIX is the same as the source location. ``` CMD="find . -maxdepth 1 -mindepth 1 \( -name '*.py' -not -name 'test_*' -not -name 'setup.py' \) -or \( -type d -not -name 'dist' -not -name '*.egg-info' -not -name '__pycache__' \)| xargs --no-run-if-empty cp -r -t $(PREFIX)" ``` The gist of it, is that it seems that this will filter and copy to `PREFIX` all python sources and folders that are not names `dist`, `__pycache__`, or `*.egg-info`. And it searches all folders at (exactly) depth 1. The solution I chose is to put a `dist` folder under `_install_tmp`, which is kind of a trick to go to depth 2 and avoid both conditions in the `find` call. This avoids errors: ``` cp: './weakref.py' and '/home/sandu/work/lede/build_dir/target-mips_24kc_musl-1.1.16/micropython-lib-1.8.6-f81e979c56dddb771ad36ec381b7f2c6cd12111f-f81e979c56dddb771ad36ec381b7f2c6cd12111f/_install_tmp/weakref.py' are the same file cp: './xmltok.py' and '/home/sandu/work/lede/build_dir/target-mips_24kc_musl-1.1.16/micropython-lib-1.8.6-f81e979c56dddb771ad36ec381b7f2c6cd12111f-f81e979c56dddb771ad36ec381b7f2c6cd12111f/_install_tmp/xmltok.py' are the same file cp: './zipfile.py' and '/home/sandu/work/lede/build_dir/target-mips_24kc_musl-1.1.16/micropython-lib-1.8.6-f81e979c56dddb771ad36ec381b7f2c6cd12111f-f81e979c56dddb771ad36ec381b7f2c6cd12111f/_install_tmp/zipfile.py' are the same file ``` Initially I tried to add exit 0, but that would just hide other (potentially worse) issues. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
8 years ago
micropython-lib: workaround the `install` build rule So, I chose to workaround it in the Makefile. A proper fix is a bit more work that I would like to do now, and I have no suggestion/idea for a good fix right now. The problem is with the `CMD` part that's used in the install rule, together with the fact that PREFIX is the same as the source location. ``` CMD="find . -maxdepth 1 -mindepth 1 \( -name '*.py' -not -name 'test_*' -not -name 'setup.py' \) -or \( -type d -not -name 'dist' -not -name '*.egg-info' -not -name '__pycache__' \)| xargs --no-run-if-empty cp -r -t $(PREFIX)" ``` The gist of it, is that it seems that this will filter and copy to `PREFIX` all python sources and folders that are not names `dist`, `__pycache__`, or `*.egg-info`. And it searches all folders at (exactly) depth 1. The solution I chose is to put a `dist` folder under `_install_tmp`, which is kind of a trick to go to depth 2 and avoid both conditions in the `find` call. This avoids errors: ``` cp: './weakref.py' and '/home/sandu/work/lede/build_dir/target-mips_24kc_musl-1.1.16/micropython-lib-1.8.6-f81e979c56dddb771ad36ec381b7f2c6cd12111f-f81e979c56dddb771ad36ec381b7f2c6cd12111f/_install_tmp/weakref.py' are the same file cp: './xmltok.py' and '/home/sandu/work/lede/build_dir/target-mips_24kc_musl-1.1.16/micropython-lib-1.8.6-f81e979c56dddb771ad36ec381b7f2c6cd12111f-f81e979c56dddb771ad36ec381b7f2c6cd12111f/_install_tmp/xmltok.py' are the same file cp: './zipfile.py' and '/home/sandu/work/lede/build_dir/target-mips_24kc_musl-1.1.16/micropython-lib-1.8.6-f81e979c56dddb771ad36ec381b7f2c6cd12111f-f81e979c56dddb771ad36ec381b7f2c6cd12111f/_install_tmp/zipfile.py' are the same file ``` Initially I tried to add exit 0, but that would just hide other (potentially worse) issues. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
8 years ago
  1. #
  2. # Copyright (C) 2008-2015 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=micropython-lib
  9. PKG_VERSION=1.9-$(PKG_SOURCE_VERSION)
  10. PKG_RELEASE:=1
  11. PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
  12. PKG_LICENSE:=MIT, PSFL
  13. PKG_LICENSE_FILES:=LICENSE
  14. PKG_SOURCE_PROTO:=git
  15. PKG_SOURCE_URL:=https://github.com/micropython/micropython-lib.git
  16. PKG_SOURCE_VERSION:=f5fe55aaef1a39d3d56f07040c0ff9f7e841fdf7
  17. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
  18. PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.xz
  19. PKG_MIRROR_HASH:=76565b5d44d47ccf61562f98dcf166d8103760eed7f3d84f5f7f31610140d780
  20. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
  21. PKG_BUILD_PARALLEL:=1
  22. include $(INCLUDE_DIR)/package.mk
  23. define Package/micropython-lib
  24. SUBMENU:=Python
  25. SECTION:=lang
  26. CATEGORY:=Languages
  27. TITLE:=micropython-lib
  28. URL:=https://github.com/micropython/micropython-lib
  29. DEPENDS:=+micropython
  30. endef
  31. define Package/micropython-lib/description
  32. This package contains micropython-lib, a project to develop a non-monolothic
  33. standard library for Micro Python. Note that this is a work in progress and
  34. several libraries may be missing, incomplete or buggy.
  35. endef
  36. MAKE_FLAGS:=\
  37. PREFIX=$(PKG_BUILD_DIR)/_install_tmp/dist \
  38. install
  39. define Package/micropython-lib/install
  40. $(INSTALL_DIR) $(1)/usr/lib/micropython
  41. $(CP) $(PKG_BUILD_DIR)/_install_tmp/dist/* $(1)/usr/lib/micropython
  42. endef
  43. $(eval $(call BuildPackage,micropython-lib))