Makefile 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # $OpenBSD: Makefile,v 1.15 2017/03/02 12:19:22 pascal Exp $
  2. ONLY_FOR_ARCHS = amd64 i386
  3. COMMENT = open source compiler for Pascal/Object Pascal
  4. V = 3.0.2
  5. DISTNAME = fpcbuild-${V}
  6. PKGNAME = fpc-${V}
  7. BOOT_GEN = 0
  8. CATEGORIES = lang
  9. HOMEPAGE = http://www.freepascal.org/
  10. MAINTAINER = Pascal Stumpf <pascal@stumpf.co>
  11. # compiler: GPLv2+, packages/rtl: modified LGPLv2
  12. PERMIT_PACKAGE_CDROM = Yes
  13. WANTLIB += c iconv pthread
  14. LIB_DEPENDS = converters/libiconv
  15. MASTER_SITES = ${MASTER_SITE_SOURCEFORGE:=freepascal/}
  16. MASTER_SITES0 = https://distfiles.stumpf.co/
  17. DIST_SUBDIR = fpc
  18. BOOTSTRAP = fpcboot-openbsd-$V-${BOOT_GEN}${EXTRACT_SUFX}
  19. DISTFILES = ${DISTNAME}${EXTRACT_SUFX} ${BOOTSTRAP}:0
  20. .if ${MACHINE_ARCH} == "amd64"
  21. COMPNAME = ppcx64
  22. CONFIG = x86_64-openbsd
  23. PKG_ARGS += -Damd64=1
  24. PKG_ARGS += -Di386=0
  25. .else
  26. COMPNAME = ppc386
  27. CONFIG = i386-openbsd
  28. PKG_ARGS += -Di386=1
  29. PKG_ARGS += -Damd64=0
  30. .endif
  31. SUBST_VARS += V CONFIG
  32. TEST_DEPENDS = devel/nasm
  33. MAKE_FLAGS = NOGDB=1
  34. COMMON_ENV = MKDIRPROG=/bin/mkdir ECHO=/bin/echo \
  35. GINSTALL=/usr/bin/install DATE=/bin/date \
  36. TARPROG=/bin/tar
  37. MAKE_ENV = ${COMMON_ENV} FPC="${WRKDIR}/bin/${COMPNAME}"
  38. TEST_ENV = ${COMMON_ENV}
  39. FAKE_FLAGS = INSTALLEXE="${INSTALL_PROGRAM}" \
  40. MKDIR="${INSTALL_DATA_DIR}" \
  41. INSTALL="${INSTALL_DATA}"
  42. TEST_FLAGS = TEST_FPC="${WRKSRC}/fpcsrc/compiler/${COMPNAME}" \
  43. FPC="${WRKSRC}/fpcsrc/compiler/${COMPNAME}" \
  44. FPCOPT="-Fu${WRKSRC}/fpcsrc/rtl/units/${CONFIG}"
  45. USE_GMAKE = Yes
  46. post-patch:
  47. ${SUBST_CMD} ${WRKSRC}/fpcsrc/compiler/systems/t_bsd.pas
  48. post-install:
  49. cd ${PREFIX}/bin && ln -s ../lib/fpc/${V}/${COMPNAME} .
  50. chown -R ${SHAREOWN}:${SHAREGRP} ${PREFIX}/lib/fpc/lexyacc
  51. chmod ${DIRMODE} ${PREFIX}/lib/fpc/lexyacc/
  52. chmod ${SHAREMODE} ${PREFIX}/lib/fpc/lexyacc/*
  53. chown -R ${SHAREOWN}:${SHAREGRP} ${PREFIX}/share/doc/fpc-${V}/fpc
  54. chmod ${DIRMODE} ${PREFIX}/share/doc/fpc-${V}/fpc/
  55. chmod ${SHAREMODE} ${PREFIX}/share/doc/fpc-${V}/fpc/*
  56. ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/fpc-$V
  57. # generate sample config file
  58. ${PREFIX}/bin/fpcmkcfg -d "basepath=${TRUEPREFIX}/lib/fpc/$V" \
  59. -o ${PREFIX}/share/examples/fpc-$V/fpc.cfg.sample
  60. do-test:
  61. find ${WRKSRC} -name Package.fpc | xargs rm -f
  62. cd ${WRKSRC}/fpcsrc/tests && \
  63. env -i ${ALL_TEST_ENV} ${MAKE_PROGRAM} ${ALL_TEST_FLAGS} full
  64. .include <bsd.port.mk>