Makefile 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. # $OpenBSD: Makefile,v 1.36 2017/05/31 08:08:16 espie Exp $
  2. USE_WXNEEDED = Yes
  3. PORTROACH_COMMENT = hide pre-release versions (e.g. 6.1.90.900)
  4. PORTROACH = limit:!.*\.[0-9][0-9][0-9]-src-builtpkgs$$
  5. ONLY_FOR_ARCHS = arm amd64 i386 powerpc sparc64
  6. COMMENT = multi-paradigm programming language
  7. V = 6.9
  8. PKGNAME = racket-minimal-$V
  9. DISTFILES = racket-minimal-$V-src-builtpkgs${EXTRACT_SUFX} \
  10. racket-openbsd-1${EXTRACT_SUFX}
  11. CATEGORIES = lang
  12. HOMEPAGE = http://racket-lang.org/
  13. MAINTAINER = Juan Francisco Cantero Hurtado <juanfra@openbsd.org>
  14. # LGPLv3
  15. PERMIT_PACKAGE_CDROM = Yes
  16. MASTER_SITES = https://mirror.racket-lang.org/installers/${V}/ \
  17. https://www.cs.utah.edu/plt/installers/${V}/ \
  18. http://www.eecs.northwestern.edu/racket/${V}/ \
  19. http://mirror.informatik.uni-tuebingen.de/mirror/racket/${V}/ \
  20. http://racket.infogroep.be/${V}/ \
  21. http://pre-release.racket-lang.org/installers/ \
  22. http://pre.racket-lang.org/release/installers/ \
  23. http://pre.racket-lang.org/installers/ \
  24. https://www.cs.utah.edu/plt/snapshots/current/installers/ \
  25. http://plt.eecs.northwestern.edu/snapshots/current/installers/ \
  26. http://download.tuxfamily.org/jod/lang/racket/ \
  27. ftp://download.tuxfamily.org/jod/lang/racket/
  28. EXTRACT_SUFX = .tgz
  29. # GCC4 is only needed by the TLS flavor. "places" and "futures" only work
  30. # correctly on amd64 for this version.
  31. COMPILER = gcc
  32. COMPILER_LANGS = c
  33. MODGCC4_ARCHS = arm amd64
  34. LIB_DEPENDS = converters/libiconv \
  35. databases/sqlite3 \
  36. devel/libffi>=3.0.9p2
  37. WANTLIB += c ffi iconv m pthread
  38. # Loaded using FFI
  39. WANTLIB += sqlite3
  40. WRKDIST = ${WRKDIR}/racket-$V
  41. WRKSRC = ${WRKDIST}/src
  42. # The tests are installed from raco as a package
  43. NO_TEST = Yes
  44. SEPARATE_BUILD = Yes
  45. CONFIGURE_STYLE = gnu
  46. CONFIGURE_ARGS += --enable-libffi \
  47. --enable-gracket \
  48. --enable-foreign \
  49. --enable-lt=${LIBTOOL}
  50. # - "backtrace" is expensive.
  51. # http://article.gmane.org/gmane.comp.lang.racket.devel/6700
  52. # - disable "docs" to reduce the number of deps and the build time
  53. # - The installation of shared libraries is not recommended.
  54. CONFIGURE_ARGS += --disable-backtrace \
  55. --disable-docs \
  56. --disable-libs \
  57. --disable-shared
  58. CONFIGURE_ENV = LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib -Wl,-z,wxneeded" \
  59. CPPFLAGS="-I${LOCALBASE}/include -I${X11BASE}/include"
  60. FLAVORS = debug no_jit
  61. FLAVOR ?=
  62. .if ${FLAVOR:Mdebug}
  63. CONFIGURE_ARGS += --disable-strip \
  64. --enable-noopt
  65. CFLAGS += -ggdb3
  66. .endif
  67. # - "places" and "futures" require thread-local storage, atomic CAS and JIT
  68. # http://article.gmane.org/gmane.comp.lang.racket.user/16723
  69. # - Using gcc4 to enable "places". It broke Racket in the past.
  70. # - The JIT doesn't work on powerpc when TLS is enabled. "places" and
  71. # "futures" don't work on arm and powerpc.
  72. # https://github.com/racket/racket/issues/1239
  73. # - Racket builds fine with -O2 (and -O1 and -Os) on powerpc but
  74. # it doesn't pass the tests.
  75. .if ${FLAVOR:Mno_jit}
  76. ONLY_FOR_ARCHS = arm amd64 i386 powerpc
  77. CONFIGURE_ARGS += --disable-jit \
  78. --disable-places \
  79. --disable-futures
  80. .elif ${MACHINE_ARCH} == "amd64"
  81. CONFIGURE_ARGS += --enable-jit \
  82. --enable-places \
  83. --enable-futures
  84. .elif ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "i386"
  85. CONFIGURE_ARGS += --enable-jit \
  86. --disable-places \
  87. --disable-futures
  88. .elif ${MACHINE_ARCH} == "powerpc"
  89. CONFIGURE_ARGS += --enable-jit \
  90. --disable-places \
  91. --disable-futures
  92. CONFIGURE_ENV += CFLAGS="${CFLAGS} -O0 -Wall -Wno-unused-value" \
  93. CPPFLAGS="${CPPFLAGS} -O0 -Wall -Wno-unused-value"
  94. .else
  95. CONFIGURE_ARGS += --disable-jit \
  96. --disable-places \
  97. --disable-futures
  98. .endif
  99. post-install:
  100. @find ${PREFIX} -type f -name '*.orig' -exec rm -f {} \;
  101. @perl -i -pe 's/installation-name . "snapshot"/installation-name . "$V"/g' ${WRKINST}/etc/racket/config.rktd
  102. @mv ${WRKINST}/etc/racket ${PREFIX}/share/examples
  103. @cp ${WRKDIR}/racket-openbsd/racket-user-bin-paths ${PREFIX}/bin
  104. # Since 5.3.4 if __SSE_MATH__ is defined (C_COMPILER_USES_SSE) and
  105. # MZ_TRY_EXTFLONUMS enabled, MZ_LONG_DOUBLE (extflonum) is turned on. Also
  106. # C_COMPILER_USES_SSE turn on MZ_USE_JIT_SSE.
  107. # "-msse -mfpmath=sse" required by extflonum on i386.
  108. # The GNU Lightning minimum requirement for i386 is SSE2.
  109. .if ${FLAVOR:Mno_jit} && ${MACHINE_ARCH} == "i386"
  110. CONFIGURE_ARGS += --disable-extflonum
  111. .elif ${MACHINE_ARCH} == "i386"
  112. # There is a bug which only happens when extflonum is enabled on i386.
  113. # By default the build system of Racket uses "cc" as the preprocessor but
  114. # doesn't pass the CFLAGS, so it doesn't define __SSE_MATH__ which is
  115. # used to detect MZ_LONG_DOUBLE. If enable-extflonum is used and the
  116. # build system can't use MZ_LONG_DOUBLE, then the build fails with the error:
  117. # "cannot support extflonums; you may need to adjust compiler options"
  118. # The easiest workaround is to pass the CFLAGS also as CPPFLAGS.
  119. CONFIGURE_ENV += CFLAGS="${CFLAGS} -msse -msse2 -mfpmath=sse" \
  120. CPPFLAGS="${CPPFLAGS} -msse -msse2 -mfpmath=sse"
  121. CONFIGURE_ARGS += --enable-extflonum
  122. .endif
  123. .include <bsd.port.mk>