summaryrefslogtreecommitdiffstats
path: root/PKGBUILD
blob: e29916fff6aae4618e08d445fa8a3e89d1bbdfc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#Maintainer: Raghavendra Prabhu -> rprabhu AT wnohang DOT net

pkgname=firefox-hg
pkgver=69522
pkgrel=1
_build=1
pkgdesc="Mozilla Firefox hg tip (XULRunner independent)"
url="http://www.mozilla.org/projects/firefox"
arch=('i686' 'x86_64')
license=('MPL' 'GPL' 'LGPL')

depends=('gtk2>=2.20.1' 'gcc-libs>=4.5.0' 'libidl2>=0.8.13' 'mozilla-common' 'libxt' 'hunspell>=1.2.8' 'zlib'
          'mime-types' 'dbus-glib>=0.86' 'desktop-file-utils'
         'cairo' 'libpng>=1.4.0' 'alsa-lib>=1.0.23' 'libevent>=1.4')

makedepends=('autoconf2.13' 'gcc>=4.5.0' 'zip' 'pkgconfig' 'diffutils'
             'wireless_tools' 'mesa' 'yasm' 'mercurial')

optdepends=('libgnomeui: GNOME integration and MIME handling'
            'wireless_tools: Location-aware browsing'
            'python: pyxpcom')

provides=("firefox=$pkgver")
conflicts=('firefox')

source=('mozconfig' 'firefox.desktop' 'firefox-safe.desktop'
        'fix-mozilla-launcher.patch' 'mozilla-firefox-1.0-lang.patch' 'libstdc++.patch'
        'flash-78414-2.patch')
md5sums=()

_hgroot="/media/Yin/Repo"
_hgrepo="mozilla-central"
########### Bug list
#https://bugzilla.mozilla.org/show_bug.cgi?id=422540
# flash-78414 
#########################33

build() {
  unset CFLAGS CXXFLAGS  CC CXX
  #export CFLAGS=" -march=native -O2 -pipe -fpermissive "
  #export CXXFLAGS=" -march=native -O2 -pipe -fpermissive "
  #export LD="/usr/bin/ld"
  #export CC="/usr/bin/clang"
  #export CXX="/usr/bin/clang++"
  #export AS="/usr/bin/llvm-as"
  export LDFLAGS=" -Wl,-rpath,/usr/lib/firefox-$pkgver -Wl,--hash-style=gnu "
  cd "$srcdir"
  msg "Connecting to Mercurial server...."

  if [ -d $_hgrepo ] ; then
    cd $_hgrepo
    hg pull -u
    msg "The local files are updated."
  else
    #hg clone $_hgroot $_hgrepo
    cp -l $_hgroot $_hgrepo
  fi

  msg "Mercurial checkout done or server timeout"
  msg "Starting make..."

  rm -rf "$srcdir/$_hgrepo-build"
  cp -l "$srcdir/$_hgrepo" "$srcdir/$_hgrepo-build"
  cd "$srcdir/$_hgrepo-build"
  cp "$srcdir/mozconfig" .mozconfig

  # Not using OSS anymore
  #msg2 "Patching..."
  #sed -i 's/sydney_audio_alsa/sydney_audio_oss/' media/libsydneyaudio/src/Makefile.in || return 1

   #Get rid of ALSA stuff in the build system
  #sed -i '/alsa\//d' config/system-headers || return 1
  #sed -i '/alsa\//d' js/src/config/system-headers || return 1
  #sed -i '/LIB(asound/d' configure.in || return 1

  # Fix stub launcher - Arch
  patch -Np0 -i "$srcdir/fix-mozilla-launcher.patch"

  # Use LANG environment variable to choose locale
  patch -Np1 -i "$srcdir/mozilla-firefox-1.0-lang.patch"
  #patch -Np1 -i "$srcdir/libstdc++.patch"

  patch -Np1 -i "$srcdir/flash-78414-2.patch" || exit 1

  msg2 "Configuring..."

  autoconf-2.13

  msg2 "Building..."

  make -j8 -f client.mk build MOZ_MAKE_FLAGS="$MAKEFLAGS"

}

package() {
  cd "$srcdir/$_hgrepo-build"

  make -j8 -f client.mk DESTDIR="$pkgdir" install

  install -Dm644 "$srcdir//$_hgrepo-build/browser/branding/unofficial/mozicon128.png" \
    "$pkgdir/usr/share/pixmaps/firefox.png"

  install -Dm644 "$srcdir/firefox.desktop" \
    "$pkgdir/usr/share/applications/firefox.desktop"

  install -Dm644 "$srcdir/firefox-safe.desktop" \
    "$pkgdir/usr/share/applications/firefox-safe.desktop"

  # Remove devel stuff.
  rm -rf "$pkgdir/usr/include/"
  rm -rf "$pkgdir/usr/lib/firefox-devel-$pkgver/"
  rm -rf "$pkgdir/usr/share/idl/"
}