Makefile 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. # $OpenBSD: Makefile,v 1.11 2017/06/14 05:23:10 landry Exp $
  2. # Some of this comes from www/firefox-esr as apropos, since Tor
  3. # browser is a fork of ESR. It is a good idea to look at that
  4. # Makefile when editing this one (ESR versions not always the same).
  5. COMMENT = modified version of Firefox ESR for browsing over Tor
  6. MOZILLA_VERSION = ${TB_VERSION}
  7. MOZILLA_PROJECT = ${BROWSER_NAME}
  8. MOZILLA_CODENAME = browser
  9. MASTER_SITES = https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/archive/
  10. EXTRACT_SUFX = .tar.gz
  11. DIST_SUBDIR = ${BROWSER_NAME}
  12. WRKDIST = ${WRKDIR}/${GH_PROJECT}-${GH_TAGNAME:C/^v//}
  13. GH_PROJECT = torb
  14. GH_TAGNAME = v${TB_VERSION}-esr45.9.0
  15. PKGNAME = ${TB_PREFIX}-browser-${TB_VERSION}
  16. DISTNAME = ${GH_TAGNAME}
  17. REVISION = 0
  18. SO_VERSION = 1.0
  19. MOZILLA_LIBS = browsercomps xul lgpllibs
  20. MOZILLA_LIBS += freebl3 nss3 nssckbi nssdbm3
  21. MOZILLA_LIBS += nssutil3 smime3 softokn3 ssl3
  22. MOZILLA_LIBS += mozsqlite3
  23. # mozilla public license
  24. PERMIT_PACKAGE_CDROM= Yes
  25. MODULES = www/mozilla lang/python
  26. MOZILLA_USE_BUNDLED_NSS = Yes
  27. MOZILLA_USE_BUNDLED_LIBEVENT = Yes
  28. MOZILLA_USE_BUNDLED_SQLITE = Yes
  29. MOZILLA_AUTOCONF_DIRS += . js/src
  30. MODPY_RUNDEP = No
  31. # necessary glue to build with the correct compiler after fx 17
  32. COMPILER = clang
  33. MODCLANG_ARCHS = amd64 i386
  34. # Regression tests are too hard to adapt to run here
  35. NO_TEST = Yes
  36. # for nss build system
  37. MAKE_ENV += BUILD_OPT=1 \
  38. LOCALBASE="${LOCALBASE}" \
  39. NSS_ENABLE_ECC=1 \
  40. XCFLAGS="-I${LOCALBASE}/include ${CFLAGS}"
  41. CONFIGURE_STYLE = autoconf no-autoheader
  42. LIB_DEPENDS += devel/gettext>=0.10.38 \
  43. converters/libiconv
  44. WANTLIB += intl>=5 iconv>=6
  45. BUILD_DEPENDS += devel/py-virtualenv
  46. # to be able to link when building with clang on i386 or gcc on ppc
  47. .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc"
  48. CONFIGURE_ARGS += --disable-debug-symbols
  49. .endif
  50. CONFIGURE_ARGS += --with-app-name=${BROWSER_NAME} \
  51. --with-tor-browser-version=${TB_VERSION} \
  52. --disable-tor-browser-update \
  53. --enable-tor-brower-data-in-home-dir
  54. # relies on pulseaudio for sound and broken at runtime
  55. CONFIGURE_ARGS += --disable-webrtc
  56. CONFIGURE_ARGS += --disable-gstreamer
  57. RUN_DEPENDS += net/tor>=0.2.9.10
  58. # bug 857628
  59. CONFIGURE_ARGS += --enable-pie
  60. # there are sometimes .orig files in the source, messes with update-patches
  61. post-extract:
  62. -find ${WRKSRC} -name '*.orig' -exec rm {} \;
  63. post-patch:
  64. # hack config/baseconfig.mk to not use MOZ_APP_VERSION in a few places
  65. sed -i.bak -e 's/-$$(MOZ_APP_VERSION)/-${TB_VERSION}/' \
  66. ${WRKSRC}/config/baseconfig.mk
  67. BROWSER_DIR = ${PREFIX}/lib/${BROWSER_NAME}-${TB_VERSION}
  68. BROWSER_CFG = ${BROWSER_DIR}/${BROWSER_NAME}.cfg
  69. post-install:
  70. # install prefs, bookmarks, app config file for Tor browser
  71. ${INSTALL_DATA_DIR} ${BROWSER_DIR}/browser/defaults/preferences
  72. ${SUBST_DATA} ${FILESDIR}/all-openbsd.js \
  73. ${BROWSER_DIR}/browser/defaults/preferences/all-openbsd.js
  74. ${INSTALL_DATA_DIR} ${BROWSER_DIR}/browser/defaults/profile
  75. ${INSTALL_DATA} ${FILESDIR}/bookmarks.html \
  76. ${BROWSER_DIR}/browser/defaults/profile
  77. # put tor-browser.cfg together
  78. (sed -e 's/^#/\/\/#/' < ${FILESDIR}/extension-overrides.js; \
  79. cat ${FILESDIR}/tor-browser-cfg-tail.js) > ${BROWSER_CFG}
  80. chown ${SHAREOWN}:${SHAREGRP} ${BROWSER_CFG}
  81. chmod ${SHAREMODE} ${BROWSER_CFG}
  82. # install desktop file
  83. ${INSTALL_DATA_DIR} ${PREFIX}/share/applications/
  84. ${SUBST_DATA} ${FILESDIR}/${BROWSER_NAME}.desktop \
  85. ${PREFIX}/share/applications/${BROWSER_NAME}.desktop
  86. # install icon for desktop file
  87. ${INSTALL_DATA_DIR} ${PREFIX}/share/pixmaps/
  88. ${INSTALL_DATA} ${BROWSER_DIR}/browser/icons/mozicon128.png \
  89. ${PREFIX}/share/pixmaps/${BROWSER_NAME}.png
  90. # link default48.png to default.png to be used by default
  91. # by non-icccm compliant wm
  92. ln -f ${BROWSER_DIR}/browser/chrome/icons/default/default{48,}.png
  93. .include <bsd.port.mk>