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.
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.
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]
23 # Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
24 # Copyright 2020, Michal Nowak
29 include ..
/..
/..
/make-rules
/shared-macros.mk
32 COMPONENT_VERSION
= 2.3.8
34 COMPONENT_PROJECT_URL
= http
://www.ruby-lang.org
/
35 COMPONENT_SRC
= $(COMPONENT_NAME
)-$(COMPONENT_VERSION
)
36 COMPONENT_ARCHIVE
= $(COMPONENT_SRC
).
tar.xz
37 COMPONENT_ARCHIVE_HASH
= \
38 sha256
:910f635d84fd0d81ac9bdee0731279e6026cb4cd1315bbbb5dfb22e09c5c1dfe
39 COMPONENT_ARCHIVE_URL
= https
://cache.ruby-lang.org
/pub
/ruby
/2.3/$(COMPONENT_ARCHIVE
)
41 include $(WS_MAKE_RULES
)/common.mk
43 # COMPONENT_VERSION <major>.<minor>.<teeny>
44 # is transformed into <major>.<minor> for RUBY_VER.
45 # First change the separator '.' to ' ', so we can use "word" to pull the
46 # first two space-separated words from the string.
47 RUBY_VER_WORDS
= $(subst .
, ,$(COMPONENT_VERSION
))
48 RUBY_VER
=$(word 1,$(RUBY_VER_WORDS
)).
$(word 2,$(RUBY_VER_WORDS
))
49 # the library-compatible version
52 PROTORUBYDIR
=$(PROTO_DIR
)/usr
/ruby
/$(RUBY_VER
)
53 PROTO_RBCONFIG_FILE
=$(PROTORUBYDIR
)/lib
/ruby
/$(RUBY_LIB_VER
)/$(MACH
)-solaris
$(SOLARIS_VERSION
)/rbconfig.rb
55 # these macros are used in the package manifest
56 PKG_MACROS
+= RUBY_VER
=$(RUBY_VER
) RUBY_LIB_VER
=$(RUBY_LIB_VER
)
58 # Apply some of the edits here--including to the sed scripts themselves.
59 # These modifications of ruby.1 must occur after ruby
60 # is installed, not before. Although there are some other patches
61 # to ruby.1 that occur before, the ruby installation does some
62 # formatting of ruby.1 that won't occur if the below changes
64 # Fix generated rbconfig.rb using /usr/bin/sed; gsed doesn't
65 # work for some of the commands in rbconfig.sedscript.
66 COMPONENT_POST_INSTALL_ACTION
+= \
67 $(GSED
) -e
"s/RUBY_VER/$(RUBY_VER)/" \
68 -e
"s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" Solaris
/gem
.1-generic \
70 $(GSED
) -e
"s/RUBY_VER/$(RUBY_VER)/" \
71 -e
"s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" Solaris
/ruby
.1.sedscript \
72 > Solaris
/ruby
.1.sedscript.mod
; \
73 $(GSED
) -e
"s/RUBY_VER/$(RUBY_VER)/" \
74 -e
"s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" \
75 -e
"s,%%CC%%,$(CC)," \
76 -e
"s,%%CXX%%,$(CXX)," \
77 Solaris
/rbconfig.sedscript \
78 > Solaris
/rbconfig.sedscript.mod
; \
79 $(GSED
) -i
-f Solaris
/ruby
.1.sedscript.mod \
80 $(PROTORUBYDIR
)/share
/man
/man1
/ruby
.1 ; \
81 /usr
/bin
/sed
-f Solaris
/rbconfig.sedscript.mod \
82 $(PROTO_RBCONFIG_FILE
) > rbconfig.rb.mod
; \
83 $(MV
) rbconfig.rb.mod
$(PROTO_RBCONFIG_FILE
)
85 # default LD_OPTION $(LD_B_DIRECT) causes problems--
86 # during install of ruby, ruby is executed and will core dump
87 # after compiling with this option
90 # don't use LD_Z_IGNORE: causes ruby linker problems with
91 # unreferenced symbol tgetent in libreadline, similar to bug #15617172
94 # Set the locale to generate documentation correctly
95 COMPONENT_BUILD_ENV
+= LC_ALL
=en_US.UTF-8
96 COMPONENT_INSTALL_ENV
+= LC_ALL
=en_US.UTF-8
98 CONFIGURE_PREFIX
= $(USRDIR
)/$(COMPONENT_NAME
)/$(RUBY_VER
)
100 CONFIGURE_OPTIONS
+= --with-rubylibprefix
=$(CONFIGURE_LIBDIR
.32)/ruby
101 CONFIGURE_OPTIONS
+= --enable-shared
102 CONFIGURE_OPTIONS
+= --enable-rpath
103 CONFIGURE_OPTIONS
+= --enable-dtrace
104 # Don't need docs for ruby C source files
105 CONFIGURE_OPTIONS
+= --disable-install-capi
106 CONFIGURE_OPTIONS
+= --disable-option-checking
107 CONFIGURE_OPTIONS
+= --with-openssl
108 CONFIGURE_OPTIONS
+= CFLAGS
="$(CFLAGS)"
110 # fiddle.so (ext/fiddle) links to libffi, which does not define
111 # ffi_raw_size(), although its prototype is in libffi's
112 # /usr/lib/libffi-3.0/include/ffi.h header file.
113 # Defining FFI_NO_RAW_API avoids use of ffi_raw_size().
114 # This is a workaround to bug
115 # 17349280 - libffi is missing ffi_raw_size()
116 CFLAGS
+= -DFFI_NO_RAW_API
118 CLEAN_PATHS
+= Solaris
/gem
.1 Solaris
/rbconfig.sedscript.mod \
119 Solaris
/ruby
.1.sedscript.mod
121 # 16084 tests, 2236321 assertions, 2 failures, 1 errors, 49 skips
123 # Manually added dependendies
124 REQUIRED_PACKAGES
+= $(GCC_RUNTIME_PKG
)
125 REQUIRED_PACKAGES
+= $(GXX_RUNTIME_PKG
)
127 # Auto-generated dependencies
128 REQUIRED_PACKAGES
+= library
/database
/gdbm
129 REQUIRED_PACKAGES
+= library
/gmp
130 REQUIRED_PACKAGES
+= library
/libffi
131 REQUIRED_PACKAGES
+= library
/libyaml
132 REQUIRED_PACKAGES
+= library
/ncurses
133 REQUIRED_PACKAGES
+= library
/readline
134 REQUIRED_PACKAGES
+= library
/security
/openssl
135 REQUIRED_PACKAGES
+= library
/zlib
136 REQUIRED_PACKAGES
+= runtime
/tcl-8
137 REQUIRED_PACKAGES
+= runtime
/tk-8
138 REQUIRED_PACKAGES
+= shell/bash
139 REQUIRED_PACKAGES
+= SUNWcs
140 REQUIRED_PACKAGES
+= system
/library
141 REQUIRED_PACKAGES
+= system
/library
/math
142 REQUIRED_PACKAGES
+= x11
/library
/libx11