summaryrefslogtreecommitdiff
path: root/repo/grub/grub.xibuild
blob: 696055a92484cf25d0c7934a0ce520c43097be3e (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
#!/bin/sh

MAKEDEPS="make sh xz gettext efibootmgr freetype2"
DEPS="efibootmgr"

PKG_VER=2.06
SOURCE=https://ftp.gnu.org/gnu/grub/grub-$PKG_VER.tar.xz
ADDITIONAL="
    https://unifoundry.com/pub/unifont/unifont-13.0.06/font-builds/unifont-13.0.06.pcf.gz
    "


DESC="GNU GRand Unified Bootloader v2"

flavours="bios efi"

prepare () {

    unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
    for f in $flavours; do
        mkdir $BUILD_ROOT/build-$f
        tar -C build-$f -xvf grub-$PKG_VER.tar.xz
    done
}

build () {
    for f in $flavours; do
        cd $BUILD_ROOT/build-$f/grub-$PKG_VER
        case "$f" in
            bios) opts="--with-platform=pc";;
            efi) opts="--with-platform=efi --disable-efiemu";;
        esac

        ./configure --prefix=/usr --sysconfdir=/etc --disable-werror \
            --enable-grub-mkfont $opts
        make 
    done

}

package () {
    for f in $flavours; do
        cd $BUILD_ROOT/build-$f/grub-$PKG_VER
        make DESTDIR=$PKG_DEST install-strip
    done
    cd $BUILD_ROOT

    mkdir -p $PKG_DEST/usr/share/bash-completion/completions
    mv $PKG_DEST/etc/bash_completion.d/grub $PKG_DEST/usr/share/bash-completion/completions
    mkdir -p $PKG_DEST/etc/default
    cat > $PKG_DEST/etc/default/grub << "EOF"
# GRUB boot loader configuration

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="XiLinux"

GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX=""

EOF

    mkdir -p $PKG_DEST/usr/share/fonts/unifont
    gunzip -c unifont-13.0.06.pcf.gz > $PKG_DEST/usr/share/fonts/unifont/unifont.pcf
}