Alexander Pyhalov
2017-12-21 af5257f421eab6591e9b4fdbe61a9475befea24f
commit | author | age
5948ae 1 #
AP 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 #
23 # Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
24 #
25
26 include ../../../make-rules/shared-macros.mk
27
28 COMPONENT_NAME=        ruby
af5257 29 COMPONENT_VERSION=    2.2.9
5948ae 30 COMPONENT_PROJECT_URL=    http://www.ruby-lang.org/
AP 31 COMPONENT_SRC=    \
32     $(COMPONENT_NAME)-$(COMPONENT_VERSION)
33 COMPONENT_ARCHIVE=    $(COMPONENT_SRC).tar.xz
34 COMPONENT_ARCHIVE_HASH=    \
af5257 35     sha256:313b44b1105589d00bb30b9cccf7da44d263fe20a2d8d269ada536d4a7ef285c
5948ae 36 COMPONENT_ARCHIVE_URL=    \
ee0b88 37     https://cache.ruby-lang.org/pub/ruby/2.2/$(COMPONENT_ARCHIVE)
5948ae 38 COMPONENT_BUGDB=    utility/ruby
AP 39
ee0b88 40 include $(WS_MAKE_RULES)/prep.mk
SA 41 include $(WS_MAKE_RULES)/ips.mk
42 include $(WS_MAKE_RULES)/configure.mk
5948ae 43
AP 44 # COMPONENT_VERSION <major>.<minor>.<teeny>
45 # is transformed into <major>.<minor> for RUBY_VER.
fe9d65 46 # First change the separator '.' to ' ', so we can use "word" to pull the
5948ae 47 # first two space-separated words from the string.
AP 48 RUBY_VER_WORDS=    $(subst ., ,$(COMPONENT_VERSION))
49 RUBY_VER=$(word 1,$(RUBY_VER_WORDS)).$(word 2,$(RUBY_VER_WORDS))
50 # the library-compatible version
51 RUBY_LIB_VER=2.2.0
52
53 PROTORUBYDIR=$(PROTO_DIR)/usr/ruby/$(RUBY_VER)
54 PROTO_RBCONFIG_FILE=$(PROTORUBYDIR)/lib/ruby/$(RUBY_LIB_VER)/i386-solaris$(SOLARIS_VERSION)/rbconfig.rb
55
56 # these macros are used in the package manifest
57 PKG_MACROS+=    RUBY_VER=$(RUBY_VER) RUBY_LIB_VER=$(RUBY_LIB_VER)
58
59 # Apply some of the edits here--including to the sed scripts themselves.
60 # These modifications of ruby.1 must occur after ruby
61 # is installed, not before.  Although there are some other patches
fe9d65 62 # to ruby.1 that occur before, the ruby installation does some
5948ae 63 # formatting of ruby.1 that won't occur if the below changes
AP 64 # are applied.
fe9d65 65 # Fix generated rbconfig.rb using /usr/bin/sed; gsed doesn't
5948ae 66 # work for some of the commands in rbconfig.sedscript.
AP 67 COMPONENT_POST_INSTALL_ACTION += \
68     $(GSED) -e "s/RUBY_VER/$(RUBY_VER)/" \
69         -e "s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" Solaris/gem.1-generic \
70         > Solaris/gem.1 ; \
71     $(GSED) -e "s/RUBY_VER/$(RUBY_VER)/" \
72         -e "s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" Solaris/ruby.1.sedscript \
73         > Solaris/ruby.1.sedscript.mod ; \
74     $(GSED) -e  "s/RUBY_VER/$(RUBY_VER)/" \
75         -e "s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" Solaris/rbconfig.sedscript \
76         > Solaris/rbconfig.sedscript.mod ; \
77     $(GSED) -i -f Solaris/ruby.1.sedscript.mod \
78         $(PROTORUBYDIR)/share/man/man1/ruby.1 ; \
79     /usr/bin/sed -f Solaris/rbconfig.sedscript.mod \
80     $(PROTO_RBCONFIG_FILE) > rbconfig.rb.mod ; \
81     $(MV) rbconfig.rb.mod $(PROTO_RBCONFIG_FILE)
82
83 # default LD_OPTION $(LD_B_DIRECT) causes problems--
84 # during install of ruby, ruby is executed and will core dump
85 # after compiling with this option
86 LD_B_DIRECT=
87
fe9d65 88 # don't use LD_Z_IGNORE: causes ruby linker problems with
5948ae 89 # unreferenced symbol tgetent in libreadline, similar to bug #15617172
AP 90 LD_Z_IGNORE=
91
92 CONFIGURE_PREFIX =    $(USRDIR)/$(COMPONENT_NAME)/$(RUBY_VER)
93
94 CONFIGURE_OPTIONS +=    --with-rubylibprefix=$(CONFIGURE_LIBDIR.32)/ruby
95 CONFIGURE_OPTIONS +=    --enable-shared
96 CONFIGURE_OPTIONS +=    --enable-rpath
ce6d99 97 CONFIGURE_OPTIONS +=    --enable-dtrace
5948ae 98 # Don't need docs for ruby C source files
AP 99 CONFIGURE_OPTIONS +=    --disable-install-capi
100 CONFIGURE_OPTIONS +=    --disable-option-checking
101 CONFIGURE_OPTIONS +=    --with-openssl
102 CONFIGURE_OPTIONS +=    CFLAGS="$(CFLAGS)"
103
104 # fiddle.so (ext/fiddle) links to libffi, which does not define
fe9d65 105 # ffi_raw_size(), although its prototype is in libffi's
SA 106 # /usr/lib/libffi-3.0/include/ffi.h header file.
5948ae 107 # Defining FFI_NO_RAW_API avoids use of ffi_raw_size().
AP 108 # This is a workaround to bug
109 # 17349280 - libffi is missing ffi_raw_size()
110 CFLAGS +=        -DFFI_NO_RAW_API
111
112 CLEAN_PATHS +=        Solaris/gem.1 Solaris/rbconfig.sedscript.mod \
113             Solaris/ruby.1.sedscript.mod
114
ee0b88 115 include $(WS_MAKE_RULES)/shared-targets.mk
5948ae 116
AP 117 # common targets
118
119 build:        $(BUILD_32)
120
ee0b88 121 install:    $(INSTALL_32)
5948ae 122
af5257 123 # 16220 tests, 2553102 assertions, 27 failures, 0 errors, 44 skips
AP 124 # Failed: FTPTest#test_abort, FTPTest#test_status, TestSprintfComb#test_format_float*, TestException#test_machine_stackoverflow_by_define_method
5948ae 125 test:    $(TEST_32)
AP 126
aa0040 127 REQUIRED_PACKAGES += library/database/gdbm
AP 128 REQUIRED_PACKAGES += library/libffi
129 REQUIRED_PACKAGES += library/libyaml
130 REQUIRED_PACKAGES += library/ncurses
131 REQUIRED_PACKAGES += library/readline
132 REQUIRED_PACKAGES += library/security/openssl
133 REQUIRED_PACKAGES += library/zlib
134 REQUIRED_PACKAGES += runtime/ruby-18
135 REQUIRED_PACKAGES += runtime/ruby-22
136 REQUIRED_PACKAGES += runtime/ruby-22/ruby-tk
137 REQUIRED_PACKAGES += runtime/tcl-8
138 REQUIRED_PACKAGES += runtime/tk-8
139 REQUIRED_PACKAGES += SUNWcs
140 REQUIRED_PACKAGES += system/library
141 REQUIRED_PACKAGES += system/library/g++-4-runtime
142 REQUIRED_PACKAGES += system/library/math
143 REQUIRED_PACKAGES += x11/library/libx11