Annotation of pkgsrc/lang/ruby/modules.mk, revision 1.26

1.26    ! rillig      1: # $NetBSD: modules.mk,v 1.25 2009/02/15 03:20:03 taca Exp $
1.1       taca        2: 
                      3: .if !defined(_RUBY_MODULE_MK)
                      4: _RUBY_MODULE_MK=       # defined
                      5: 
                      6: .include "../../lang/ruby/rubyversion.mk"
1.7       minskim     7: 
                      8: .if defined(NO_BUILD) && empty(NO_BUILD:M[Nn][Oo])
                      9: DEPENDS+= ruby${RUBY_VER}-base>=${RUBY_REQD}:../../lang/ruby${RUBY_VER}-base
                     10: .else
1.1       taca       11: .include "../../lang/ruby/buildlink3.mk"
1.7       minskim    12: .endif
1.1       taca       13: 
1.13      rillig     14: CONFIGURE_ENV+=                RUBY=${RUBY:Q} RDOC=${RDOC:Q}
1.1       taca       15: 
                     16: #
                     17: # extconf.rb support
                     18: #
1.24      taca       19: # USE_RUBY_EXTCONF     Use extconf script.
                     20: #
1.1       taca       21: # RUBY_EXTCONF         specify extconf script name (default: extconf.rb).
                     22: # RUBY_EXTCONF_CHECK   make sure to check existence of Makefile after
                     23: #                      executing extconf script (default: yes).
                     24: # RUBY_EXTCONF_MAKEFILE        name of Makefile checked by RUBY_EXTCONF_CHECK
                     25: #                      (default: Makefile)
                     26: #
                     27: .if defined(USE_RUBY_EXTCONF) && empty(USE_RUBY_EXTCONF:M[nN][oO])
                     28: 
                     29: RUBY_EXTCONF?=         extconf.rb
                     30: INSTALL_TARGET?=       site-install
1.23      taca       31: CONFIGURE_ARGS+=       ${RUBY_EXTCONF_ARGS}
                     32: RUBY_EXTCONF_ARGS?=    --with-opt-dir=${PREFIX:Q} --vendor
1.1       taca       33: RUBY_EXTCONF_CHECK?=   yes
                     34: RUBY_EXTCONF_MAKEFILE?=        Makefile
                     35: 
                     36: do-configure:  ruby-extconf-configure
                     37: 
                     38: .if defined(RUBY_EXTCONF_SUBDIRS)
                     39: ruby-extconf-configure:
                     40: .for d in ${RUBY_EXTCONF_SUBDIRS}
                     41:        @${ECHO_MSG} "===>  Running ${RUBY_EXTCONF} in ${d} to configure"
1.26    ! rillig     42:        ${RUN}cd ${WRKSRC}/${d}; \
1.1       taca       43:        ${SETENV} ${CONFIGURE_ENV} ${RUBY} ${RUBY_EXTCONF} ${CONFIGURE_ARGS}
                     44: .if empty(RUBY_EXTCONF_CHECK:M[nN][oO])
1.26    ! rillig     45:        ${RUN}cd ${WRKSRC}/${d}; \
1.1       taca       46:                ${TEST} -f ${RUBY_EXTCONF_MAKEFILE}
                     47: .endif
                     48: .endfor
                     49: 
                     50: .if !target(do-build)
                     51: do-build:      ruby-extconf-build
                     52: 
                     53: ruby-extconf-build:
                     54: .for d in ${RUBY_EXTCONF_SUBDIRS}
                     55:        @${ECHO_MSG} "===>  Building ${d}"
1.26    ! rillig     56:        ${RUN}cd ${WRKSRC}/${d}; ${SETENV} ${MAKE_ENV} ${MAKE} ${BUILD_TARGET}
1.1       taca       57: .endfor
                     58: .endif
                     59: 
                     60: .if !target(do-install)
                     61: do-install:    ruby-extconf-install
                     62: 
                     63: ruby-extconf-install:
                     64: .for d in ${RUBY_EXTCONF_SUBDIRS}
                     65:        @${ECHO_MSG} "===>  Installing ${d}"
1.26    ! rillig     66:        ${RUN}cd ${WRKSRC}/${d}; ${SETENV} ${INSTALL_ENV} ${MAKE_ENV} ${MAKE} ${INSTALL_TARGET}
1.1       taca       67: .endfor
                     68: .endif
                     69: 
                     70: .else
                     71: ruby-extconf-configure:
                     72:        @${ECHO_MSG} "===>  Running ${RUBY_EXTCONF} to configure"
1.26    ! rillig     73:        ${RUN}cd ${WRKSRC}; \
1.1       taca       74:        ${SETENV} ${CONFIGURE_ENV} ${RUBY} ${RUBY_EXTCONF} ${CONFIGURE_ARGS}
                     75: .if empty(RUBY_EXTCONF_CHECK:M[nN][oO])
1.26    ! rillig     76:        ${RUN}cd ${WRKSRC}/${d}; \
1.1       taca       77:                ${TEST} -f ${RUBY_EXTCONF_MAKEFILE}
                     78: .endif
                     79: .endif
                     80: 
                     81: #
                     82: # setup.rb support
                     83: #
1.24      taca       84: # USE_RUBY_SETUP       Uset setup script.
                     85: # USE_RUBY_SETUP_PKG   Use pkgsrc's ruby-setup package.
                     86: #
1.1       taca       87: # RUBY_SETUP           specify setup script name (default: setup.rb).
                     88: #
                     89: .elif defined(USE_RUBY_SETUP) && empty(USE_RUBY_SETUP:M[nN][oO])
                     90: 
                     91: RUBY_SETUP?=           setup.rb
                     92: 
