Makefile 2.3 KB

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