summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3f63821c99eccca228293ee94ae39e7c9ec812b6 (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
# Maintainer: Matt Parnell/ilikenwf
# Cleanup: Sam Stuewe <halosghost@archlinux.info>
# still want to build trunk? use http://sprunge.us/XARP instead
pkgname="nightingale-git"
pkgver=1e74b6f
pkgrel=2
pkgdesc="No binaries used. Open source fork of the Songbird Media Player with updates and fixes."
arch=('i686' 'x86_64')
url="http://getnightingale.com/"
license=('GPL2' 'MPL' 'BSD')
makedepends=('git' 'subversion' 'python' 'unzip' 'libidl2' 'zip' 'glib2')
depends=('gst-plugins-bad' 'gst-plugins-base' 'gst-plugins-base-libs' 'gst-plugins-good' 'gstreamer' 'gtk2' 'libxt' 'sqlite3' 'taglib')
conflicts=('nightingale')
provides=('nightingale')
install="nightingale.install"
source=("nightingale-hacking::git://github.com/nightingale-media-player/nightingale-hacking.git#branch=gstreamer-1.0"
		"nightingale-deps::git://github.com/nightingale-media-player/nightingale-deps.git#branch=xul-192-new"
        "Nightingale.desktop")
md5sums=('SKIP'
		 'SKIP'
         '7741cc247648e95dd9dad8c953616757')

pkgver() {
	cd "nightingale"
	git describe --always | sed 's|-|.|g'
}

prepare() {
   export GST_PLUGIN_PATH="/usr/lib/gstreamer-1.0"
   echo 'ac_add_options --with-media-core=gstreamer-system' > "${srcdir}/nightingale-hacking/nightingale.config"
   echo 'ac_add_options --with-gstreamer-1.0' >> "${srcdir}/nightingale-hacking/nightingale.config"
   echo 'ac_add_options --with-taglib-source=system' >> "${srcdir}/nightingale-hacking/nightingale.config"
}

build() {
	
	if [ ! -d "${srcdir}/linux-${CARCH}" ]; then
		msg "Building static dependencies xulrunner and sqlite..."
		
		mkdir "${srcdir}/linux-${CARCH}"
		cd "${srcdir}/nightingale-deps"
		
		# xul 1.9.2 won't build without this
		unset CPPFLAGS
		
		export SB_VENDOR_BINARIES_CO_ROOT=${srcdir}
		export SB_VENDOR_BUILD_ROOT=${srcdir}
		export CXXFLAGS="$CXXFLAGS -fpermissive"

		# fix mozilla freetype headers
		sed -i 's/freetype\///g' xulrunner-1.9.2/mozilla/config/system-headers
		sed -i 's/freetype\///g' xulrunner-1.9.2/mozilla/gfx/thebes/src/gfxPangoFonts.cpp
		
		msg2 "Building xulrunner 1.9.2...\n"
		make -C xulrunner-1.9.2 -f Makefile.songbird xr-clean xr-build-release xr-packaging-release

		msg2 "Building sqlite...\n"
		cd sqlite
		autoreconf --force --install
		cd ..
		make -C sqlite -f Makefile.songbird
	else
		msg "Using existing dependencies. If you haven't rebuilt in a while please rm -rf pkg and src and start over."
	fi
	
	if [ ! -d "${srcdir}/nightingale-hacking/dependencies/linux-${CARCH}" ]; then
		# link our hopefully fresh compiled deps (no more bins!)
		ln -s "${srcdir}/linux-${CARCH}" "${srcdir}/nightingale-hacking/dependencies/linux-${CARCH}"
	fi
	
	cd "${srcdir}/nightingale-hacking"
	
	make
	
	# copy the add-ons first
	[ -d ../xpi-stage ] && rm -rf ../xpi-stage 
	cp -a "${srcdir}/nightingale-hacking/compiled/xpi-stage" "${srcdir}"
}

package() {
	install -d --group=users "${pkgdir}/opt/nightingale"
	cd "nightingale-hacking/compiled/dist"
	sed -i 's/0\.10/1\.0/g' nightingale # hack for now to make the launcher work properly
	cp -a --no-preserve=ownership * ${pkgdir}/opt/nightingale/

	chmod 755 "${pkgdir}/opt/nightingale/nightingale-bin"
	chmod 755 "${pkgdir}/opt/nightingale/xulrunner/xulrunner-bin"
	chmod -R a+r "${pkgdir}/opt/nightingale"
	
	install -D "${srcdir}/nightingale-hacking/compiled/dist/chrome/icons/default/default.xpm" \
		"${pkgdir}/usr/share/pixmaps/nightingale.xpm"
	install -Dm644 "${srcdir}/Nightingale.desktop" \
		"${pkgdir}/usr/share/applications/Nightingale.desktop"

	find "${pkgdir}" -type d -name .git -exec rm -r '{}' +
	
	msg "You will find addon files generated in ${srcdir}/xpi-stage."
}