1 inherit check-reqs gnome2-utils toolchain-funcs xdg-utils
3 EXPORT_FUNCTIONS pkg_pretend pkg_preinst pkg_postinst pkg_postrm pkg_setup
10 palemoon-5_pkg_pretend() {
11 # Ensure that we have enough disk space to compile:
12 CHECKREQS_DISK_BUILD=${REQUIRED_BUILDSPACE}
15 # Ensure that we are on a supported compiler profile:
16 einfo "Checking compiler profile..."
17 if [[ $PALEMOON_ENABLE_UNSUPPORTED_COMPILERS == 1 ]]; then
18 unsupported_compiler_warning $(tc-get-compiler-type)
20 if ! [[ tc-is-gcc && "$GCC_SUPPORTED_VERSIONS" =~ (^| )"$(gcc-version)"($| ) ]]; then
21 unsupported_compiler_error $(tc-get-compiler-type)
27 palemoon-5_pkg_preinst() {
31 palemoon-5_pkg_postinst() {
32 # Update mimedb for the new .desktop file:
33 xdg_desktop_database_update
34 gnome2_icon_cache_update
37 palemoon-5_pkg_postrm() {
38 gnome2_icon_cache_update
41 palemoon-5_pkg_setup() {
42 # Nested configure scripts in mozilla products generate unrecognized
43 # options false positives when toplevel configure passes downwards:
44 export QA_CONFIGURE_OPTIONS=".*"
52 official-branding_warning() {
53 elog "You are enabling the official branding. You may not redistribute this build"
54 elog "to any users on your network or the internet. Doing so puts yourself into"
55 elog "a legal problem with Moonchild Productions."
56 elog "You can disable the official branding by emerging ${PN} _without_"
57 elog "the official-branding USE flag."
60 unsupported_compiler_warning() {
61 ewarn "Building Pale Moon with a compiler other than a supported gcc version"
62 ewarn "may result in an unstable build."
63 ewarn "Be aware that building Pale Moon with an unsupported compiler"
64 ewarn "means that the official support channels may refuse to offer any"
65 ewarn "kind of help in case the build fails or the browser behaves incorrectly."
66 ewarn "Supported GCC versions: ${GCC_SUPPORTED_VERSIONS// /, }"
67 if [[ "$1" == "gcc" ]]; then
68 ewarn "Selected GCC version: $(gcc-version)"
70 ewarn "Unsupported compiler selected: $1"
72 ewarn "To disable this warning unset the PALEMOON_ENABLE_UNSUPPORTED_COMPILERS"
73 ewarn "environment variable."
76 unsupported_compiler_error() {
77 eerror "Building Pale Moon with a compiler other than a supported gcc version"
78 eerror "may result in an unstable build."
79 eerror "You can use gcc-config to change your compiler profile, just remember"
80 eerror "to change it back afterwards."
81 eerror "You need to have the appropriate versions of gcc installed for them"
82 eerror "to be shown in gcc-config."
83 eerror "Alternatively, you can set the PALEMOON_ENABLE_UNSUPPORTED_COMPILERS"
84 eerror "environment variable to 1 either by exporting it from the current shell"
85 eerror "or by adding it to your make.conf file."
86 eerror "Be aware though that building Pale Moon with an unsupported compiler"
87 eerror "means that the official support channels may refuse to offer any"
88 eerror "kind of help in case the build fails or the browser behaves incorrectly."
89 eerror "Supported GCC versions: ${GCC_SUPPORTED_VERSIONS// /, }"
90 if [[ "$1" == "gcc" ]]; then
91 eerror "Selected GCC version: $(gcc-version)"
93 eerror "Unsupported compiler selected: $1"
103 echo "ac_add_options --enable-application=palemoon" > "${S}/.mozconfig"
107 for option in "$@"; do
108 echo "ac_add_options --enable-${option}" >> "${S}/.mozconfig"
112 mozconfig_disable() {
113 for option in "$@"; do
114 echo "ac_add_options --disable-${option}" >> "${S}/.mozconfig"
119 for option in "$@"; do
120 echo "ac_add_options --with-${option}" >> "${S}/.mozconfig"
125 echo "mk_add_options $1=$2" >> "${S}/.mozconfig"
129 echo "pref(\"$1\", $2);" >> "${S}/${obj_dir}/dist/bin/browser/defaults/preferences/palemoon.js"
137 install_branding_files() {
138 cp -rL "${S}/${obj_dir}/dist/branding" "${extracted_dir}/"
139 local size sizes icon_path icon name
141 icon_path="${extracted_dir}/branding"
144 for size in ${sizes}; do
145 insinto "/usr/share/icons/hicolor/${size}x${size}/apps"
146 newins "${icon_path}/default${size}.png" "${icon}.png"
148 # The 128x128 icon has a different name:
149 insinto "/usr/share/icons/hicolor/128x128/apps"
150 newins "${icon_path}/mozicon128.png" "${icon}.png"
151 # Install a 48x48 icon into /usr/share/pixmaps for legacy DEs:
152 newicon "${icon_path}/default48.png" "${icon}.png"
153 newmenu "${FILESDIR}/icon/${PN}.desktop" "${PN}.desktop"
154 sed -i -e "s:@NAME@:${name}:" -e "s:@ICON@:${icon}:" \
155 "${ED}/usr/share/applications/${PN}.desktop" || die