Skip to content

Commit 7cd9a81

Browse files
committed
Add opkg makefile
1 parent be6e9a2 commit 7cd9a81

File tree

5 files changed

+85
-0
lines changed

5 files changed

+85
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
DrCOM 非官方客户端,修改自 [drcom-generic](https://github.com/drcoms/drcom-generic) 以使其能够在 OpenWrt 软件源中的 [micropython](https://github.com/micropython/micropython) 软件包中运行。
44

5+
另有 opkg 进行打包于 [openwrt](openwrt)
6+
57
**WIP & Testing needed**
68

79
## 关于 micropython

openwrt/Makefile

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
include $(TOPDIR)/rules.mk
2+
3+
PKG_NAME:=micropython-drcom
4+
PKG_RELEASE:=1
5+
PKG_LICENSE:=AGPL-3.0
6+
PKG_LICENSE_FILE:=LICENSE.md
7+
PKG_MAINTAINER:=Hagb <hagb_green@qq.com>
8+
9+
include $(INCLUDE_DIR)/package.mk
10+
11+
define Package/micropython-drcom
12+
SECTION:=net
13+
CATEGORY:=Network
14+
TITLE:=DrCOM unofficial client for micropython
15+
URL:=https://github.com/Hagb/micropython-drcom
16+
DEPENDS:=+micropython +micropython-lib
17+
PKGARCH:=all
18+
endef
19+
20+
define Package/micropython-drcom/description
21+
DrCOM unofficial client modified from drcom-generic project to run in
22+
micropython. For smaller size, you can use micropython-drcom-with-lib package
23+
but not micropython-drcom package with tailored micropython-lib, which can be
24+
installed without large micropython-lib package.
25+
endef
26+
27+
define Package/micropython-drcom-with-lib
28+
SECTION:=net
29+
CATEGORY:=Network
30+
TITLE:=DrCOM unofficial client for micropython, with tailored micropython-lib
31+
URL:=https://github.com/Hagb/micropython-drcom
32+
DEPENDS:=+micropython
33+
PKGARCH:=all
34+
endef
35+
36+
define Package/micropython-drcom-with-lib/description
37+
DrCOM unofficial client modified from drcom-generic project to run in
38+
micropython. This package with tailored micropython-lib, can be installed
39+
without large micropython-lib package.
40+
endef
41+
42+
define Build/Compile
43+
true
44+
endef
45+
46+
define Build/Configure
47+
true
48+
endef
49+
50+
define Build/Install
51+
true
52+
endef
53+
54+
define Package/micropython-drcom/install
55+
$(INSTALL_DIR) $(1)/usr/bin/ $(1)/etc/ $(1)/usr/lib/micropython-drcom/
56+
$(INSTALL_BIN) $(PKG_BUILD_DIR)/openwrt/drcom-wired $(1)/usr/bin/drcom-wired
57+
$(INSTALL_CONF) $(PKG_BUILD_DIR)/drcom_wired.conf $(1)/etc/drcom_wired.conf
58+
$(INSTALL_DATA) $(PKG_BUILD_DIR)/*.py $(1)/usr/lib/micropython-drcom/
59+
endef
60+
61+
define Package/micropython-drcom-with-lib/install
62+
$(call Package/micropython-drcom/install,$(1))
63+
$(INSTALL_DIR) $(1)/usr/lib/micropython-drcom/
64+
$(CP) -ar $(PKG_BUILD_DIR)/micropython/* $(1)/usr/lib/micropython-drcom/
65+
endef
66+
67+
$(eval $(call BuildPackage,micropython-drcom))
68+
$(eval $(call BuildPackage,micropython-drcom-with-lib))

openwrt/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# openwrt-micropython-drcom
2+
3+
链接该文件夹到 [OpenWrt SDK](https://openwrt.org/docs/guide-developer/using_the_sdk)`package/network/micropython-drcom`,在 OpenWrt SDK 目录运行
4+
5+
```bash
6+
make package/micropython-drcom/compile
7+
```
8+
9+
之后便可在 `bin/packages/*/base/` 下得到 micropython-drcom 的两个包:
10+
11+
- `micropython-drcom`: 依赖于 `micropython-lib` 包,连同依赖安装后会比 `micropython-drcom-with-lib` 大;
12+
- `micropython-drcom-with-lib`: 内有裁剪过的 micropython-lib,所以不依赖于 `micropython-lib` 包,如果没有其余使用 `micropython-lib` 包的需求,推荐使用该包以减少体积。

openwrt/drcom-wired

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
exec micropython /usr/lib/micropython-drcom/latest-wired-micropython.py $@

openwrt/src

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../

0 commit comments

Comments
 (0)