diff gnu/grub/grub.sh @ 1222:325631424c65

misc: bring back build function
author David Demelier <markand@malikania.fr>
date Wed, 27 Oct 2021 11:32:16 +0200
parents a47aaf9743a0
children
line wrap: on
line diff
--- a/gnu/grub/grub.sh	Fri Oct 15 16:07:30 2021 +0200
+++ b/gnu/grub/grub.sh	Wed Oct 27 11:32:16 2021 +0200
@@ -77,7 +77,7 @@
 		--build=$CBUILD \
 		--host=$CHOST \
 		--target=$CTARGET \
-		--prefix=/usr \
+		--prefix= \
 		--sbindir=/bin \
 		--disable-werror \
 		$with_lzma \
@@ -90,24 +90,27 @@
 	rm -rf build
 }
 
-rm -rf $PKGNAME-$PKGVERSION
-tar xvf $PKGNAME-$PKGVERSION.tar.xz
-cd $PKGNAME-$PKGVERSION
+build()
+{
+	rm -rf $PKGNAME-$PKGVERSION
+	tar xvf $PKGNAME-$PKGVERSION.tar.xz
+	cd $PKGNAME-$PKGVERSION
 
-if [ "$CC" = "clang" ]; then
-	patch -p0 < ../patch-clang.patch
-fi
+	if [ "$CC" = "clang" ]; then
+		patch -p0 < ../patch-clang.patch
+	fi
 
-for p in $platforms; do
-	case $p in
-	efi)
-		build_grub --with-platform=$p --disable-efiemu
-		;;
-	*)
-		build_grub --with-platform=$p
-		;;
-	esac
-done
+	for p in $platforms; do
+		case $p in
+		efi)
+			build_grub --with-platform=$p --disable-efiemu
+			;;
+		*)
+			build_grub --with-platform=$p
+			;;
+		esac
+	done
 
-cd ..
-rm -rf $PKGNAME-$PKGVERSION
+	cd ..
+	rm -rf $PKGNAME-$PKGVERSION
+}