updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / nightingale-git / PKGBUILD
blob2b1a8b9b81b0fd8320f55f8bf202d367ef7f4a5f
1 # Maintainer: Matt Parnell/ilikenwf
2 # Contributor: Matt Parnell/ilikenwf
4 # Note: the maintainer/contributor of this package is also the
5 # de-facto head developer of the nightingale project...
6 # this script thus gets some extra TLC since I use arch
8 # If you're reading this, WE NEED MORE DEVELOPERS!
9 # If you know C++, XUL, and are familiar with the mozilla SDK,
10 # contact parwok@gmail.com or join our irc on MozNet #nightingale
11 # or the forums at getnightingale.com/forum
13 pkgname=nightingale-git
14 pkgver=20120109
15 pkgrel=1
16 pkgdesc="Community port of nightingale to be more Linux native. Working git version is nightingale 1.8 compatible."
17 arch=('i686' 'x86_64')
18 url="http://getnightingale.com/"
19 license=('GPL2' 'MPL' 'BSD')
20 makedepends=('git' 'bash' 'subversion' 'python2' 'tar' 'wget')
21 depends=('gstreamer0.10' 'gstreamer0.10-base' 'gtk2' 'libxt' 'sqlite3' 'gstreamer0.10-good-plugins' 
22                  'gstreamer0.10-bad-plugins' 'gstreamer0.10-ffmpeg' 'gstreamer0.10-ugly-plugins')
23 optdepends=()
24 conflicts=()
25 provides=('nightingale' 'nightingale-git')
26 install=nightingale.install
27 source=('proper_gst_path_archlinux.patch' 'Nightingale.desktop')
28 md5sums=('93d7e61400661def1957b3be9243f332'
29          '7741cc247648e95dd9dad8c953616757')
31 # Only use git if you want a 2.8gb directory sitting in your build
32 # dir! Otherwise, just use the snapshot, it's updated every time
33 # the git is since the project uses github!
34 use_git="yes"
35 _tarball="https://github.com/nightingale-media-player/nightingale-hacking/tarball/nightingale-1.8"
37 _no_update=n
39 _gitroot="git://github.com/nightingale-media-player/nightingale-hacking.git"
40 _gitname="nightingale"
41 _branch="nightingale-1.8"
43 fetch_sources() {
44         
45         if [ $use_git = "yes" ]; then
46                 # NOTE: master is in development, it WILL NOT BUILD
47                 if [ ! -d "$_gitname" ]; then
48                 cd "$srcdir"
49                 msg2 "Cloning initial copy of zen-sources..."
50                 warning "This may take some time depending on your available bandwidth."
52                 git clone --depth 1 "$_gitroot" "$_gitname"
54                 _no_update="y" # update is not necessary
55                 fi
57                 if [ "$_no_update" = "y" ]; then
58                         msg2 "Skipping tree update..."
59                 else
60                         cd "$srcdir/$_gitname"
62                         msg2 "Updating local tree..."
63                         if git fetch; then
64                                 msg2 "Attempting to merge changes..."
66                                 if ! "git merge origin/$_branch"; then
67                                         error "Merging failed..."
69                                         msg2 "Fixing local repository..."
70                                         git checkout -f "$_branch"
71                                         git clean -xdf
72                                         git reset --hard "origin/$_branch"
73                                 fi
74                         else
75                                 error "Update failed..."
76                         fi
78                         warning "Press ENTER if you want to continue or CTRL+C to abort..."
79                         read
80                 fi
81                 
82                 cd "$srcdir/$_gitname"
83                 git checkout -f "$_branch"      
84         else
85                 msg "Downloading the tarball from github."
86                 cd "${srcdir}"
87                 
88                 if [ ! -f "$_branch.tar.gz" ]; then
89                         wget -O "$_branch.tar.gz" $_tarball
90                 fi
91                 
92                 tar xvf "$_branch.tar.gz"
93                         
94                 if [ -d nightingale ]; then
95                         rm -rf nightingale
96                 fi
97                 
98                 mv nightingale-media-player-nightingale-hacking-* nightingale           
99         fi
102 do_package() {
103         mkdir -p ${pkgdir}/opt/nightingale/
104         cd "${srcdir}/$_gitname/compiled/dist"
105         cp -a * ${pkgdir}/opt/nightingale/
107         install -d --group=users ${pkgdir}/opt/nightingale
109         chmod 755 ${pkgdir}/opt/nightingale/nightingale
110         chmod 755 ${pkgdir}/opt/nightingale/nightingale-bin
111         chmod 755 ${pkgdir}/opt/nightingale/xulrunner/xulrunner
112         chmod 755 ${pkgdir}/opt/nightingale/xulrunner/xulrunner-bin
113         chmod -R a+r ${pkgdir}/opt/nightingale
114         install -D "${srcdir}/$_gitname/compiled/dist"/chrome/icons/default/default.xpm \
115                  ${pkgdir}/usr/share/pixmaps/nightingale.xpm
116         install -D -m644 ${srcdir}/Nightingale.desktop \
117                    ${pkgdir}/usr/share/applications/Nightingale.desktop
120 build() {
121         # get the source
122         fetch_sources
123         
124         cd "${srcdir}"
126         # I know this is lazy, but needing this svn stuff is temporary
127         # The below if statement/block will be removed in the next version
128         if [ ! -d "${srcdir}/nightingale/dependencies/linux-$(arch)" ] ; then
129                 msg "Grabbing a few Nightingale specific dependencies"
130                 msg "Don't worry, This won't be necessary with the next version, hopefully"
131                 msg "A lot of what we're grabbing here aren't even used..."
132                 msg2 "This WILL take a while, so don't freak out and cancel if nothing happens for 30sec - 1min"
133                 
134                 cd "${srcdir}/nightingale/dependencies"
135                 
136                 # Seriously, songbird devs...you didn't have to make it use all this static crap for linux builds...
137                 # understandable for Mac and Windows...but I mean, come on...
138                 # as the dev of nightingale, I'm working to not need this cruft, since our system provides these pkgs
139                 _svnroot="http://ngale.svn.sourceforge.net/svnroot/ngale/branches/dependencies/Nightingale1.8/linux-$(arch)"
140                 mkdir -p "linux-$(arch)"/{xulrunner/release,mozilla/release,taglib/release,sqlite/release}
141                 
142                 cd "${srcdir}/nightingale/dependencies/linux-$(arch)/xulrunner/release"
143                 svn co $_svnroot/xulrunner/release ./
144                 
145                 cd "${srcdir}/nightingale/dependencies/linux-$(arch)/mozilla/release"
146                 svn co $_svnroot/mozilla/release ./
147                 
148                 cd "${srcdir}/nightingale/dependencies/linux-$(arch)/taglib/release"
149                 svn co $_svnroot/taglib/release ./
150                 
151                 cd "${srcdir}/nightingale/dependencies/linux-$(arch)/sqlite/release"
152                 svn co $_svnroot/sqlite/release ./
153         fi
155         cd "${srcdir}/$_gitname"
157         # our gstreamer path, since we use system libs :)
158         export GST_PLUGIN_PATH="/usr/lib/gstreamer-0.10"
159         
160         # use our own gstreamer libs
161         grep -sq gstreamer-system nightingale.config || ( echo 'ac_add_options --with-media-core=gstreamer-system'  nightingale.config )
163         # force the buildscripts to use python2 to avoid breakage
164         export PYTHON="/usr/bin/python2"
166         # clobber just in case we're rebuilding, as we've probably pulled new code down
167         make -f nightingale.mk clobber
168         
169         # build it
170         make -f nightingale.mk
172         # edit the launcher so it always uses the correct gstreamer path...
173         # without this music playback wouldn't work
174         # I'm using an arch specific patch so we don't have to use the generic one
175         patch -Np0 -i ../proper_gst_path_archlinux.patch compiled/dist/nightingale
177         # make the package
178         do_package
179         
180         # free up over 600 mb
181         cd "${srcdir}/$_gitname"
182         
183         # copy the extensions first
184         if [ -d ../xpi-stage ]; then
185                 rm -rf ../xpi-stage
186         fi
187         cp -a "${srcdir}/$_gitname/compiled/xpi-stage" "${srcdir}"
188         
189         make -f nightingale.mk clobber
190         
191         msg "Note that the last.FM extension is in $srcdir/xpi-stage/audioscrobbler."
192         msg "If you want to use it, you'll need to install it manually after running Nightingale. Your mileage may vary."
193