Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/libx86emu/files/, dev-libs/libx86emu/
Date: Sun, 09 Feb 2020 23:05:54
Message-Id: 1581289510.d332eb47396f2afcd46f59a3aeec3c962f860552.soap@gentoo
1 commit: d332eb47396f2afcd46f59a3aeec3c962f860552
2 Author: David Seifert <soap <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 9 23:05:10 2020 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 9 23:05:10 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d332eb47
7
8 dev-libs/libx86emu: Port to EAPI 7
9
10 Closes: https://bugs.gentoo.org/684466
11 Closes: https://bugs.gentoo.org/706558
12 Package-Manager: Portage-2.3.88, Repoman-2.3.20
13 Signed-off-by: David Seifert <soap <AT> gentoo.org>
14
15 .../files/libx86emu-1.1-fix-makefile.patch | 82 ++++++++++++++++++++++
16 .../files/libx86emu-1.1-gcc10-fno-common.patch | 13 ++++
17 dev-libs/libx86emu/libx86emu-1.1.ebuild | 28 +++-----
18 3 files changed, 104 insertions(+), 19 deletions(-)
19
20 diff --git a/dev-libs/libx86emu/files/libx86emu-1.1-fix-makefile.patch b/dev-libs/libx86emu/files/libx86emu-1.1-fix-makefile.patch
21 new file mode 100644
22 index 00000000000..6e565340e67
23 --- /dev/null
24 +++ b/dev-libs/libx86emu/files/libx86emu-1.1-fix-makefile.patch
25 @@ -0,0 +1,82 @@
26 +--- a/Makefile
27 ++++ b/Makefile
28 +@@ -1,15 +1,4 @@
29 +-ARCH := $(shell uname -m)
30 +-ifneq ($(filter i386 i486 i586 i686, $(ARCH)),)
31 +-ARCH := i386
32 +-endif
33 +-
34 +-CC = gcc
35 +-CFLAGS = -g -O2 -fPIC -fomit-frame-pointer -Wall
36 +-ifneq ($(filter x86_64, $(ARCH)),)
37 +-LIBDIR = /usr/lib64
38 +-else
39 +-LIBDIR = /usr/lib
40 +-endif
41 ++CFLAGS += -fPIC -Wall
42 + LIBX86 = libx86emu
43 +
44 + VERSION := $(shell cat VERSION)
45 +@@ -24,9 +13,6 @@
46 +
47 + .PHONY: all shared install test clean
48 +
49 +-%.o: %.c
50 +- $(CC) -c $(CFLAGS) $<
51 +-
52 + all: shared
53 +
54 + shared: $(LIB_NAME)
55 +@@ -38,13 +24,15 @@
56 + install -m 644 -D include/x86emu.h $(DESTDIR)/usr/include/x86emu.h
57 +
58 + $(LIB_NAME): .depend $(OBJS)
59 +- $(CC) -shared -Wl,-soname,$(LIB_SONAME) $(OBJS) -o $(LIB_NAME)
60 ++ $(CC) $(LDFLAGS) -shared -Wl,-soname,$(LIB_SONAME) $(OBJS) -o $(LIB_NAME)
61 ++ ln -snf $(LIB_NAME) $(LIB_SONAME)
62 ++ ln -snf $(LIB_SONAME) $(LIBX86).so
63 +
64 +-test:
65 +- make -C test
66 ++check:
67 ++ $(MAKE) -C test
68 +
69 + clean:
70 +- make -C test clean
71 ++ $(MAKE) -C test clean
72 + rm -f *.o *~ include/*~ *.so.* .depend
73 +
74 + ifneq "$(MAKECMDGOALS)" "clean"
75 +--- a/test/Makefile
76 ++++ b/test/Makefile
77 +@@ -1,9 +1,10 @@
78 +-CC = gcc
79 +-CFLAGS = -g -Wall -fomit-frame-pointer -O2
80 ++CFLAGS += -fPIC -Wall
81 ++CPPFLAGS += -I../include
82 + TST_FILES = $(wildcard *.tst)
83 + INIT_FILES = $(addsuffix .init,$(basename $(wildcard *.tst)))
84 + RES_FILES = $(addsuffix .result,$(basename $(wildcard *.tst)))
85 + TEST_OPTS = --verbose --show code,regs,data,acc,io,ints,attr,time
86 ++LDLIBS = -L.. -lx86emu
87 +
88 + .PHONY: all test clean
89 + .SECONDARY: $(INIT_FILES)
90 +@@ -12,13 +13,12 @@
91 +
92 + all: x86test
93 + @./prepare_test *.tst
94 +- @./x86test $(TEST_OPTS) *.init
95 ++ @LD_LIBRARY_PATH=.. ./x86test $(TEST_OPTS) *.init
96 +
97 +-x86test: x86test.c
98 +- $(CC) $(CFLAGS) $< -lx86emu -o $@
99 ++x86test: x86test.o
100 +
101 +-%.result: %.init
102 +- @./x86test $(TEST_OPTS) $<
103 ++%.result: %.init x86test
104 ++ @LD_LIBRARY_PATH=.. ./x86test $(TEST_OPTS) $<
105 +
106 + %.init: %.tst
107 + @./prepare_test $<
108
109 diff --git a/dev-libs/libx86emu/files/libx86emu-1.1-gcc10-fno-common.patch b/dev-libs/libx86emu/files/libx86emu-1.1-gcc10-fno-common.patch
110 new file mode 100644
111 index 00000000000..8d69e874523
112 --- /dev/null
113 +++ b/dev-libs/libx86emu/files/libx86emu-1.1-gcc10-fno-common.patch
114 @@ -0,0 +1,13 @@
115 +--- a/include/ops.h
116 ++++ b/include/ops.h
117 +@@ -39,8 +39,8 @@
118 + #ifndef __X86EMU_OPS_H
119 + #define __X86EMU_OPS_H
120 +
121 +-void (*x86emu_optab[0x100])(u8 op1) L_SYM;
122 +-void (*x86emu_optab2[0x100])(u8 op2) L_SYM;
123 ++extern void (*x86emu_optab[0x100])(u8 op1) L_SYM;
124 ++extern void (*x86emu_optab2[0x100])(u8 op2) L_SYM;
125 +
126 + void decode_cond(int type) L_SYM;
127 +
128
129 diff --git a/dev-libs/libx86emu/libx86emu-1.1.ebuild b/dev-libs/libx86emu/libx86emu-1.1.ebuild
130 index b8392b9291f..21c131149a9 100644
131 --- a/dev-libs/libx86emu/libx86emu-1.1.ebuild
132 +++ b/dev-libs/libx86emu/libx86emu-1.1.ebuild
133 @@ -1,9 +1,9 @@
134 -# Copyright 1999-2017 Gentoo Foundation
135 +# Copyright 1999-2020 Gentoo Authors
136 # Distributed under the terms of the GNU General Public License v2
137
138 -EAPI=4
139 +EAPI=7
140
141 -inherit multilib rpm toolchain-funcs
142 +inherit rpm toolchain-funcs
143
144 DESCRIPTION="A library for emulating x86"
145 HOMEPAGE="https://www.opensuse.org/"
146 @@ -12,24 +12,14 @@ SRC_URI="https://download.opensuse.org/source/factory/repo/oss/suse/src/${P}-9.8
147 LICENSE="HPND"
148 SLOT="0"
149 KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
150 -IUSE=""
151
152 -src_prepare() {
153 - sed -i \
154 - -e 's:$(CC) -shared:& $(LDFLAGS):' \
155 - Makefile || die
156 -}
157 -
158 -src_compile() {
159 - emake CC="$(tc-getCC)" CFLAGS="${CFLAGS} -fPIC -Wall"
160 -}
161 +PATCHES=(
162 + "${FILESDIR}"/${PN}-1.1-fix-makefile.patch
163 + "${FILESDIR}"/${PN}-1.1-gcc10-fno-common.patch
164 +)
165
166 -src_test() {
167 - ln -sf libx86emu.so.1.1 libx86emu.so || die
168 - ln -sf libx86emu.so.1.1 libx86emu.so.1 || die
169 - emake \
170 - CC="$(tc-getCC)" \
171 - CFLAGS="${CFLAGS} ${LDFLAGS} -Wl,-rpath,${S} -fPIC -Wall -I../include/ -L../" test
172 +src_configure() {
173 + tc-export CC
174 }
175
176 src_install() {