Gentoo Archives: gentoo-commits

From: Arsen Arsenovic <arsen@××××××.me>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:dev commit in: sys-boot/limine/, sys-boot/limine/files/
Date: Tue, 08 Feb 2022 14:50:01
Message-Id: 1644331659.6a8d6a672e27536c0dd6550fe51802b10ba79325.arsen@gentoo
1 commit: 6a8d6a672e27536c0dd6550fe51802b10ba79325
2 Author: Arsen Arsenović <arsen <AT> aarsen <DOT> me>
3 AuthorDate: Tue Feb 8 14:06:00 2022 +0000
4 Commit: Arsen Arsenovic <arsen <AT> aarsen <DOT> me>
5 CommitDate: Tue Feb 8 14:47:39 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=6a8d6a67
7
8 sys-boot/limine: new package
9
10 Package-Manager: Portage-3.0.30, Repoman-3.0.3
11 Signed-off-by: Arsen Arsenović <arsen <AT> aarsen.me>
12
13 sys-boot/limine/Manifest | 1 +
14 ...ke-eltorito-efi-build-manually-toggleable.patch | 66 ++++++++++++++++++++++
15 sys-boot/limine/limine-2.83.ebuild | 40 +++++++++++++
16 sys-boot/limine/metadata.xml | 13 +++++
17 4 files changed, 120 insertions(+)
18
19 diff --git a/sys-boot/limine/Manifest b/sys-boot/limine/Manifest
20 new file mode 100644
21 index 000000000..036c455d6
22 --- /dev/null
23 +++ b/sys-boot/limine/Manifest
24 @@ -0,0 +1 @@
25 +DIST limine-2.83.tar.xz 1561172 BLAKE2B 2b91ca239147f6eede40b5bb21c6a3a5c44157bcaacf2bf49bf7b39471c60bd866dc499b54ab9a853d64d3db34c19544f8c7d5b657d3c73c5323314e579f2121 SHA512 716866615734fdfdbc3e947d2a02b194505e96428438c71622bdb05e48d6e700d9fd87660ae6a0e03aef8365c98adc2f51821783d6f14296380095afa6ca924b
26
27 diff --git a/sys-boot/limine/files/limine-2.83-build-Make-eltorito-efi-build-manually-toggleable.patch b/sys-boot/limine/files/limine-2.83-build-Make-eltorito-efi-build-manually-toggleable.patch
28 new file mode 100644
29 index 000000000..0ca799d15
30 --- /dev/null
31 +++ b/sys-boot/limine/files/limine-2.83-build-Make-eltorito-efi-build-manually-toggleable.patch
32 @@ -0,0 +1,66 @@
33 +From 23ee0bf491d077e3c022028cf7040dd5a7597e94 Mon Sep 17 00:00:00 2001
34 +From: mintsuki <mintsuki@××××××××××.com>
35 +Date: Tue, 8 Feb 2022 15:35:54 +0100
36 +Subject: [PATCH] build: Make eltorito-efi build manually toggleable
37 +
38 +---
39 +Pulled from upstream
40 +
41 + GNUmakefile.in | 4 ++++
42 + configure.ac | 11 +++++++++++
43 + 2 files changed, 15 insertions(+)
44 +
45 +diff --git a/GNUmakefile.in b/GNUmakefile.in
46 +index 334f7c66..fcb7d6ef 100644
47 +--- a/GNUmakefile.in
48 ++++ b/GNUmakefile.in
49 +@@ -16,6 +16,8 @@ NASMESCAPE = $(subst ','"'$(COMMA) \"'\"$(COMMA) '"',$(1))
50 + override PATH := $(BUILDDIR)/toolchain/bin:/usr/local/bin:$(PATH)
51 + export PATH
52 +
53 ++override BUILD_ELTORITO_EFI := @build_eltorito_efi@
54 ++
55 + WERROR ?= @werror@
56 + export WERROR
57 +
58 +@@ -140,6 +142,7 @@ limine-bios: common-bios decompressor
59 +
60 + .PHONY: limine-eltorito-efi
61 + limine-eltorito-efi:
62 ++ifeq ($(BUILD_ELTORITO_EFI), yes)
63 + mkdir -p '$(call SHESCAPE,$(BINDIR))'
64 + dd if=/dev/zero of='$(call SHESCAPE,$(BINDIR))/limine-eltorito-efi.bin' bs=512 count=2880 2>/dev/null
65 + ( mformat -i '$(call SHESCAPE,$(BINDIR))/limine-eltorito-efi.bin' -f 1440 :: && \
66 +@@ -150,6 +153,7 @@ limine-eltorito-efi:
67 + ( ( [ -f '$(call SHESCAPE,$(BUILDDIR))/common-uefi32/BOOTIA32.EFI' ] && \
68 + mcopy -D o -i '$(call SHESCAPE,$(BINDIR))/limine-eltorito-efi.bin' '$(call SHESCAPE,$(BUILDDIR))/common-uefi32/BOOTIA32.EFI' ::/EFI/BOOT ) || true ) \
69 + ) || rm -f '$(call SHESCAPE,$(BINDIR))/limine-eltorito-efi.bin'
70 ++endif
71 +
72 + .PHONY: limine-uefi
73 + limine-uefi: limine-uefi32 limine-uefi64
74 +diff --git a/configure.ac b/configure.ac
75 +index 1d1315d6..4a4b521a 100644
76 +--- a/configure.ac
77 ++++ b/configure.ac
78 +@@ -41,9 +41,20 @@ if ! test "x$GZIP_FOUND" = "xyes"; then
79 + AC_MSG_ERROR([gzip not found, please install gzip before configuring])
80 + fi
81 +
82 ++BUILD_ELTORITO_EFI="yes"
83 ++
84 ++AC_ARG_ENABLE([eltorito-efi],
85 ++ AS_HELP_STRING([--disable-eltorito-efi], [disable limine-eltorito-efi.bin build]),
86 ++ BUILD_ELTORITO_EFI="$enableval")
87 ++
88 + AC_CHECK_PROG([MTOOLS_FOUND], [mcopy], [yes])
89 + if ! test "x$MTOOLS_FOUND" = "xyes"; then
90 + AC_MSG_WARN([mtools not found, install mtools to build limine-eltorito-efi.bin])
91 ++ BUILD_ELTORITO_EFI="no"
92 ++fi
93 ++
94 ++if test "$BUILD_ELTORITO_EFI" = "yes"; then
95 ++ AC_SUBST(build_eltorito_efi, [yes])
96 + fi
97 +
98 + AC_ARG_VAR(HOST_CC, [C compiler for the build host [default: $CC]])
99
100 diff --git a/sys-boot/limine/limine-2.83.ebuild b/sys-boot/limine/limine-2.83.ebuild
101 new file mode 100644
102 index 000000000..368163337
103 --- /dev/null
104 +++ b/sys-boot/limine/limine-2.83.ebuild
105 @@ -0,0 +1,40 @@
106 +# Copyright 1999-2022 Gentoo Authors
107 +# Distributed under the terms of the GNU General Public License v2
108 +
109 +EAPI=8
110 +
111 +WANT_LIBTOOL=none
112 +inherit autotools
113 +
114 +DESCRIPTION="Limine is a modern, advanced x86/x86_64 BIOS/UEFI multiprotocol bootloader."
115 +HOMEPAGE="https://limine-bootloader.org/"
116 +SRC_URI="https://github.com/limine-bootloader/limine/releases/download/v${PV}/limine-${PV}.tar.xz"
117 +
118 +LICENSE="BSD-2"
119 +SLOT="0"
120 +KEYWORDS="~amd64"
121 +IUSE="+eltorito-efi"
122 +
123 +BDEPEND="
124 + sys-apps/findutils
125 + dev-lang/nasm
126 + app-arch/gzip
127 + eltorito-efi? ( sys-fs/mtools )
128 +"
129 +PATCHES="
130 + ${FILESDIR}/${PN}-2.83-build-Make-eltorito-efi-build-manually-toggleable.patch
131 +"
132 +
133 +src_prepare() {
134 + default
135 +
136 + eautoreconf
137 +}
138 +
139 +src_configure() {
140 + local myconf=(
141 + $(use_enable eltorito-efi)
142 + )
143 +
144 + econf "${myconf[@]}"
145 +}
146
147 diff --git a/sys-boot/limine/metadata.xml b/sys-boot/limine/metadata.xml
148 new file mode 100644
149 index 000000000..bd468f6c4
150 --- /dev/null
151 +++ b/sys-boot/limine/metadata.xml
152 @@ -0,0 +1,13 @@
153 +<?xml version="1.0" encoding="UTF-8"?>
154 +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
155 +<pkgmetadata>
156 + <maintainer type="person">
157 + <email>arsen@××××××.me</email>
158 + <name>Arsen Arsenović</name>
159 + </maintainer>
160 + <use>
161 + <flag name="eltorito-efi">
162 + Enable building eltorito-efi.bin using <pkg>sys-fs/mtools</pkg>
163 + </flag>
164 + </use>
165 +</pkgmetadata>