Skip to content

Commit

Permalink
lang/ruby3[1-3]: Refine ports
Browse files Browse the repository at this point in the history
* Skip extracting unnecessary files by setting EXTRACT_AFTER_ARGS
  instead of removing them with post-patch target after they are
  extracted.
* Use 'USES=localbase' to set path of header and library files.

PR:		278764
  • Loading branch information
Daniel Engberg authored and Yasuhiro Kimura committed May 14, 2024
1 parent 2122fe1 commit 84f001c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 30 deletions.
22 changes: 12 additions & 10 deletions lang/ruby31/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,22 @@ BUILD_DEPENDS= libffi>=0:devel/libffi
LIB_DEPENDS= libyaml.so:textproc/libyaml
RUN_DEPENDS= libffi>=0:devel/libffi

USES= autoreconf cpe ruby:none ssl tar:xz
USES= autoreconf cpe localbase ruby:none ssl tar:xz
CPE_VENDOR= ruby-lang
CPE_VERSION= ${RUBY_RELVERSION}
CPE_UPDATE= p${RUBY_PATCHLEVEL}
USE_LDCONFIG= yes

# We get these from other ports
EXTRACT_AFTER_ARGS= --exclude ${DISTNAME}/bin/gem \
--exclude ${DISTNAME}/ext/win32* \
--exclude ${DISTNAME}/lib/bundler* \
--exclude ${DISTNAME}/libexec/bundler \
--exclude ${DISTNAME}/man/erb.1 \
--exclude ${DISTNAME}/man/irb.1 \
--exclude ${DISTNAME}/man/ri.1 \
--no-same-owner --no-same-permissions

GNU_CONFIGURE= yes
CONFIGURE_ARGS= ${RUBY_CONFIGURE_ARGS} \
--disable-rpath \
Expand All @@ -40,9 +50,8 @@ CONFIGURE_ARGS= ${RUBY_CONFIGURE_ARGS} \
--with-vendordir="${PREFIX}/lib/ruby/vendor_ruby"
CONFIGURE_ENV= debugflags=

CPPFLAGS+= -I${LOCALBASE}/include
# Keep this, else ruby will fail to load libraries dependent of libpthread.
LIBS+= -lpthread -L${LOCALBASE}/lib
LIBS+= -lpthread
WRKSRC= ${RUBY_WRKSRC}

RUBY_VER= 3.1
Expand Down Expand Up @@ -124,13 +133,6 @@ RB_SET_CONF_VAR= ${SH} -c \
'${REINPLACE_CMD} -E -e "s,(CONFIG\[\"$$0\"\][[:space:]]*=[[:space:]]*)(\(?)(.*)(\)?),\1\2$$1\4," ${WRKSRC}/rbconfig.rb' \
--

