aboutsummaryrefslogtreecommitdiff
path: root/lang/lua-rs232/Makefile
blob: 7ef5ac7e3802445916d5da8e5f02ce0b0a9e1203 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#
# Copyright (C) 2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=lua-rs232
PKG_VERSION:=1.0.3
PKG_RELEASE:=1
PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
PKG_LICENSE:=MIT

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/srdgame/librs232.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=a9d463181e7f7034fe6a55bc38e845fb04fa93ba
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)

PKG_INSTALL:=1

include $(INCLUDE_DIR)/package.mk

define Package/lua-rs232
  SUBMENU:=Lua
  SECTION:=lang
  CATEGORY:=Languages
  TITLE:=Lua Serial Library
  URL:=https://github.com/srdgame/librs232
  DEPENDS:= +lua
endef

define Package/lua-rs232/description
  multiplatform library for serial communications over RS-232
endef

CONFIGURE_ARGS += \
	--with-lua-inc=$(STAGING_DIR)/usr/include \
	--with-lua-lib=$(STAGING_DIR)/usr/lib

#define Build/Configure
#	( cd "$(PKG_BUILD_DIR)"; ./autogen.sh )
#	$(call Build/Configure/Default)
#endef
define Build/Configure
endef

define Build/Compile
	(cd "$(PKG_BUILD_DIR)"; $(TARGET_CC)  src/rs232.c src/rs232_posix.c bindings/lua/luars232.c -DLUAROCKS_HACK -std=gnu99 -I./include -I$(STAGING_DIR)/usr/include -L$(STAGING_DIR)/usr/lib -fPIC -shared -o luars232.so)
endef

define Build/Install
endef

define Package/lua-rs232/install
	$(INSTALL_DIR) $(1)/usr/lib/lua
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/luars232.so $(1)/usr/lib/lua/
endef

$(eval $(call BuildPackage,lua-rs232))