template 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. # Template file for 'basilisk'
  2. pkgname=basilisk
  3. version=2024.02.03
  4. revision=1
  5. _UXP_version=RB_20230711
  6. create_wrksrc=yes
  7. build_wrksrc="basilisk"
  8. hostmakedepends="autoconf213 perl pkgconf python unzip yasm zip tar
  9. which"
  10. makedepends="libXt-devel $(vopt_if alsa alsa-lib-devel)
  11. $(vopt_if dbus dbus-glib-devel) $(vopt_if pulseaudio pulseaudio-devel)
  12. $(vopt_if xscreensaver libXScrnSaver-devel) $(vopt_if sndio sndio-devel)
  13. $(vopt_if jack jack-devel) $(vopt_if gtk3 gtk+3-devel gtk+-devel)"
  14. short_desc="Basilisk is a browser application built on the Unified XUL Platform"
  15. maintainer="MarcoAPC <marcoaureliopc@gmail.com>"
  16. license="MPL-2.0, GPL-2.0-or-later, LGPL-2.1-or-later"
  17. homepage="https://www.basilisk-browser.org/"
  18. distfiles="https://repo.palemoon.org/Basilisk-Dev/Basilisk/archive/v${version}.tar.gz
  19. https://repo.palemoon.org/MoonchildProductions/UXP/archive/${_UXP_version}.tar.gz"
  20. checksum="dca0b2ed0192e13ca81aa0ac38651efd88df0712a73d2b8cc66d0af794bf890d
  21. e84c42eddba97672e17dbedddb83d6587f7860c55b418e6569881d4c3f029fc7"
  22. patch_args="-Np1 --directory=${build_wrksrc}"
  23. CFLAGS="-D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64"
  24. CXXFLAGS="-D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64"
  25. build_options="alsa jack dbus pulseaudio xscreensaver sndio gtk3"
  26. build_options_default="alsa"
  27. if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
  28. makedepends+=" libatomic-devel"
  29. fi
  30. post_extract() {
  31. rmdir basilisk/platform
  32. mv uxp basilisk/platform
  33. }
  34. post_patch() {
  35. if [ "$build_option_gtk3" ]; then
  36. patch -Np1 --directory=${build_wrksrc} -i "${FILESDIR}/no-gtk2.patch"
  37. fi
  38. }
  39. do_build() {
  40. cp "${FILESDIR}/mozconfig" ".mozconfig"
  41. cat <<! >>.mozconfig
  42. ac_add_options --enable-default-toolkit=cairo-gtk$(vopt_if gtk3 '3' '2')
  43. ac_add_options $(vopt_enable alsa)
  44. ac_add_options $(vopt_enable jack)
  45. ac_add_options $(vopt_enable sndio)
  46. ac_add_options $(vopt_enable dbus)
  47. ac_add_options $(vopt_enable pulseaudio)
  48. export MOZ_PKG_SPECIAL=gtk$(vopt_if gtk3 '3' '2')
  49. !
  50. case "$XBPS_TARGET_MACHINE" in
  51. *-musl)
  52. echo "ac_add_options --disable-jemalloc" >>.mozconfig
  53. echo "ac_add_options --disable-gold" >>.mozconfig
  54. ;;
  55. esac
  56. case "$XBPS_TARGET_MACHINE" in
  57. x86_64*|i686*|arm*|aarch64*)
  58. echo "ac_add_options --disable-elf-hack" >>.mozconfig
  59. ;;
  60. esac
  61. if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
  62. export LDFLAGS+=" -latomic"
  63. fi
  64. if [ "$CROSS_BUILD" ]; then
  65. export HOST_CFLAGS="${XBPS_CFLAGS}"
  66. export HOST_CXXFLAGS="${XBPS_CXXFLAGS}"
  67. export CXXFLAGS+=" ${CFLAGS}"
  68. export LDFLAGS+=" -L${XBPS_CROSS_BASE}/usr/lib"
  69. export ac_cv_sqlite_secure_delete=yes \
  70. ac_cv_sqlite_threadsafe=yes \
  71. ac_cv_sqlite_enable_fts3=yes \
  72. ac_cv_sqlite_dbstat_vtab=yes \
  73. ac_cv_sqlite_enable_unlock_notify=yes \
  74. ac_cv_prog_hostcxx_works=1
  75. echo "ac_add_options --target=${XBPS_CROSS_TRIPLET:-${XBPS_TRIPLET}}" >>.mozconfig
  76. echo "ac_add_options --host=${XBPS_TRIPLET}" >>.mozconfig
  77. else
  78. echo "ac_add_options --target=${XBPS_TRIPLET}" >>.mozconfig
  79. echo "ac_add_options --host=${XBPS_TRIPLET}" >>.mozconfig
  80. fi
  81. # work around large debug symbols on 32-bit hosts
  82. if [ "$XBPS_WORDSIZE" = "32" ]; then
  83. echo "ac_add_options --disable-debug-symbols" >>.mozconfig
  84. export LDFLAGS+=" -Wl,--no-keep-memory"
  85. fi
  86. if [ "$SOURCE_DATE_EPOCH" ]; then
  87. export MOZ_BUILD_DATE=$(date --date "@$SOURCE_DATE_EPOCH" "+%Y%m%d%H%M%S")
  88. fi
  89. export LDFLAGS+=" -Wl,-rpath=/usr/lib/basilisk"
  90. # increase default stack size as basilisk uses a recursive js parser
  91. export LDFLAGS+=" -Wl,-z,stack-size=524288"
  92. export MOZ_MAKE_FLAGS="${makejobs}"
  93. export MOZ_NOSPAM=1
  94. export MOZBUILD_STATE_PATH="${wrksrc}/mozbuild"
  95. rm -f old-configure
  96. ./mach build
  97. }
  98. do_install() {
  99. export MOZBUILD_STATE_PATH="${wrksrc}/mozbuild"
  100. DESTDIR="$DESTDIR" ./mach install
  101. vinstall ${FILESDIR}/basilisk.desktop 644 usr/share/applications
  102. for i in 16 32 48; do
  103. vinstall basilisk/branding/unofficial/default$i.png 644 usr/share/icons/hicolor/${i}x${i}/apps basilisk.png
  104. done
  105. # We don't want the development stuff
  106. rm -rf ${DESTDIR}/usr/{include,lib/basilisk-devel}
  107. # https://bugzilla.mozilla.org/show_bug.cgi?id=658850
  108. ln -sf basilisk ${DESTDIR}/usr/lib/basilisk/basilisk-bin
  109. }