-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
91 lines (73 loc) · 2.46 KB
/
Makefile
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
RUBY_PKG_LIBVER:=2.2
PKG_NAME:=ruby-eventmachine
PKG_SHORT_NAME:=eventmachine
PKG_RELEASE:=1
PKG_LIBVER:=1.2.5
PKG_REV:=dcec4a7890d2cec53cbf397e9561ad7ef0f48b21
PKG_VERSION:=$(PKG_LIBVER)
PKG_SOURCE:=$(PKG_NAME).tar.gz
PKG_SOURCE_URL:=git://github.com/eventmachine/eventmachine.git
PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_PROTO:=git
PKG_BUILD_DEPENDS:=
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/ruby-eventmachine
SUBMENU:=Ruby
SECTION:=lang
CATEGORY:=Languages
DEPENDS:=+ruby-socket +libstdcpp +libc +libgcc +libopenssl
TITLE:=Ruby eventmachine gem
endef
RUBY:= \
$(STAGING_DIR_HOST)/bin/ruby -I $(STAGING_DIR_HOST)/share/ri \
define Package/ruby-eventmachine/description
This package contains the ruby eventmachine gem.
endef
define Build/Configure/eventmachine
(cd $(PKG_BUILD_DIR)/ext; \
$(RUBY) extconf.rb; \
);
endef
define Build/Compile/eventmachine
$(MAKE_VARS) \
$(MAKE) -C $(PKG_BUILD_DIR)/ext \
$(MAKE_FLAGS) \
$(1);
$(CP) $(PKG_BUILD_DIR)/ext/*.so $(PKG_BUILD_DIR)/lib/
endef
define Build/Configure/fastfilereader
(cd $(PKG_BUILD_DIR)/ext/fastfilereader; \
$(RUBY) extconf.rb; \
);
endef
define Build/Compile/fastfilereader
$(MAKE_VARS) \
$(MAKE) -C $(PKG_BUILD_DIR)/ext/fastfilereader \
$(MAKE_FLAGS) \
$(1);
$(CP) $(PKG_BUILD_DIR)/ext/fastfilereader/*.so $(PKG_BUILD_DIR)/lib/
endef
define Build/Configure
$(call Build/Configure/eventmachine)
$(call Build/Configure/fastfilereader)
endef
# 1337hack Makefiles here
define Build/Compile
$(SED) 's/-fstack-protector//' $(PKG_BUILD_DIR)/ext/fastfilereader/Makefile
$(SED) '17s/host.*/target-mips_34kc_uClibc-0.9.33.2\/usr\/include\/ruby-2.2\/mips-linux-gnu/' $(PKG_BUILD_DIR)/ext/fastfilereader/Makefile
$(call Build/Compile/fastfilereader)
$(SED) 's/-fstack-protector//' $(PKG_BUILD_DIR)/ext/Makefile
$(SED) '17s/host.*/target-mips_34kc_uClibc-0.9.33.2\/usr\/include\/ruby-2.2\/mips-linux-gnu/' $(PKG_BUILD_DIR)/ext/Makefile
$(call Build/Compile/eventmachine)
endef
define Package/ruby-eventmachine/install
$(INSTALL_DIR) $(1)/usr/lib/ruby/$(RUBY_PKG_LIBVER)/mips-linux-gnu
$(CP) $(PKG_BUILD_DIR)/lib/eventmachine.rb $(1)/usr/lib/ruby/$(RUBY_PKG_LIBVER)/
$(CP) $(PKG_BUILD_DIR)/lib/em $(1)/usr/lib/ruby/$(RUBY_PKG_LIBVER)/
$(CP) $(PKG_BUILD_DIR)/lib/*.so $(1)/usr/lib/ruby/$(RUBY_PKG_LIBVER)/mips-linux-gnu
endef
$(eval $(call BuildPackage,ruby-eventmachine,+libopenssl))