post-patch:
# We get these from other ports
.for d in bin/* ext/dbm ext/gdbm ext/win32* lib/bundler* libexec/bundler* \
man/bundle* man/erb.1 man/gemfile* man/irb.1 man/ri.1
@${RM} -r ${BUILD_WRKSRC}/${d}
.endfor

post-build:
#
# Hack to allow modules to be installed into separate PREFIX and/or under user
Expand Down
22 changes: 12 additions & 10 deletions lang/ruby32/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,22 @@ BUILD_DEPENDS= libffi>=0:devel/libffi
LIB_DEPENDS= libyaml.so:textproc/libyaml
RUN_DEPENDS= libffi>=0:devel/libffi

USES= autoreconf cpe ruby:none ssl tar:xz
USES= autoreconf cpe localbase ruby:none ssl tar:xz
CPE_VENDOR= ruby-lang
CPE_VERSION= ${RUBY_RELVERSION}
CPE_UPDATE= p${RUBY_PATCHLEVEL}
USE_LDCONFIG= yes

# We get these from other ports
EXTRACT_AFTER_ARGS= --exclude ${DISTNAME}/bin/gem \
--exclude ${DISTNAME}/ext/win32* \
--exclude ${DISTNAME}/lib/bundler* \
--exclude ${DISTNAME}/libexec/bundler \
--exclude ${DISTNAME}/man/erb.1 \
--exclude ${DISTNAME}/man/irb.1 \
--exclude ${DISTNAME}/man/ri.1 \
--no-same-owner --no-same-permissions

GNU_CONFIGURE= yes
CONFIGURE_ARGS= ${RUBY_CONFIGURE_ARGS} \
--disable-rpath \
Expand All @@ -36,9 +46,8 @@ CONFIGURE_ARGS= ${RUBY_CONFIGURE_ARGS} \
--with-vendordir="${PREFIX}/lib/ruby/vendor_ruby"
CONFIGURE_ENV= debugflags=

CPPFLAGS+= -I${LOCALBASE}/include
# Keep this, else ruby will fail to load libraries dependent of libpthread.
LIBS+= -lpthread -L${LOCALBASE}/lib
LIBS+= -lpthread
WRKSRC= ${RUBY_WRKSRC}

RUBY_VER= 3.2
Expand Down Expand Up @@ -123,13 +132,6 @@ RB_SET_CONF_VAR= ${SH} -c \
'${REINPLACE_CMD} -E -e "s,(CONFIG\[\"$$0\"\][[:space:]]*=[[:space:]]*)(\(?)(.*)(\)?),\1\2$$1\4," ${WRKSRC}/rbconfig.rb' \
--

post-patch:
# We get these from other ports
.for d in bin/* ext/dbm ext/gdbm ext/win32* lib/bundler* libexec/bundler* \
man/bundle* man/erb.1 man/gemfile* man/irb.1 man/ri.1
@${RM} -r ${BUILD_WRKSRC}/${d}
.endfor

post-build:
#
# Hack to allow modules to be installed into separate PREFIX and/or under user
Expand Down
22 changes: 12 additions & 10 deletions lang/ruby33/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,22 @@ BUILD_DEPENDS= libffi>=0:devel/libffi
LIB_DEPENDS= libyaml.so:textproc/libyaml
RUN_DEPENDS= libffi>=0:devel/libffi

USES= autoreconf cpe ruby:none ssl tar:xz
USES= autoreconf cpe localbase ruby:none ssl tar:xz
CPE_VENDOR= ruby-lang
CPE_VERSION= ${RUBY_RELVERSION}
CPE_UPDATE= p${RUBY_PATCHLEVEL}
USE_LDCONFIG= yes

# We get these from other ports
EXTRACT_AFTER_ARGS= --exclude ${DISTNAME}/bin/gem \
--exclude ${DISTNAME}/ext/win32* \
--exclude ${DISTNAME}/lib/bundler* \
--exclude ${DISTNAME}/libexec/bundler \
--exclude ${DISTNAME}/man/erb.1 \
--exclude ${DISTNAME}/man/irb.1 \
--exclude ${DISTNAME}/man/ri.1 \
--no-same-owner --no-same-permissions

GNU_CONFIGURE= yes
CONFIGURE_ARGS= ${RUBY_CONFIGURE_ARGS} \
--disable-rpath \
Expand All @@ -37,9 +47,8 @@ CONFIGURE_ARGS= ${RUBY_CONFIGURE_ARGS} \
--with-vendordir="${PREFIX}/lib/ruby/vendor_ruby"
CONFIGURE_ENV= debugflags=

CPPFLAGS+= -I${LOCALBASE}/include
# Keep this, else ruby will fail to load libraries dependent of libpthread.
LIBS+= -lpthread -L${LOCALBASE}/lib
LIBS+= -lpthread
WRKSRC= ${RUBY_WRKSRC}

RUBY_VER= 3.3
Expand Down Expand Up @@ -115,13 +124,6 @@ RB_SET_CONF_VAR= ${SH} -c \
post-extract-DOCS-on:
${MV} ${WRKSRC}/ChangeLog ${WRKSRC}/doc/ChangeLog

post-patch:
# We get these from other ports
.for d in bin/* ext/dbm ext/gdbm ext/win32* lib/bundler* libexec/bundler* \
man/bundle* man/erb.1 man/gemfile* man/irb.1 man/ri.1
@${RM} -r ${BUILD_WRKSRC}/${d}
.endfor

post-build:
#
# Hack to allow modules to be installed into separate PREFIX and/or under user
Expand Down

0 comments on commit 84f001c

Please sign in to comment.