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