xenocara.port.mk 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. # $OpenBSD: xenocara.port.mk,v 1.7 2013/03/11 12:05:19 espie Exp $
  2. CATEGORIES = base xenocara
  3. COMMENT = Xenocara ${COMPONENT}
  4. FLAT = ${COMPONENT:S/\//./g:C/-([0-9])/_\1/g}
  5. VERSION ?= 2
  6. DISTNAME = xc-${FLAT}-${VERSION}
  7. DISTFILES =
  8. PERMIT_PACKAGE_CDROM= Yes
  9. LOCATION = ${PACKAGE_REPOSITORY}/${MACHINE_ARCH}/components
  10. REV = ${OSREV:S/.//}
  11. MAKE_FLAGS = XOBJDIR=${WRKDIR}/obj
  12. FAKE_FLAGS += RELEASEDIR=${LOCATION}
  13. SUBST_VARS += COMPONENT
  14. PKGDIR ?= ${PORTSDIR}/base/xenocara/pkg
  15. CFLAGS += -I${INCBASE}${X11BASE}/include
  16. CXXFLAGS += -I${INCBASE}${X11BASE}/include
  17. ALL_TARGET ?= depend all
  18. FAKE_TARGET ?= install
  19. XENOCARA_COMPONENT = Yes
  20. BUILD_DEPENDS = ${XDEPS:S,^,base/xenocara/,}
  21. RUN_DEPENDS = ${BUILD_DEPENDS}
  22. COMPONENT_TYPE ?=
  23. .if ${COMPONENT_TYPE:Mlib}
  24. PKG_ARGS += -DLIB=1
  25. .else
  26. PKG_ARGS += -DLIB=0
  27. .endif
  28. .if defined(FONTSDIRS) && !empty(FONTSDIRS)
  29. PKG_ARGS += -DFONT=1
  30. SUBST_VARS += FONTSDIRS
  31. .else
  32. PKG_ARGS += -DFONT=0
  33. .endif
  34. .if ${COMPONENT} != "share/mk"
  35. BUILD_DEPENDS += base/xenocara/share/mk
  36. .endif
  37. RUN_DEPENDS += base/bootstrap
  38. MANIFEST = ${PREFIX}/libdata/base/${FULLPKGNAME}.manifest
  39. XINCDIRS = GL/internal X11/ICE X11/PM X11/SM X11/Xaw X11/Xcursor \
  40. X11/Xft X11/Xmu X11/Xtrans X11/bitmaps X11/dri \
  41. X11/extensions X11/fonts X11/pixmaps fontconfig \
  42. freetype2/freetype/config \
  43. freetype2/freetype/internal/services pixman-1 xcb xorg
  44. INCBASE = ${WRKDIR}/incbase
  45. .if defined(XCVS_CO)
  46. WRKSRC ?= ${WRKDIR}/xenocara/${COMPONENT}
  47. . if !target(post-extract)
  48. post-extract:
  49. cd ${WRKDIR} && ${XCVS_CO} -P xenocara/${COMPONENT} ${EXTRA_SRC}
  50. . endif
  51. .else
  52. WRKSRC ?= ${XSRCDIR}/${COMPONENT}
  53. .endif
  54. # handling of includes AND obj
  55. .if !target(post-patch)
  56. post-patch:
  57. mkdir -p ${WRKDIR}/obj
  58. cd ${WRKSRC} && ${MAKE} -f ${MAKE_FILE} ${MAKE_FLAGS} obj
  59. .endif
  60. .if !target(pre-configure)
  61. pre-configure:
  62. . for i in ${XINCDIRS}
  63. mkdir -p ${INCBASE}${X11BASE}/include/$i
  64. . endfor
  65. cd ${WRKSRC} && ${MAKE} -f ${MAKE_FILE} ${MAKE_FLAGS} includes DESTDIR=${INCBASE} INSTALL_DATA='cp -fp'
  66. .endif
  67. # XXX this doesn't work yet, no idea why
  68. #.if "${MAKE_FILE}" == "Makefile.bsd-wrapper" && !target(do-configure)
  69. #do-configure:
  70. # cd ${WRKSRC} && ${SUDO} ${MAKE} -f ${MAKE_FILE} ${MAKE_FLAGS} config.status
  71. #.endif
  72. .if !target(pre-install)
  73. pre-install:
  74. cd ${WRKINST} && find . -print >${WRKDIR}/badlist
  75. # I should be able to say FAKE_TARGET=includes install
  76. # but at least freetype is broken in such a way that this doesn't work at all
  77. cd ${WRKSRC} && ${SUDO} ${MAKE} -f ${MAKE_FILE} ${MAKE_FLAGS} includes DESTDIR=${WRKINST}
  78. .endif
  79. .if !target(post-install)
  80. post-install:
  81. mkdir -p ${LOCATION}
  82. @cd ${WRKINST} && find . -print |fgrep -v -e /fonts.dir -e /fonts.scale >goodlist
  83. @echo ./goodlist >>${WRKDIR}/badlist
  84. mkdir -p ${PREFIX}/libdata/base
  85. @sort ${WRKINST}/goodlist ${WRKDIR}/badlist |uniq -u >${MANIFEST}
  86. @a=`mktemp ${LOCATION}/${FLAT}.tgz.XXXXXX`; \
  87. cd ${WRKINST} && \
  88. tar zcf $$a -I ${MANIFEST}; \
  89. echo xc-${FLAT} $$a >${PREFIX}/libdata/base/${FULLPKGNAME}.gen
  90. .endif