Makefile 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. # $OpenBSD: Makefile,v 1.44 2017/06/04 18:04:03 jsing Exp $
  2. ONLY_FOR_ARCHS = ${GO_ARCHS}
  3. COMMENT = Go programming language
  4. VERSION = 1.8.3
  5. REVISION = 0
  6. EXTRACT_SUFX = .src.tar.gz
  7. DISTNAME = go${VERSION}
  8. PKGNAME = go-${VERSION}
  9. PKGSPEC = go-=${VERSION}
  10. CATEGORIES = lang
  11. HOMEPAGE = https://golang.org/
  12. MAINTAINER = Joel Sing <jsing@openbsd.org>
  13. # software: BSD, documentation: CC-BY-3.0
  14. PERMIT_PACKAGE_CDROM = Yes
  15. WANTLIB = c pthread
  16. MASTER_SITES = https://golang.org/dl/
  17. BUILD_DEPENDS = lang/go-bootstrap shells/bash
  18. SEPARATE_BUILD = simple
  19. CONFIGURE_STYLE = None
  20. SUBST_VARS = GOCFG
  21. WRKDIST = ${WRKDIR}/go
  22. WRKSRC = ${WRKDIST}/src
  23. INSTALL_STRIP =
  24. GOOS = openbsd
  25. GOARCH = unknown
  26. GOROOT = ${PREFIX}/go
  27. GOROOT_BOOTSTRAP = ${PREFIX}/go/bootstrap
  28. .if ${MACHINE_ARCH} == "amd64"
  29. GOARCH = amd64
  30. .elif ${MACHINE_ARCH} == "i386"
  31. GOARCH = 386
  32. .endif
  33. GOCFG = /${GOOS}_${GOARCH}
  34. do-configure:
  35. . if ${GOARCH} == "unknown"
  36. @echo "Unable to determine GOARCH for ${MACHINE_ARCH}."
  37. @exit 1
  38. . endif
  39. do-build:
  40. @cd ${WRKSRC} && \
  41. CC="${CC}" \
  42. CXX="${CXX}" \
  43. GOROOT=${WRKDIST} \
  44. GOBIN=${WRKDIST}/bin \
  45. GOROOT_FINAL=${GOROOT} \
  46. GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP} \
  47. ./make.bash --no-banner
  48. do-test:
  49. @cd ${WRKSRC} && \
  50. ulimit -n 256 -d 2097152 && \
  51. PATH=${WRKDIST}/bin:${PATH} GOROOT=${WRKDIST} ./run.bash
  52. do-install:
  53. ${INSTALL_PROGRAM_DIR} ${GOROOT}
  54. ${INSTALL_PROGRAM_DIR} ${GOROOT}/bin
  55. ${INSTALL_PROGRAM} -p ${WRKDIST}/bin/go{,fmt} ${GOROOT}/bin
  56. @cd ${PREFIX}/bin && \
  57. ln -sf ../go/bin/go go
  58. @cd ${PREFIX}/bin && \
  59. ln -sf ../go/bin/gofmt gofmt
  60. @cd ${WRKDIST} && \
  61. find . -type f -maxdepth 1 \
  62. -exec ${INSTALL_DATA} -p {} \
  63. ${GOROOT} \;
  64. . for dir in api doc lib misc src pkg/include pkg/obj pkg/${GOCFG} test
  65. @cd ${WRKDIST} && \
  66. find ${dir} -type d \
  67. -exec ${INSTALL_DATA_DIR} \
  68. ${GOROOT}/{} \;
  69. @cd ${WRKDIST} && \
  70. find ${dir} ! -name \*.orig -type f \
  71. -exec ${INSTALL_DATA} -p {} \
  72. ${GOROOT}/{} \;
  73. . endfor
  74. ${INSTALL_PROGRAM_DIR} ${GOROOT}/pkg/tool/${GOOS}_${GOARCH}
  75. ${INSTALL_PROGRAM} -p ${WRKDIST}/pkg/tool/${GOOS}_${GOARCH}/* \
  76. ${GOROOT}/pkg/tool/${GOOS}_${GOARCH}
  77. .include <bsd.port.mk>