Makefile 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. # $OpenBSD: Makefile,v 1.63 2017/04/10 11:46:22 sthen Exp $
  2. # Runtime failures on i386 in IO#pos and IO#rewind
  3. ONLY_FOR_ARCHS = amd64
  4. COMMENT = pure-Java implementation of the Ruby language
  5. V = 9.1.8.0
  6. DISTNAME = jruby-bin-${V}
  7. PKGNAME = jruby-${V}
  8. CATEGORIES = lang lang/ruby
  9. DISTFILES = ${DISTNAME}.tar.gz \
  10. jnr-jffi-1.2.2-0-g4c196bb.tar.gz:0 \
  11. ${JRUBY_LAUNCHER_GEM}:1
  12. HOMEPAGE = http://www.jruby.org/
  13. MAINTAINER = Jeremy Evans <jeremy@openbsd.org>
  14. # EPLv1/GPLv2/LGPLv2.1/Ruby/MIT/BSD/Apache/CPL
  15. PERMIT_PACKAGE_CDROM = Yes
  16. MASTER_SITES = http://jruby.org.s3.amazonaws.com/downloads/${V}/
  17. MASTER_SITES0 = http://www.distfiles.nl/
  18. MASTER_SITES1 = ${MASTER_SITE_RUBYGEMS}
  19. MODULES = java
  20. MODJAVA_VER = 1.8+
  21. MODJAVA_JRERUN = Yes
  22. USE_GMAKE = Yes
  23. WANTLIB = c m pthread ${LIBCXX}
  24. BUILD_DEPENDS = devel/apache-ant \
  25. shells/bash \
  26. ${RUN_DEPENDS}
  27. RUN_DEPENDS = java/javaPathHelper
  28. MAKE_ENV = JAVA_HOME=${JAVA_HOME} MAKE=${MAKE_PROGRAM}
  29. JRUBY_HOME = ${PREFIX}/jruby
  30. WRKDIST = ${WRKDIR}/jruby-${V}
  31. ANT_CMD = ${SETENV} ${MAKE_ENV} PATH=${JAVA_HOME}/bin:${PATH} \
  32. ${LOCALBASE}/bin/ant
  33. JFFI_HOME = ${WRKDIST}/jffi
  34. JFFI_ARCH = ${MACHINE_ARCH:S/amd64/x86_64/}-OpenBSD
  35. FFI_ARCH = ${JFFI_ARCH:L}
  36. JRUBY_LAUNCHER_GEM = jruby-launcher-1.1.1-java.gem
  37. SUBST_VARS = JRUBY_HOME JFFI_ARCH FFI_ARCH RAKE_V RDOC_V JAVA_HOME
  38. post-extract:
  39. mv ${WRKDIR}/jnr-jffi* ${JFFI_HOME}
  40. # Unpack the jruby-launcher gem, since it needs to be patched
  41. cd ${WRKSRC} && mkdir jruby-launcher \
  42. && cd jruby-launcher && tar zxf ../../data.tar.gz \
  43. && rm -f ../../data.tar.gz
  44. cp ${WRKSRC}/lib/ruby/gems/shared/gems/*/bin/* ${WRKSRC}/bin/
  45. do-configure:
  46. ${SUBST_CMD} ${WRKSRC}/jruby-launcher/jrubyexe.cpp \
  47. ${WRKSRC}/jruby-launcher/unixlauncher.cpp
  48. cd ${WRKSRC}/jruby-launcher/ && ${SET_ENV} ${MAKE_ENV} \
  49. ../bin/jruby extconf.rb
  50. perl -pi -e '$$. == 1 && s|^.*env j?ruby.*$$|\#!${LOCALBASE}/bin/jruby|;' \
  51. -e '$$. == 1 && s|^.*bin/j?ruby.*$$|\#!${LOCALBASE}/bin/jruby|;' \
  52. -e 'close ARGV if eof;' ${WRKSRC}/bin/!(*.*)
  53. do-build:
  54. cd ${JFFI_HOME} && ${ANT_CMD} jar
  55. rm -rf ${WRKSRC}/lib/jni
  56. mkdir -p ${WRKSRC}/lib/jni/${JFFI_ARCH}
  57. cp ${JFFI_HOME}/build/jni/libjffi-1.2.so \
  58. ${WRKSRC}/lib/jni/${JFFI_ARCH}
  59. cd ${WRKSRC}/lib/ruby/stdlib/ffi/platform && \
  60. rm -r !(${FFI_ARCH}|*.ffi)
  61. cd ${WRKSRC}/jruby-launcher/ && gmake && mv jruby ../bin
  62. do-install:
  63. ln -s ${TRUEPREFIX}/jruby/bin/jruby ${PREFIX}/bin/jruby
  64. ${INSTALL_DATA_DIR} ${JRUBY_HOME}
  65. ${INSTALL_DATA_DIR} ${JRUBY_HOME}/bin
  66. for file in ast gem jgem jirb jirb_swing jruby rake rdoc ri testrb; \
  67. do ${INSTALL_SCRIPT} ${WRKBUILD}/bin/$$file ${JRUBY_HOME}/bin/$$file; \
  68. done
  69. ${INSTALL_DATA_DIR} ${JRUBY_HOME}/lib
  70. cd ${WRKBUILD}/lib && tar -cf - * | \
  71. tar -C ${JRUBY_HOME}/lib -xf -
  72. mkdir -p ${JRUBY_HOME}/lib/ruby/{1.8,1.9,2.0}/site_ruby
  73. find ${JRUBY_HOME}/lib -name '*.orig' -print0 | xargs -0r rm
  74. find ${JRUBY_HOME}/lib -name '*.beforesubst' -print0 | xargs -0r rm
  75. mv ${JRUBY_HOME}/lib/ruby/gems/{shared,1.8}
  76. ln -s 1.8 ${JRUBY_HOME}/lib/ruby/gems/shared
  77. chown -R ${SHAREOWN}:${SHAREGRP} ${JRUBY_HOME}/lib
  78. # JRuby doesn't ship tests in the binary distribution
  79. # Try running the database/ruby-sequel,jruby tests after an update
  80. NO_TEST = Yes
  81. .include <bsd.port.mk>