wok-next view grub2/receipt @ rev 21014
x265: fix build for i486 arch
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Sun Oct 14 11:28:22 2018 +0300 (2018-10-14) |
parents | 4afb940c15c1 |
children | d5aab818505e |
line source
1 # SliTaz package receipt v2.
3 PACKAGE="grub2"
4 VERSION="2.02"
5 CATEGORY="base-system"
6 SHORT_DESC="GRUB2 boot loader"
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL3"
9 WEB_SITE="http://www.gnu.org/software/grub/"
10 LFS="http://www.linuxfromscratch.org/lfs/view/stable/chapter06/grub.html"
11 REPOLOGY="grub"
13 TARBALL="grub-$VERSION.tar.xz"
14 WGET_URL="ftp://ftp.gnu.org/gnu/grub/$TARBALL"
16 BUILD_DEPENDS="flex bison zlib-dev xz-dev freetype-dev ncurses-dev \
17 libusb-compat-dev libusb-dev libdevmapper-dev"
18 SPLIT="grub2 grub2-efi:efi grub2-efi-modules:efi"
20 compile_rules() {
21 sed -i 's|sys/types.h>|&\n#include <sys/sysmacros.h>|' \
22 util/getroot.c grub-core/kern/emu/hostdisk.c
24 # CVE-2015-8370
25 sed -i "s/'.b'/& \\&\\& cur_len/" grub-core/lib/crypto.c grub-core/normal/auth.c
27 # Fixes for flex 2.5.37
28 export CFLAGS="-Wno-error=sign-compare -Wno-error=unused-value"
29 sed -i '/#undef gets/{N;s/.*/#ifdef gets\n&\n#endif/}' grub-core/gnulib/stdio*h
30 sed -i 's/YY_FATAL_ERROR/REMOVED_&/' grub-core/script/yylex.l
32 case $SET in
33 '')
34 #chmod +x install-sh
35 ./configure $CONFIGURE_ARGS &&
36 make $MAKEFLAGS &&
37 make DESTDIR=$DESTDIR install || return 1
39 # Example config file (grub.cfg)
40 install -Dm0644 $stuff/example-grub.cfg $install/boot/grub/example-grub.cfg
41 ;;
42 efi)
43 case $ARCH in
44 i?86) bootimg=bootia32.efi
45 EFI_ARCH=i386;;
46 x86_64) bootimg=bootx64.efi
47 EFI_ARCH=x86_64;;
48 esac
49 export EFI_ARCH
50 ./configure \
51 --with-platform=efi \
52 --target=$EFI_ARCH \
53 --program-prefix="" \
54 $CONFIGURE_ARGS &&
55 make clean &&
56 make $MAKEFLAGS || return 1
58 cd grub-core
59 ../grub-mkimage \
60 -d . \
61 -o ../$bootimg \
62 -O $EFI_ARCH-efi \
63 -p /boot/grub \
64 lsefisystab lssal lsefimmap lsacpi ls \
65 ntfs hfs appleldr boot cat efi_gop efi_uga elf fat hfsplus \
66 iso9660 linux keylayouts memdisk minicmd part_apple ext2 extcmd \
67 xfs xnu part_bsd part_gpt search search_fs_file chain btrfs \
68 loadbios loadenv lvm minix minix2 reiserfs memrw mmap msdospart \
69 scsi loopback normal configfile gzio all_video \
70 gfxterm gettext echo || return 1
72 install -Dm644 $src/$bootimg $install/boot/efi/boot/$bootimg
73 ;;
74 esac
75 }
77 genpkg_rules() {
78 case $PACKAGE in
79 grub2)
80 copy @std
81 DEPENDS="zlib freetype ncurses libusb-compat grep libusb libdevmapper"
82 TAGS="LFS"
83 ;;
84 grub2-efi)
85 copy @std
86 DEPENDS=" "
87 ;;
88 grub2-efi-modules)
89 DEPENDS="grub2-efi"
90 case $ARCH in
91 i?86) efi_path=boot/efi/grub/i386-efi;;
92 x86_64) efi_path=boot/efi/grub/x86_64-efi;;
93 esac
94 mkdir -p $fs/$efi_path
95 cp $src/grub-core/*.mod $src/grub-core/*.lst $fs/$efi_path
96 ;;
97 esac
98 }
100 post_install_grub2() {
101 [ -n "$quiet" ] || cat <<EOT
103 .-------------------------------------------------------.
104 | # To install grub to your sda MBR |
105 | grub-install /dev/sda |
106 |-------------------------------------------------------|
107 | # To generate a configuration file |
108 | grub-mkconfig -o /boot/grub/grub.cfg |
109 |-------------------------------------------------------|
110 | # You can learn from /boot/grub/example-grub.cfg too. |
111 '-------------------------------------------------------'
112 EOT
113 }