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 2023, Friedrich Kink
25 # Copyright 2024, Klaus Ziegler
28 include ..
/..
/..
/make-rules
/shared-macros.mk
31 COMPONENT_VERSION
= 3.2.6
33 COMPONENT_SUMMARY
= Ruby
, RubyGems
, and Rake
34 COMPONENT_PROJECT_URL
= https
://www.ruby-lang.org
/
35 COMPONENT_SRC
= $(COMPONENT_NAME
)-$(COMPONENT_VERSION
)
36 COMPONENT_ARCHIVE
= $(COMPONENT_SRC
).
tar.xz
37 COMPONENT_ARCHIVE_URL
= https
://cache.ruby-lang.org
/pub
/ruby
/3.2/$(COMPONENT_ARCHIVE
)
38 COMPONENT_ARCHIVE_HASH
= sha256
:671134022238c2c4a9d79dc7d1e58c909634197617901d25863642f735a27ecb
39 COMPONENT_FMRI
= runtime
/ruby-32
40 COMPONENT_CLASSIFICATION
= Development
/Ruby
41 COMPONENT_LICENSE
= Ruby License
42 COMPONENT_LICENSE_FILE
= COPYING
44 include $(WS_MAKE_RULES
)/common.mk
50 # COMPONENT_VERSION <major>.<minor>.<teeny>
51 # is transformed into <major>.<minor> for RUBY_VER.
52 # First change the separator '.' to ' ', so we can use "word" to pull the
53 # first two space-separated words from the string.
54 RUBY_VER_WORDS
= $(subst .
, ,$(COMPONENT_VERSION
))
55 RUBY_VER
= $(word 1,$(RUBY_VER_WORDS
)).
$(word 2,$(RUBY_VER_WORDS
))
56 # the library-compatible version
57 RUBY_LIB_VER
= $(RUBY_VER
)
59 PROTORUBYDIR
= $(PROTO_DIR
)/usr
/ruby
/$(RUBY_VER
)
67 PROTO_RBCONFIG_FILE
= $(PROTORUBYDIR
)/lib
/ruby
/$(RUBY_LIB_VER
)/$(RUBY_CPU
)-solaris2.11
/rbconfig.rb
69 # these macros are used in the package manifest
70 PKG_MACROS
+= RUBY_VER
=$(RUBY_VER
)
71 PKG_MACROS
+= RUBY_LIB_VER
=$(RUBY_LIB_VER
)
72 PKG_MACROS
+= RUBY_CPU
=$(RUBY_CPU
)
74 GENERATE_EXTRA_CMD
+= |
$(GSED
) -e
's|x86_64|$$(RUBY_CPU)|g'
76 # Apply some of the edits here--including to the sed scripts themselves.
77 # These modifications of ruby.1 must occur after ruby
78 # is installed, not before. Although there are some other patches
79 # to ruby.1 that occur before, the ruby installation does some
80 # formatting of ruby.1 that won't occur if the below changes
82 # Fix generated rbconfig.rb using /usr/bin/sed; gsed doesn't
83 # work for some of the commands in rbconfig.sedscript.
84 COMPONENT_POST_INSTALL_ACTION
+= \
85 $(GSED
) -e
"s/RUBY_VER/$(RUBY_VER)/" \
86 -e
"s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" Solaris
/gem
.1-generic \
88 $(GSED
) -e
"s/RUBY_VER/$(RUBY_VER)/" \
89 -e
"s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" Solaris
/ruby
.1.sedscript \
90 > Solaris
/ruby
.1.sedscript.mod
; \
91 $(GSED
) -e
"s/RUBY_VER/$(RUBY_VER)/" \
92 -e
"s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" \
93 -e
"s,%%CC%%,$(CC)," \
94 -e
"s,%%CXX%%,$(CXX)," \
95 Solaris
/rbconfig.sedscript \
96 > Solaris
/rbconfig.sedscript.mod
; \
97 $(GSED
) -i
-f Solaris
/ruby
.1.sedscript.mod \
98 $(PROTORUBYDIR
)/share
/man
/man1
/ruby
.1 ; \
99 /usr
/bin
/sed
-f Solaris
/rbconfig.sedscript.mod \
100 $(PROTO_RBCONFIG_FILE
) > rbconfig.rb.mod
; \
101 $(MV
) rbconfig.rb.mod
$(PROTO_RBCONFIG_FILE
) ; \
102 $(MW
) $(PROTO_DIR
)/usr
/include $(PROTORUBYDIR
) ;
104 COMPONENT_POST_INSTALL_ACTION
+= \
105 encdir
="$(PROTORUBYDIR)/lib/ruby/$(RUBY_LIB_VER)/$(RUBY_CPU)-solaris2.11/enc"; \
106 filelist
=`ls -1I trans $$encdir`; \
107 subdirlist
=`ls -1 $$encdir/trans`; \
108 for f in
$$filelist; \
110 /usr
/bin
/elfedit
-e
'dyn:runpath "$(USRDIR)/$(COMPONENT_NAME)/$(RUBY_VER)/lib/$(MACH64)"' $$encdir/$$f; \
112 for f in
$$subdirlist; \
114 /usr
/bin
/elfedit
-e
'dyn:runpath "$(USRDIR)/$(COMPONENT_NAME)/$(RUBY_VER)/lib/$(MACH64)"' $$encdir/trans
/$$f; \
117 # Set the locale to generate documentation correctly
118 COMPONENT_BUILD_ENV
+= LC_ALL
=en_US.UTF-8
119 COMPONENT_INSTALL_ENV
+= LC_ALL
=en_US.UTF-8
121 CONFIGURE_PREFIX
= $(USRDIR
)/$(COMPONENT_NAME
)/$(RUBY_VER
)
123 CONFIGURE_OPTIONS
+= --with-rubylibprefix
=$(CONFIGURE_LIBDIR
.32)/ruby
124 CONFIGURE_OPTIONS
+= --enable-shared
125 CONFIGURE_OPTIONS
+= --enable-rpath
126 CONFIGURE_OPTIONS
+= --enable-dtrace
128 #CONFIGURE_OPTIONS += --enable-yjit
129 CONFIGURE_OPTIONS
+= --enable-debug-env
130 CONFIGURE_OPTIONS
+= --with-thread
=pthread
131 CONFIGURE_OPTIONS
+= --with-rdoc
=ri
,html
132 CONFIGURE_OPTIONS
+= --with-ruby-version
=$(RUBY_VER
)
133 # Don't need docs for ruby C source files
134 CONFIGURE_OPTIONS
+= --disable-install-capi
135 CONFIGURE_OPTIONS
+= --disable-option-checking
136 CONFIGURE_OPTIONS
+= --with-openssl-dir
=$(OPENSSL_PREFIX
)
137 CONFIGURE_OPTIONS
+= CFLAGS
="$(CFLAGS)"
139 CLEAN_PATHS
+= Solaris
/gem
.1 Solaris
/rbconfig.sedscript.mod \
140 Solaris
/ruby
.1.sedscript.mod
142 COMPONENT_TEST_TRANSFORMS
+= \
144 '-e "s/Finished tests in .*s, .* tests\/s, .* assertions/Finished tests in Xs, X tests\/s, X assertions/"' \
145 '-e "s/\(.*\) tests, .* assertions, \(.*\) failures, \(.*\) errors, .* skips/\1 tests, X assertions, \2 failures, \3 errors, X skips/"' \
149 '-e "/test succeeded/p"' \
150 '-e "/Running tests/p"' \
151 '-e "/Finished tests in Xs, X tests\/s, X assertions/p"' \
152 '-e "/.* tests, X assertions, .* failures, .* errors, X skips/p"'
153 COMPONENT_TEST_TRANSFORMS
+= ' | head -4'
155 # Auto-generated dependencies
156 REQUIRED_PACKAGES
+= $(OPENSSL_PKG
)
157 REQUIRED_PACKAGES
+= $(READLINE_PKG
)
158 REQUIRED_PACKAGES
+= SUNWcs
159 REQUIRED_PACKAGES
+= library
/gmp
160 REQUIRED_PACKAGES
+= library
/libffi
161 REQUIRED_PACKAGES
+= library
/libyaml
162 REQUIRED_PACKAGES
+= library
/zlib
163 REQUIRED_PACKAGES
+= system
/library
164 REQUIRED_PACKAGES
+= system
/library
/math