1 # Maintainer : Keshav P R <(the.ridikulus.rat) (aatt) (gemmaeiil) (ddoott) (ccoomm)>
3 _pkgname="grub2-bios-bzr"
6 # pkgname="${_pkgname}-exp" ## Uncomment for grub2 BZR Experimental Branch
9 pkgdesc="The GNU GRand Unified Bootloader - Version 2 - Built for i386 BIOS - BZR Development version with grub-extras"
10 url="http://www.gnu.org/software/grub/"
11 arch=('i686' 'x86_64')
14 makedepends=('bzr' 'rsync' 'xz' 'bdf-unifont' 'python2' 'autogen' 'texinfo' 'help2man' 'gettext' 'device-mapper' 'fuse')
15 depends=('xz' 'freetype2' 'device-mapper' 'fuse' 'gettext')
16 optdepends=('libisoburn: provides xorriso for generating grub2 rescue iso using grub-mkrescue'
17 'os-prober: to detect other OSes when generating grub.cfg in BIOS systems')
19 install="${_pkgname}.install"
20 backup=('boot/grub/grub.cfg' 'etc/default/grub' 'etc/grub.d/40_custom')
21 conflicts=('grub2-common' 'grub2-bios')
22 provides=('grub2-common' 'grub2-bios')
25 source=('grub.default'
26 'grub.cfg.bios.example'
28 'grub2_automake_1.11.2_pkglib_to_pkgdata.patch'
29 'grub-mkconfig-Use_outside_GRUB_PREFIX_if_defined.patch'
30 'archlinux_grub2_mkconfig_fixes.patch')
32 sha256sums=('bbea2d8cbf2920885b88766d5988ddb440b394cda4b8597dc6f4a9e7d236c61b'
33 '8511ceb65169168b2738aa928ccaceb7036589136ed8895ea48da9927fc21248'
34 'ba0f871ee93760d14d7f19709bb875af4a863a758776a23519ca7100a63da295'
35 '54c9c9aef89005157b9f3b0250a5601fff52db782eff3882fa5d278344ade111'
36 'df1780d3bc136cfdbc4f942a12d2d27e03b5fa95c4067766059aa132254c42c5'
37 '1247d438774b98792d1a3f7bde64d0def05743b0bff68cae7614e7a8454b3f8d')
42 pkgdesc="The GNU GRand Unified Bootloader 2 - Built for i386 BIOS - BZR Experimental Branch with grub-extras"
44 conflicts+=("${_pkgname}")
46 _bzrtrunk="bzr://bzr.savannah.gnu.org/grub/branches/experimental/"
47 # _bzrtrunk="lp:~the-ridikulus-rat/grub/grub2-bzr-exp"
51 pkgdesc="The GNU GRand Unified Bootloader 2 - Built for i386 BIOS - BZR Main Trunk with grub-extras"
53 conflicts+=("${_pkgname}-exp")
55 _bzrtrunk="bzr://bzr.savannah.gnu.org/grub/trunk/grub/"
56 # _bzrtrunk="lp:grub/grub2"
61 if [[ "${CARCH}" == 'x86_64' ]]; then
62 # makedepends+=('gcc-multilib' 'gcc-libs-multilib' 'lib32-glibc' 'binutils-multilib' 'libtool-multilib')
64 _EFIEMU="--enable-efiemu"
66 _EFIEMU="--disable-efiemu"
70 ## grub2-extras bzr repo locations
72 _bzrtrunk_lua="bzr://bzr.savannah.gnu.org/grub-extras/lua/"
73 # _bzrtrunk_lua="lp:~the-ridikulus-rat/grub/grub2-extras-lua"
75 _bzrtrunk_ntldr_img="bzr://bzr.savannah.gnu.org/grub-extras/ntldr-img/"
76 # _bzrtrunk_ntldr_img="lp:~the-ridikulus-rat/grub/grub2-extras-ntldr-img"
78 _bzrtrunk_915resolution="bzr://bzr.savannah.gnu.org/grub-extras/915resolution/"
79 # _bzrtrunk_915resolution="lp:~the-ridikulus-rat/grub/grub2-extras-915resolution"
81 _bzrtrunk_gpxe="bzr://bzr.savannah.gnu.org/grub-extras/gpxe/"
82 # _bzrtrunk_gpxe="lp:~the-ridikulus-rat/grub/grub2-extras-gpxe"
87 msg "Connecting to BZR server..."
89 if [[ -d "${srcdir}/${_bzrmod}" ]]; then
90 cd "${srcdir}/${_bzrmod}"
91 bzr pull "${_bzrtrunk}"
92 msg "GRUB2 BZR Local repository updated."
95 bzr branch "${_bzrtrunk}" "${_bzrmod}"
96 msg "GRUB2 BZR repository cloned."
98 msg "BZR checkout done or server timeout"
100 if [[ -d "${srcdir}/${_bzrmod}/grub2-extras" ]]; then
101 cd "${srcdir}/${_bzrmod}/grub2-extras/"
103 if [[ -d "${srcdir}/${_bzrmod}/grub2-extras/lua" ]]; then
104 cd "${srcdir}/${_bzrmod}/grub2-extras/lua"
105 bzr pull "${_bzrtrunk_lua}"
108 bzr branch "${_bzrtrunk_lua}" lua
112 if [[ -d "${srcdir}/${_bzrmod}/grub2-extras/ntldr-img" ]]; then
113 cd "${srcdir}/${_bzrmod}/grub2-extras/ntldr-img"
114 bzr pull "${_bzrtrunk_ntldr_img}"
117 bzr branch "${_bzrtrunk_ntldr_img}" ntldr-img
121 if [[ -d "${srcdir}/${_bzrmod}/grub2-extras/915resolution" ]]; then
122 cd "${srcdir}/${_bzrmod}/grub2-extras/915resolution"
123 bzr pull "${_bzrtrunk_915resolution}"
126 bzr branch "${_bzrtrunk_915resolution}" 915resolution
130 if [[ -d "${srcdir}/${_bzrmod}/grub2-extras/gpxe" ]]; then
131 cd "${srcdir}/${_bzrmod}/grub2-extras/gpxe"
132 bzr pull "${_bzrtrunk_gpxe}"
135 bzr branch "${_bzrtrunk_gpxe}" gpxe
139 mkdir -p "${srcdir}/${_bzrmod}/grub2-extras/"
140 cd "${srcdir}/${_bzrmod}/grub2-extras/"
142 bzr branch "${_bzrtrunk_lua}" lua
144 bzr branch "${_bzrtrunk_ntldr_img}" ntldr-img
146 bzr branch "${_bzrtrunk_915resolution}" 915resolution
148 bzr branch "${_bzrtrunk_gpxe}" gpxe
152 cd "${srcdir}/${_bzrmod}/"
153 rsync -Lrtvz translationproject.org::tp/latest/grub/ "${srcdir}/${_bzrmod}/po"
154 (cd "${srcdir}/${_bzrmod}/po" && ls *.po | cut -d. -f1 | xargs) > "${srcdir}/${_bzrmod}/po/LINGUAS"
163 rm -rf "${srcdir}/${_bzrmod}_build" || true
165 cp -r "${srcdir}/${_bzrmod}" "${srcdir}/${_bzrmod}_build"
166 cd "${srcdir}/${_bzrmod}_build"
168 patch -Np1 -i "${srcdir}/grub2_automake_1.11.2_pkglib_to_pkgdata.patch"
171 patch -Np1 -i "${srcdir}/grub-mkconfig-Use_outside_GRUB_PREFIX_if_defined.patch"
174 patch -Np1 -i "${srcdir}/archlinux_grub2_mkconfig_fixes.patch"
177 rm -rf "${srcdir}/${_bzrmod}_build/grub2-extras/zfs" || true
179 export GRUB_CONTRIB="${srcdir}/${_bzrmod}_build/grub2-extras/"
181 ## The below step is not required as the script now executes with python3, hence makedepends change from python2 to python pkg
182 ## Seems like python2 is required again - as on 04-JAN-2012 - grub2 bzr mainline rev 3732
183 ## Need to use python2
184 install -D -m0755 "${srcdir}/${_bzrmod}_build/autogen.sh" "${srcdir}/${_bzrmod}_build/autogen_unmodified.sh"
185 sed 's|python |python2 |g' -i "${srcdir}/${_bzrmod}_build/autogen.sh"
188 "${srcdir}/${_bzrmod}_build/autogen.sh"
191 ## fix unifont.bdf location so grub-mkfont can create *.pf2 files
192 sed 's|/usr/share/fonts/unifont|/usr/share/fonts/misc|g' -i "${srcdir}/${_bzrmod}_build/configure"
194 mkdir -p "${srcdir}/${_bzrmod}_build/BUILD_BIOS"
195 cd "${srcdir}/${_bzrmod}_build/BUILD_BIOS"
197 CFLAGS="" ../configure \
198 --with-platform="pc" \
200 --host="${CARCH}-pc-linux-gnu" \
202 --enable-device-mapper \
203 --enable-cache-stats \
204 --enable-grub-mkfont \
205 --enable-grub-mount \
208 --bindir="/usr/bin" \
209 --sbindir="/usr/sbin" \
210 --mandir="/usr/share/man" \
211 --infodir="/usr/share/info" \
212 --datadir="/usr/lib" \
213 --datarootdir="/usr/share" \
214 --sysconfdir="/etc" \
215 --program-prefix="" \
226 cd "${srcdir}/${_bzrmod}_build/BUILD_BIOS"
227 make DESTDIR="${pkgdir}/" install
230 # move grub2 fonts from /usr/lib/grub to /usr/share/grub - incorrect path due to grub2_automake_1.11.2_pkglib_to_pkgdata.patch
231 mv "${pkgdir}/usr/lib/grub"/{ascii,euro,unicode}.pf2 "${pkgdir}/usr/share/grub/"
232 mv "${pkgdir}/usr/lib/grub"/{ascii,widthspec}.h "${pkgdir}/usr/share/grub/"
234 ## install /etc/default/grub
235 install -D -m0644 "${srcdir}/grub.default" "${pkgdir}/etc/default/grub"
237 ## install grub.cfg for /boot/grub/grub.cfg backup
238 install -D -m0644 "${srcdir}/grub.cfg.bios.example" "${pkgdir}/boot/grub/grub.cfg"
240 ## install memtest config detection
241 install -D -m0755 "${srcdir}/20_memtest86+" "${pkgdir}/etc/grub.d/20_memtest86+"