diff options
-rw-r--r-- | sys-block/vblade/files/vblade-24-fno-common.patch | 48 | ||||
-rw-r--r-- | sys-block/vblade/files/vblade-24-makefile.patch | 35 | ||||
-rw-r--r-- | sys-block/vblade/vblade-24.ebuild | 19 |
3 files changed, 92 insertions, 10 deletions
diff --git a/sys-block/vblade/files/vblade-24-fno-common.patch b/sys-block/vblade/files/vblade-24-fno-common.patch new file mode 100644 index 000000000000..2a51ddea4708 --- /dev/null +++ b/sys-block/vblade/files/vblade-24-fno-common.patch @@ -0,0 +1,48 @@ +Taken from: https://github.com/OpenAoE/vblade/pull/15 +Author: Andreas Kölbl <koelblandreas@freenet.de> + +--- /dev/null ++++ b/dat.c +@@ -0,0 +1,12 @@ ++/* dat.c: Global memory for vblade AoE target */ ++#include "dat.h" ++ ++int shelf, slot; ++ulong aoetag; ++uchar mac[6]; ++int bfd; // block file descriptor ++int sfd; // socket file descriptor ++vlong size; // size of vblade ++vlong offset; ++char *progname; ++char serial[Nserial+1]; +--- a/dat.h ++++ b/dat.h +@@ -1,4 +1,5 @@ + /* dat.h: include file for vblade AoE target */ ++#include <sys/types.h> + + #define nil ((void *)0) + /* +@@ -163,12 +164,12 @@ enum { + Nserial= 20, + }; + +-int shelf, slot; +-ulong aoetag; +-uchar mac[6]; +-int bfd; // block file descriptor +-int sfd; // socket file descriptor +-vlong size; // size of vblade +-vlong offset; +-char *progname; +-char serial[Nserial+1]; ++extern int shelf, slot; ++extern ulong aoetag; ++extern uchar mac[6]; ++extern int bfd; // block file descriptor ++extern int sfd; // socket file descriptor ++extern vlong size; // size of vblade ++extern vlong offset; ++extern char *progname; ++extern char serial[Nserial+1]; diff --git a/sys-block/vblade/files/vblade-24-makefile.patch b/sys-block/vblade/files/vblade-24-makefile.patch new file mode 100644 index 000000000000..ed5efb2c2e23 --- /dev/null +++ b/sys-block/vblade/files/vblade-24-makefile.patch @@ -0,0 +1,35 @@ +--- a/makefile ++++ b/makefile +@@ -8,27 +8,22 @@ + sharedir = ${prefix}/share + mandir = ${sharedir}/man + +-O=aoe.o bpf.o ${PLATFORM}.o ata.o +-CFLAGS += -Wall -g -O2 +-CC = gcc ++O=aoe.o bpf.o ${PLATFORM}.o ata.o dat.o ++CFLAGS += -Wall + + vblade: $O +- ${CC} -o vblade $O ++ ${CC} ${LDFLAGS} -o vblade $O ${LIBS} + + aoe.o : aoe.c config.h dat.h fns.h makefile +- ${CC} ${CFLAGS} -c $< + + ${PLATFORM}.o : ${PLATFORM}.c config.h dat.h fns.h makefile +- ${CC} ${CFLAGS} -c $< + + ata.o : ata.c config.h dat.h fns.h makefile +- ${CC} ${CFLAGS} -c $< + +-bpf.o : bpf.c +- ${CC} ${CFLAGS} -c $< ++dat.o : dat.c + + config.h : config/config.h.in makefile +- @if ${CC} ${CFLAGS} config/u64.c > /dev/null 2>&1; then \ ++ @if ${CC} ${CFLAGS} ${CPPFLAGS} config/u64.c > /dev/null 2>&1; then \ + sh -xc "cp config/config.h.in config.h"; \ + else \ + sh -xc "sed 's!^//u64 !!' config/config.h.in > config.h"; \ diff --git a/sys-block/vblade/vblade-24.ebuild b/sys-block/vblade/vblade-24.ebuild index 418e75559d0c..e8ee9b2db33c 100644 --- a/sys-block/vblade/vblade-24.ebuild +++ b/sys-block/vblade/vblade-24.ebuild @@ -1,7 +1,7 @@ # Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI="6" +EAPI=7 inherit toolchain-funcs @@ -17,23 +17,22 @@ RDEPEND="sys-apps/util-linux" S="${WORKDIR}/${PN}-${P}" -src_prepare() { - default +PATCHES=( + "${FILESDIR}"/${P}-fno-common.patch + "${FILESDIR}"/${P}-makefile.patch +) - sed -i -e 's,^CFLAGS.*,CFLAGS += -Wall,' \ - -e 's:-o vblade:${LDFLAGS} \0:' \ - makefile || die -} - -src_compile() { - emake CC="$(tc-getCC)" +src_configure() { + tc-export CC } src_install() { dosbin vblade dosbin "${FILESDIR}"/vbladed + doman vblade.8 dodoc HACKING NEWS README + newconfd "${FILESDIR}"/conf.d-vblade vblade newinitd "${FILESDIR}"/init.d-vblade.vblade0-r2 vblade.vblade0 } |