Advertisement
ponce

Untitled

Dec 31st, 2012
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.63 KB | None | 0 0
  1. --- mozilla-firefox.SlackBuild 2012-07-17 22:51:41.000000000 +0200
  2. +++ mozilla-firefox.SlackBuild.new 2012-12-30 09:49:50.423661000 +0100
  3. @@ -25,21 +25,28 @@
  4.  
  5. VERSION=$(basename $(ls firefox-*.tar.bz2 | cut -d - -f 2 | rev | cut -f 3- -d . | rev) .source)
  6. RELEASEVER=$(echo $VERSION | cut -f 1 -d r | cut -f 1 -d b)
  7. +# With esr releases we need to fix this
  8. +if [ "${RELEASEVER}r" = "$VERSION" ]; then
  9. + RELEASEVER=$(echo $RELEASEVER | cut -f 1 -d e)
  10. + RELEASEVERMAJ=$(echo $RELEASEVER | cut -f 1 -d .)
  11. +fi
  12. BUILD=${BUILD:-1}
  13.  
  14. CWD=$(pwd)
  15. TMP=${TMP:-/tmp}
  16. PKG=$TMP/package-mozilla-firefox
  17.  
  18. -# Figure out if this is a beta, or a release:
  19. +# If not specified, figure out if this is a beta, an esr
  20. +# or a release (we start assuming this last):
  21. +MOZVERS=${MOZVERS:-release}
  22. if echo $VERSION | grep -q b ; then # we think it is a beta
  23. - if bzgrep -q mozilla-beta/ $CWD/firefox-$VERSION.source.tar.bz2 ; then
  24. - MOZVERS=${MOZVERS:-beta}
  25. - else # blindly assume it is a release
  26. - MOZVERS=${MOZVERS:-release}
  27. + if bzgrep -q ^mozilla-beta/ $CWD/firefox-$VERSION.source.tar.bz2 ; then
  28. + MOZVERS=beta
  29. + fi
  30. +elif echo $VERSION | grep -q esr ; then # we think it is an esr
  31. + if bzgrep -q ^mozilla-esr$RELEASEVERMAJ/ $CWD/firefox-$VERSION.source.tar.bz2 ; then
  32. + MOZVERS=esr$RELEASEVERMAJ
  33. fi
  34. -else # release, no "b" in the tarball version:
  35. - MOZVERS=${MOZVERS:-release}
  36. fi
  37.  
  38. # Automatically determine the architecture we're building on:
  39. @@ -111,18 +118,8 @@
  40. sed -i 's# ""##' browser/base/Makefile.in
  41. fi
  42.  
  43. -# Mozilla devs enforce using an objdir for building
  44. -# and launching configure with the absolute path
  45. -# https://developer.mozilla.org/en/Configuring_Build_Options#Building_with_an_objdir
  46. -mkdir obj
  47. -cd obj
  48. -export MOZILLA_OFFICIAL="1" &&
  49. -export BUILD_OFFICIAL="1" &&
  50. -export MOZ_PHOENIX="1" &&
  51. -export CFLAGS="$SLKCFLAGS" &&
  52. -export CXXFLAGS="$SLKCFLAGS" &&
  53. -export MOZ_MAKE_FLAGS="$NUMJOBS" &&
  54. -$TMP/mozilla-$MOZVERS/configure \
  55. +# Our building options, in a configure-like display ;)
  56. +OPTIONS="\
  57. --enable-official-branding \
  58. --prefix=/usr \
  59. --libdir=/usr/lib${LIBDIRSUFFIX} \
  60. @@ -143,6 +140,7 @@
  61. --enable-strip \
  62. --enable-cpp-rtti \
  63. --enable-single-profile \
  64. + --disable-gnomevfs \
  65. --disable-ldap \
  66. --disable-accessibility \
  67. --disable-crashreporter \
  68. @@ -152,20 +150,53 @@
  69. --disable-installer \
  70. --disable-mailnews \
  71. --disable-composer \
  72. - --disable-profilesharing
  73. - # Complains about missing APNG support in Slackware's libpng:
  74. - #--with-system-png \
  75. -
  76. + --disable-profilesharing"
  77. +# Complains about missing APNG support in Slackware's libpng:
  78. +# --with-system-png \
  79. # This option breaks mozilla-12.0:
  80. # --enable-system-cairo \
  81. -#
  82.  
  83. -#make -f client.mk build MOZ_MAKE_FLAGS="$NUMJOBS" || exit 1
  84. -make MOZ_MAKE_FLAGS="$NUMJOBS" $NUMJOBS || exit 1
  85. -make install DESTDIR=$PKG || exit 1
  86. +export MOZILLA_OFFICIAL="1"
  87. +export BUILD_OFFICIAL="1"
  88. +export MOZ_PHOENIX="1"
  89. +export CFLAGS="$SLKCFLAGS"
  90. +export CXXFLAGS="$SLKCFLAGS"
  91. +export MOZ_MAKE_FLAGS="$NUMJOBS"
  92. +
  93. +# Clear some variables that could break the build
  94. +unset DBUS_SESSION_BUS_ADDRESS ORBIT_SOCKETDIR SESSION_MANAGER \
  95. + XDG_SESSION_COOKIE XAUTHORITY MAKEFLAGS
  96. +
  97. +# Assemble our .mozconfig, we use this method for building, seems
  98. +# needed for PGO.
  99. +echo ". \$topsrcdir/browser/config/mozconfig" > .mozconfig
  100. +
  101. +# Mozilla devs enforce using an objdir for building
  102. +# https://developer.mozilla.org/en/Configuring_Build_Options#Building_with_an_objdir
  103. +mkdir obj
  104. +echo "mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj" >> .mozconfig
  105. +
  106. +# Write in it the options above
  107. +for option in $OPTIONS; do echo "ac_add_options $option" >> .mozconfig; done
  108. +
  109. +# https://developer.mozilla.org/en-US/docs/Building_with_Profile-Guided_Optimization
  110. +# Thanks to ArchLinux and Gentoo for the additional hints.
  111. +if [ "${PGO:-no}" = "yes" ]; then
  112. + # Do a PGO build, double time and disk space but worth it.
  113. + export MOZ_PGO=1
  114. + echo "mk_add_options PROFILE_GEN_SCRIPT='\$(PYTHON) \$(MOZ_OBJDIR)/_profile/pgo/profileserver.py 10'" >> .mozconfig
  115. + export DISPLAY=:99
  116. + # Launch Xvfb to let the profile scripts run in a X session.
  117. + # Ugly note: if the build breaks you may want to do a "killall Xvfb".
  118. + Xvfb -nolisten tcp -extension GLX -screen 0 1280x1024x24 $DISPLAY &
  119. + dbus-launch --exit-with-session make -f client.mk build
  120. + kill $! || true
  121. +else
  122. + # Do a normal build
  123. + make -f client.mk build
  124. +fi
  125.  
  126. -# Exit obj directory:
  127. -cd ..
  128. +make -f client.mk install DESTDIR=$PKG
  129.  
  130. # We don't need these (just symlinks anyway):
  131. rm -rf $PKG/usr/lib${LIBDIRSUFFIX}/firefox-devel-$RELEASEVER
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement