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 '7a15350c6e5f78ac7eb60fbb8cdbbf05d4139a71c1c9023c47ca9d3ab948f323'
36 'dc21fdb3b9b1b268270c81a75c391e29201c8f24678566cb6508fdcdf06bb745'
37 '4f8da2c06f78cec02362be0068b3ceb6861e923ac729c02937a2e89ab0035974')
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 --datarootdir="/usr/share" \
213 --sysconfdir="/etc" \
214 --program-prefix="" \
225 cd "${srcdir}/${_bzrmod}_build/BUILD_BIOS"
226 make DESTDIR="${pkgdir}/" install
229 ## move grub2 fonts from /usr/lib/grub to /usr/share/grub - incorrect path due to grub2_automake_1.11.2_pkglib_to_pkgdata.patch
230 # mv "${pkgdir}/usr/lib/grub"/{ascii,euro,unicode}.pf2 "${pkgdir}/usr/share/grub/"
231 # mv "${pkgdir}/usr/lib/grub"/{ascii,widthspec}.h "${pkgdir}/usr/share/grub/"
233 ## install /etc/default/grub
234 install -D -m0644 "${srcdir}/grub.default" "${pkgdir}/etc/default/grub"
236 ## install grub.cfg for /boot/grub/grub.cfg backup
237 install -D -m0644 "${srcdir}/grub.cfg.bios.example" "${pkgdir}/boot/grub/grub.cfg"
239 ## install memtest config detection
240 install -D -m0755 "${srcdir}/20_memtest86+" "${pkgdir}/etc/grub.d/20_memtest86+"