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
30 include ..
/..
/..
/make-rules
/shared-macros.mk
33 COMPONENT_VERSION
= 3.2.2
34 COMPONENT_SUMMARY
= Ruby
, RubyGems
, and Rake
35 COMPONENT_PROJECT_URL
= https
://www.ruby-lang.org
/
36 COMPONENT_SRC
= $(COMPONENT_NAME
)-$(COMPONENT_VERSION
)
37 COMPONENT_ARCHIVE
= $(COMPONENT_SRC
).
tar.xz
38 COMPONENT_ARCHIVE_URL
= https
://cache.ruby-lang.org
/pub
/ruby
/3.2/$(COMPONENT_ARCHIVE
)
39 COMPONENT_ARCHIVE_HASH
= sha256
:4b352d0f7ec384e332e3e44cdbfdcd5ff2d594af3c8296b5636c710975149e23
40 COMPONENT_FMRI
= runtime
/ruby-32
41 COMPONENT_CLASSIFICATION
= Development
/Ruby
42 COMPONENT_LICENSE
= Ruby License
43 COMPONENT_LICENSE_FILE
= COPYING
45 include $(WS_MAKE_RULES
)/common.mk
49 # COMPONENT_VERSION <major>.<minor>.<teeny>
50 # is transformed into <major>.<minor> for RUBY_VER.
51 # First change the separator '.' to ' ', so we can use "word" to pull the
52 # first two space-separated words from the string.
53 RUBY_VER_WORDS
= $(subst .
, ,$(COMPONENT_VERSION
))
54 RUBY_VER
= $(word 1,$(RUBY_VER_WORDS
)).
$(word 2,$(RUBY_VER_WORDS
))
55 # the library-compatible version
56 RUBY_LIB_VER
= $(RUBY_VER
)
58 PROTORUBYDIR
= $(PROTO_DIR
)/usr
/ruby
/$(RUBY_VER
)
59 PROTO_RBCONFIG_FILE
= $(PROTORUBYDIR
)/lib
/ruby
/$(RUBY_LIB_VER
)/x86_64-solaris
$(SOLARIS_VERSION
)/rbconfig.rb
61 # these macros are used in the package manifest
62 PKG_MACROS
+= RUBY_VER
=$(RUBY_VER
) RUBY_LIB_VER
=$(RUBY_LIB_VER
)
64 # Apply some of the edits here--including to the sed scripts themselves.
65 # These modifications of ruby.1 must occur after ruby
66 # is installed, not before. Although there are some other patches
67 # to ruby.1 that occur before, the ruby installation does some
68 # formatting of ruby.1 that won't occur if the below changes
70 # Fix generated rbconfig.rb using /usr/bin/sed; gsed doesn't
71 # work for some of the commands in rbconfig.sedscript.
72 COMPONENT_POST_INSTALL_ACTION
+= \
73 $(GSED
) -e
"s/RUBY_VER/$(RUBY_VER)/" \
74 -e
"s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" Solaris
/gem
.1-generic \
76 $(GSED
) -e
"s/RUBY_VER/$(RUBY_VER)/" \
77 -e
"s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" Solaris
/ruby
.1.sedscript \
78 > Solaris
/ruby
.1.sedscript.mod
; \
79 $(GSED
) -e
"s/RUBY_VER/$(RUBY_VER)/" \
80 -e
"s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" \
81 -e
"s,%%CC%%,$(CC)," \
82 -e
"s,%%CXX%%,$(CXX)," \
83 Solaris
/rbconfig.sedscript \
84 > Solaris
/rbconfig.sedscript.mod
; \
85 $(GSED
) -i
-f Solaris
/ruby
.1.sedscript.mod \
86 $(PROTORUBYDIR
)/share
/man
/man1
/ruby
.1 ; \
87 /usr
/bin
/sed
-f Solaris
/rbconfig.sedscript.mod \
88 $(PROTO_RBCONFIG_FILE
) > rbconfig.rb.mod
; \
89 $(MV
) rbconfig.rb.mod
$(PROTO_RBCONFIG_FILE
) ;
91 COMPONENT_POST_INSTALL_ACTION
+= \
92 encdir
="$(PROTORUBYDIR)/lib/ruby/$(RUBY_LIB_VER)/x86_64-solaris$(SOLARIS_VERSION)/enc"; \
93 filelist
=`ls -1I trans $$encdir`; \
94 subdirlist
=`ls -1 $$encdir/trans`; \
95 for f in
$$filelist; \
97 /usr
/bin
/elfedit
-e
'dyn:runpath "$(USRDIR)/$(COMPONENT_NAME)/$(RUBY_VER)/lib/$(MACH64)"' $$encdir/$$f; \
99 for f in
$$subdirlist; \
101 /usr
/bin
/elfedit
-e
'dyn:runpath "$(USRDIR)/$(COMPONENT_NAME)/$(RUBY_VER)/lib/$(MACH64)"' $$encdir/trans
/$$f; \
104 # Set the locale to generate documentation correctly
105 COMPONENT_BUILD_ENV
+= LC_ALL
=en_US.UTF-8
106 COMPONENT_INSTALL_ENV
+= LC_ALL
=en_US.UTF-8
108 CONFIGURE_PREFIX
= $(USRDIR
)/$(COMPONENT_NAME
)/$(RUBY_VER
)
110 CONFIGURE_OPTIONS
+= --with-rubylibprefix
=$(CONFIGURE_LIBDIR
.32)/ruby
111 CONFIGURE_OPTIONS
+= --enable-shared
112 CONFIGURE_OPTIONS
+= --enable-rpath
113 CONFIGURE_OPTIONS
+= --enable-dtrace
115 #CONFIGURE_OPTIONS += --enable-yjit
116 CONFIGURE_OPTIONS
+= --enable-debug-env
117 CONFIGURE_OPTIONS
+= --with-thread
=pthread
118 CONFIGURE_OPTIONS
+= --with-rdoc
=ri
,html
119 CONFIGURE_OPTIONS
+= --with-ruby-version
=$(RUBY_VER
)
120 # Don't need docs for ruby C source files
121 CONFIGURE_OPTIONS
+= --disable-install-capi
122 CONFIGURE_OPTIONS
+= --disable-option-checking
123 CONFIGURE_OPTIONS
+= --with-openssl-dir
=$(OPENSSL_PREFIX
)
124 CONFIGURE_OPTIONS
+= CFLAGS
="$(CFLAGS)"
126 CLEAN_PATHS
+= Solaris
/gem
.1 Solaris
/rbconfig.sedscript.mod \
127 Solaris
/ruby
.1.sedscript.mod
129 COMPONENT_TEST_TRANSFORMS
+= \
131 '-e "s/Finished tests in .*s, .* tests\/s, .* assertions/Finished tests in Xs, X tests\/s, X assertions/"' \
132 '-e "s/\(.*\) tests, .* assertions, \(.*\) failures, \(.*\) errors, .* skips/\1 tests, X assertions, \2 failures, \3 errors, X skips/"' \
135 '-e "/test succeeded/p"' \
136 '-e "/Running tests/p"' \
137 '-e "/Finished tests in Xs, X tests\/s, X assertions/p"' \
138 '-e "/.* tests, X assertions, .* failures, .* errors, X skips/p"'
140 # Auto-generated dependencies
141 REQUIRED_PACKAGES
+= SUNWcs
142 REQUIRED_PACKAGES
+= library
/gmp
143 REQUIRED_PACKAGES
+= library
/libffi
144 REQUIRED_PACKAGES
+= library
/libyaml
145 REQUIRED_PACKAGES
+= library
/readline
146 REQUIRED_PACKAGES
+= library
/security
/openssl-31
147 REQUIRED_PACKAGES
+= library
/zlib
148 REQUIRED_PACKAGES
+= system
/library
149 REQUIRED_PACKAGES
+= system
/library
/math