1.24      taca       93: .if defined(USE_RUBY_SETUP_PKG) && empty(USE_RUBY_SETUP_PKG:M[nN][oO])
                     94: BUILD_DEPENDS+=                ${RUBY_PKGPREFIX}-setup>=3.4.0:../../devel/ruby-setup
                     95: .endif
                     96: 
1.1       taca       97: .if !target(do-configure)
                     98: do-configure:  ruby-setup-configure
                     99: 
                    100: ruby-setup-configure:
1.24      taca      101: .if defined(USE_RUBY_SETUP_PKG) && empty(USE_RUBY_SETUP_PKG:M[nN][oO])
1.25      taca      102:        @${ECHO_MSG} "===>  Use pkgsrc's ruby-setup"
1.26    ! rillig    103:        ${RUN}cd ${WRKSRC}; \
1.24      taca      104:                ${CP} ${PREFIX}/${RUBY_VENDORLIB}/setup.rb ${RUBY_SETUP}
                    105: .endif
1.1       taca      106:        @${ECHO_MSG} "===>  Running ${RUBY_SETUP} to configure"
1.26    ! rillig    107:        ${RUN}cd ${WRKSRC}; \
1.1       taca      108:        ${SETENV} ${CONFIGURE_ENV} ${RUBY} ${RUBY_SETUP} config ${CONFIGURE_ARGS}
                    109: .endif
                    110: 
                    111: .if !target(do-build)
                    112: do-build:      ruby-setup-build
                    113: 
                    114: ruby-setup-build:
                    115:        @${ECHO_MSG} "===>  Running ${RUBY_SETUP} to build"
1.26    ! rillig    116:        ${RUN}cd ${WRKSRC}; \
1.1       taca      117:        ${SETENV} ${MAKE_ENV} ${RUBY} ${RUBY_SETUP} setup
                    118: .endif
                    119: 
                    120: .if !target(do-install)
                    121: do-install:    ruby-setup-install
                    122: 
1.18      obache    123: _RUBY_SETUP_INSTALLARGS=   ${INSTALL_TARGET}
                    124: .if ${_USE_DESTDIR} != "no"
1.21      jlam      125: _RUBY_SETUP_INSTALLARGS+=   --prefix=${DESTDIR:Q}
1.18      obache    126: .endif
                    127: 
1.1       taca      128: ruby-setup-install:
                    129:        @${ECHO_MSG} "===>  Running ${RUBY_SETUP} to ${INSTALL_TARGET}"
1.26    ! rillig    130:        ${RUN}cd ${WRKSRC}; \
1.22      jlam      131:        ${SETENV} ${INSTALL_ENV} ${MAKE_ENV} ${RUBY} ${RUBY_SETUP} ${_RUBY_SETUP_INSTALLARGS}
1.1       taca      132: .endif
                    133: 
                    134: #
                    135: # install.rb support
                    136: #
                    137: # USE_RUBY_INSTALL     use simple install.rb script to install
                    138: #                      (default: undefined)
                    139: # RUBY_SIMPLE_INSTALL  name of simple install.rb script (default: install.rb)
                    140: #
                    141: .elif defined(USE_RUBY_INSTALL) && empty(USE_RUBY_INSTALL:M[nN][oO])
                    142: 
                    143: RUBY_SIMPLE_INSTALL?=  install.rb
                    144: INSTALL_TARGET?=       # empty
                    145: 
1.23      taca      146: SUBST_CLASSES+=                rinstall
                    147: SUBST_STAGE.rinstall=  pre-install
                    148: SUBST_FILES.rinstall=  ${RUBY_SIMPLE_INSTALL}
                    149: SUBST_SED.rinstall=    -e "s|'sitedir'|'vendordir'|g"
                    150: SUBST_SED.rinstall+=   -e "s|'sitelibdir'|'vendorlibdir'|g"
                    151: SUBST_SED.rinstall+=   -e 's|"sitelibdir"|"vendorlibdir"|g'
                    152: SUBST_SED.rinstall+=   -e 's|/site_ruby/|/vendor_ruby/|g'
                    153: SUBST_MESSAGE.rinstall=        Fixing ${RUBY_SIMPLE_INSTALL} files.
                    154: 
1.1       taca      155: .if !target(do-install)
                    156: do-install:    ruby-simple-install
                    157: 
                    158: ruby-simple-install:
                    159:        @${ECHO_MSG} "===>  Running ${RUBY_SIMPLE_INSTALL} to ${INSTALL_TARGET}"
1.26    ! rillig    160:        ${RUN}cd ${WRKSRC}; \
1.22      jlam      161:        ${SETENV} ${INSTALL_ENV} ${MAKE_ENV} ${RUBY} ${RUBY_SIMPLE_INSTALL} ${INSTALL_TARGET}
1.1       taca      162: .endif
                    163: .endif # USE_RUBY_INSTALL
                    164: 
                    165: .include "replace.mk"
                    166: 
1.23      taca      167: PRINT_PLIST_AWK+=      /^@dirrm ${RUBY_SITEARCHLIB:S|/|\\/|g}$$/ \
1.17      minskim   168:                        { next; }
1.23      taca      169: PRINT_PLIST_AWK+=      /^@dirrm ${RUBY_SITELIB:S|/|\\/|g}$$/ \
1.8       minskim   170:                        { next; }
1.23      taca      171: PRINT_PLIST_AWK+=      /^@dirrm ${RUBY_VENDORARCHLIB:S|/|\\/|g}$$/ \
1.9       minskim   172:                        { next; }
1.23      taca      173: PRINT_PLIST_AWK+=      /^@dirrm ${RUBY_VENDORLIB:S|/|\\/|g}$$/ \
1.9       minskim   174:                        { next; }
1.8       minskim   175: 
1.1       taca      176: .endif

CVSweb <webmaster@jp.NetBSD.org>