Alexander Pyhalov
2014-10-06 1757a2a795779307407ce7560dd26db0b83df408
commit | author | age
599609 1 #
AC 2 # CDDL HEADER START
3 #
4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
7 #
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
12 #
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 #
19 # CDDL HEADER END
20 #
21
22 #
1d52aa 23 # Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
599609 24 #
AC 25
3d8bd6 26 include ../../../make-rules/shared-macros.mk
599609 27
AC 28 COMPONENT_NAME=        ruby
29 COMPONENT_VERSION=    1.8.7
1757a2 30 COMPONENT_REVISION=    2
3d89bf 31 COMPONENT_PATCH_VERSION=    374
60e6e0 32 COMPONENT_PROJECT_URL=    http://www.ruby-lang.org/
599609 33 COMPONENT_SRC=        $(COMPONENT_NAME)-$(COMPONENT_VERSION)-p$(COMPONENT_PATCH_VERSION)
AC 34 COMPONENT_ARCHIVE=    $(COMPONENT_SRC).tar.bz2
35e110 35 COMPONENT_ARCHIVE_HASH=    \
3d89bf 36     sha256:b4e34703137f7bfb8761c4ea474f7438d6ccf440b3d35f39cc5e4d4e239c07e3
599609 37 COMPONENT_ARCHIVE_URL=    http://ftp.ruby-lang.org/pub/ruby/1.8/$(COMPONENT_ARCHIVE)
AC 38 IPS_COMPONENT_VERSION=    $(COMPONENT_VERSION).$(COMPONENT_PATCH_VERSION)
3b89c9 39 COMPONENT_BUGDB=    utility/ruby
599609 40
AC 41 # rubygems 
42 COMPONENT_SRC_1=    rubygems-1.3.5
43 COMPONENT_ARCHIVE_1=    $(COMPONENT_SRC_1).tgz
35e110 44 COMPONENT_ARCHIVE_HASH_1=    \
MS 45     sha256:c0928cc1ae54dedfb5f57ad3829882c1f90e42bc17bf50491aa6f93a937546ac
599609 46 COMPONENT_ARCHIVE_URL_1=    http://production.cf.rubygems.org/rubygems/$(COMPONENT_ARCHIVE_1)
AC 47
48 SOURCE_DIR_1=$(COMPONENT_DIR)/$(COMPONENT_SRC_1)
49 CLEAN_PATHS += $(SOURCE_DIR_1)
50
51 include $(WS_TOP)/make-rules/prep.mk
52 include $(WS_TOP)/make-rules/ips.mk
53 include $(WS_TOP)/make-rules/configure.mk
54
55 # COMPONENT_VERSION <major>.<minor>.<teeny>
56 # is transformed into <major>.<minor> for RUBY_VER.
57 # First change the separator '.' to ' ', so we can use "word" to pull the 
58 # first two space-separated words from the string.
59 RUBY_VER_WORDS=    $(subst ., ,$(COMPONENT_VERSION))
60 RUBY_VER=$(word 1,$(RUBY_VER_WORDS)).$(word 2,$(RUBY_VER_WORDS))
61
62 GEMHOME=/var/ruby/$(RUBY_VER)/gem_home
63 PROTORUBYDIR=$(PROTO_DIR)/usr/ruby/$(RUBY_VER)
64 PROTOGEMHOME=$(PROTO_DIR)$(GEMHOME)
65 RUBYGEMS_INSTALL_TARGET=$(PROTORUBYDIR)/bin/gem
66
67 PROTO_RBCONFIG_FILE=$(PROTORUBYDIR)/lib/ruby/$(RUBY_VER)/$(MACH)-solaris$(SOLARIS_VERSION)/rbconfig.rb
68
69 # these macros are used in the package manifest
70 PKG_MACROS+=    RUBY_VER=$(RUBY_VER)
71
3d8bd6 72 # patches to rubygems are in a separate directory from the ruby patches
AP 73 PATCH_DIR_1 = rubygems-patches
74 PATCHES_1 = $(shell find $(PATCH_DIR_1) -type f -name $(PATCH_PATTERN) \
75     2>/dev/null | sort)
76
599609 77 # Since configure.in is patched, we need to autoconf after the patch.
AC 78 # Also, unpack the 2nd archive for rubygems.
3d8bd6 79 # Rubygems has patches, but it does not use configure nor make.
599609 80 COMPONENT_PREP_ACTION = (cd $(@D) ; autoconf); \
AC 81     $(RM) -r $(SOURCE_DIR_1); \
3d8bd6 82     $(UNPACK) $(UNPACK_ARGS) $(USERLAND_ARCHIVES)$(COMPONENT_ARCHIVE_1); \
AP 83     $(foreach patch,$(PATCHES_1), \
84     $(GPATCH) -d $(SOURCE_DIR_1) $(GPATCH_FLAGS) < $(patch); )
599609 85
AC 86 # These modifications of ruby.1 must occur after ruby
87 # is installed, not before.  Although there are some other patches
88 # to ruby.1 that occur before, the ruby installation does some 
89 # formatting of ruby.1 that won't occur if the below changes
90 # are applied.
91 COMPONENT_POST_INSTALL_ACTION += \
92     /bin/sed -f Solaris/ruby.1.sedscript \
93     $(PROTORUBYDIR)/share/man/man1/ruby.1 > ruby.1.mod ; \
94     $(MV) ruby.1.mod $(PROTORUBYDIR)/share/man/man1/ruby.1
95
96 # Fix generated rbconfig.rb.
97 # This should NOT occur until AFTER rubygems installs;
98 # otherwise the GEM_HOME setting added to rbconfig.rb will cause setup.rb
99 # to attempt (and fail) to install rubygems docs on the build system,
100 # rather than in the proto area.
101 # Also fix magic line of gem script.
102 POST_RUBYGEMS_INSTALL_ACTION += \
103     /bin/sed -f Solaris/rbconfig.sedscript $(PROTO_RBCONFIG_FILE) \
104     > rbconfig.rb.mod ; \
105     $(MV) rbconfig.rb.mod $(PROTO_RBCONFIG_FILE) ; \
3d8bd6 106     /bin/sed -e '1s;^\#!/.*;\#!/usr/ruby/$(RUBY_VER)/bin/ruby;' $(PROTORUBYDIR)/bin/gem \
599609 107     > gem.mod ; \
AC 108     $(MV) gem.mod $(PROTORUBYDIR)/bin/gem
109
110 # dtrace only available for i386 at this time;
111 # on sparc, a compiler bug (CR #6659110) prevents use of dtrace
112 DTRACE_FLAG_i386 =    --enable-dtrace
113 DTRACE_FLAG =        $(DTRACE_FLAG_$(MACH))
114
115 # dtrace.d, created in source dir during patch for dtrace,
116 # is needed for building
117 DTRACE_PRE_BUILD_i386 =    $(CP) $(SOURCE_DIR)/dtrace.d $(BUILD_DIR_32) 
118 DTRACE_PRE_BUILD =    $(DTRACE_PRE_BUILD_$(MACH))
119 COMPONENT_PRE_BUILD_ACTION =    $(DTRACE_PRE_BUILD)
120
121 # default LD_OPTION $(LD_B_DIRECT) causes problems--
122 # during install of ruby, ruby is executed and will core dump
123 # after compiling with this option
124 LD_B_DIRECT=
125
126 # don't use LD_Z_IGNORE: causes ruby linker problems with 
127 # unreferenced symbol tgetent in libreadline, similar to CR #6919344
128 LD_Z_IGNORE=
129
0e7da0 130 # keep ASLR disabled:
AC 131 # when building ruby, miniruby (used for boot-strapping ruby) may
132 # core dump on sparc with ASLR enabled
133 ASLR_MODE = $(ASLR_DISABLE)
1d52aa 134
3d8bd6 135 # Several of the drb tests will leave stray ruby processes behind;
AP 136 # move these tests aside so they won't be run by the test target.
137 # They aren't needed by the build or packages, so we keep them 
138 # renamed.
139 COMPONENT_PRE_TEST_ACTION += \
140     if [ -e $(SOURCE_DIR)/test/drb/test_drbssl.rb ]; then \
141         $(MV) $(SOURCE_DIR)/test/drb/test_drbssl.rb $(SOURCE_DIR)/test/drb/test_drbssl.rb-save; \
142     fi
143
599609 144 CONFIGURE_PREFIX =    $(USRDIR)/$(COMPONENT_NAME)/$(RUBY_VER)
AC 145 CONFIGURE_OPTIONS += $(DTRACE_FLAG)
146 CONFIGURE_OPTIONS += --enable-shared
147 CONFIGURE_OPTIONS += --enable-install-doc
148 CONFIGURE_OPTIONS += --disable-option-checking
149 CONFIGURE_OPTIONS += --with-openssl
150 CONFIGURE_OPTIONS += --with-tk-dir=/usr
151 CONFIGURE_OPTIONS += --with-curses-dir=/usr
152
3d8bd6 153
599609 154 include $(WS_TOP)/make-rules/shared-targets.mk
AC 155
3d8bd6 156 COMPONENT_BUILD_ARGS=
0abd27 157
599609 158 # common targets
AC 159
160 build:        $(BUILD_32)
161
162 install:    build $(INSTALL_32) $(RUBYGEMS_INSTALL_TARGET)
163
164 # one expected failure in TestHTTP::HTTPConnectionTest
86ebaa 165 # also possibly test_endblockwarn(TestBeginEndBlock), 
AC 166 # test_step_ruby_core_35753(TestRange)
599609 167 test:    $(TEST_32)
AC 168
169 # install rubygems using ruby installed in proto area
170 $(RUBYGEMS_INSTALL_TARGET):    $(INSTALL_32)
171     (cd $(COMPONENT_SRC_1); $(ENV) - \
172     "DESTDIR=$(PROTO_DIR)" \
173     LD_LIBRARY_PATH=$(PROTORUBYDIR)/lib \
174     GEM_HOME=$(PROTOGEMHOME) \
175     $(PROTORUBYDIR)/bin/ruby \
176     -I$(PROTORUBYDIR)/lib/ruby/1.8 \
177     -I$(PROTORUBYDIR)/lib/ruby/1.8/$(MACH)-solaris$(SOLARIS_VERSION) \
178     setup.rb --vendor --destdir=$(PROTO_DIR) )
179     $(POST_RUBYGEMS_INSTALL_ACTION)
180
181 BUILD_PKG_DEPENDENCIES =    $(BUILD_TOOLS)
182
183 include $(WS_TOP)/make-rules/depend.mk