summaryrefslogtreecommitdiff
path: root/dev-libs/libx86emu
diff options
context:
space:
mode:
Diffstat (limited to 'dev-libs/libx86emu')
-rw-r--r--dev-libs/libx86emu/Manifest4
-rw-r--r--dev-libs/libx86emu/files/libx86emu-1.1-fix-makefile.patch82
-rw-r--r--dev-libs/libx86emu/files/libx86emu-1.1-gcc10-fno-common.patch13
-rw-r--r--dev-libs/libx86emu/libx86emu-1.1.ebuild28
4 files changed, 107 insertions, 20 deletions
diff --git a/dev-libs/libx86emu/Manifest b/dev-libs/libx86emu/Manifest
index 006724f9468c..e1b38c84dc8b 100644
--- a/dev-libs/libx86emu/Manifest
+++ b/dev-libs/libx86emu/Manifest
@@ -1,3 +1,5 @@
+AUX libx86emu-1.1-fix-makefile.patch 1885 BLAKE2B dd89e7cc3a9b0ce336607a62f3e83be02fab3db01755144a322ccab44cfe3a93ca69298290c0d377e3792f9ba63d2fd8054afbf641f3e2f26cbd40b791c8fb49 SHA512 c62ceb8eaec38cb401016ed72332cf54125faf10dcb123714afc700bfec304fe1cb3e96f798c28218475f50f3941ad33277b0dc4f5874a0a9be67005b4db14df
+AUX libx86emu-1.1-gcc10-fno-common.patch 339 BLAKE2B f74fac4b1e8ad0251a3e0dbd2be7e9301e914a0acfa341a044d88cc6d251d9da7b8fd0b9e44a49f44a0a2e895cbd84351e7dcfaa0c2efb50c4de910ab71d6332 SHA512 c8ccccc91780dd2d467588576947891b25b9e02ae23b20ce48de9246cd37c2ec6d2fc4b5472bdfd8f569f6f1efeb85a826a2b848b609f7fff980c0477c1b82a2
DIST libx86emu-1.1-9.8.src.rpm 59517 BLAKE2B 6ae5b7792b9b67b93d12e9908e9941417e4149ed6289e0d02b23710ae4295d74aae806d85b0a0aa719eee6d63725b161dd8870d92b5352383a0beee5ce7827c9 SHA512 cb44306bb76feb47d46f1f3dd92cc6bf694dcc2c42d191fd9ff9f0b68744aeb25e99b29336e5ffe67e9a3d02c51d56690429b892d7fd26438dcc1d6603e18bcb
-EBUILD libx86emu-1.1.ebuild 886 BLAKE2B 56f0048eda88ca0438ecce4de862c92ed0443385eb9918edcd522e4b538b52e66aee51ec4a4c995476d1cac0f3cf4d0c2319788d87a57e6a0612c0e22d6fadac SHA512 d8923437491b4e5711029cf7b6dcfa732cfe280894337c05116400ba0b14a3cb8077858c49035487389ddac9d37c33430339dee8d4d7af070379ad6d96fae739
+EBUILD libx86emu-1.1.ebuild 623 BLAKE2B 00684cacf83c68f69685ee76d37f04f5fb627b42e8bdd9d09b22e7c65009d6a1cf0647e7b9d8d4c41735b3ea5a5edadf8affc1cccf5cbcd8812912ce9c70ac41 SHA512 7930ab8a012526a85ac04ecaa4d168a9ca907277eb51665cffd0de0ead1638c3dd2a08b895f2a8ed10a7cabaa9f70e816f6b840ce2d3388deb27bb8682e64c59
MISC metadata.xml 166 BLAKE2B c254f1fb642881aba57637be14fb0a89b10384f91a128feaec3a8c870d76efc2cbacb92caccc0dee2dd19a5ac5eaf8643080dafa05c4e2ac96a68568927e5afd SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84
diff --git a/dev-libs/libx86emu/files/libx86emu-1.1-fix-makefile.patch b/dev-libs/libx86emu/files/libx86emu-1.1-fix-makefile.patch
new file mode 100644
index 000000000000..6e565340e67b
--- /dev/null
+++ b/dev-libs/libx86emu/files/libx86emu-1.1-fix-makefile.patch
@@ -0,0 +1,82 @@
+--- a/Makefile
++++ b/Makefile
+@@ -1,15 +1,4 @@
+-ARCH := $(shell uname -m)
+-ifneq ($(filter i386 i486 i586 i686, $(ARCH)),)
+-ARCH := i386
+-endif
+-
+-CC = gcc
+-CFLAGS = -g -O2 -fPIC -fomit-frame-pointer -Wall
+-ifneq ($(filter x86_64, $(ARCH)),)
+-LIBDIR = /usr/lib64
+-else
+-LIBDIR = /usr/lib
+-endif
++CFLAGS += -fPIC -Wall
+ LIBX86 = libx86emu
+
+ VERSION := $(shell cat VERSION)
+@@ -24,9 +13,6 @@
+
+ .PHONY: all shared install test clean
+
+-%.o: %.c
+- $(CC) -c $(CFLAGS) $<
+-
+ all: shared
+
+ shared: $(LIB_NAME)
+@@ -38,13 +24,15 @@
+ install -m 644 -D include/x86emu.h $(DESTDIR)/usr/include/x86emu.h
+
+ $(LIB_NAME): .depend $(OBJS)
+- $(CC) -shared -Wl,-soname,$(LIB_SONAME) $(OBJS) -o $(LIB_NAME)
++ $(CC) $(LDFLAGS) -shared -Wl,-soname,$(LIB_SONAME) $(OBJS) -o $(LIB_NAME)
++ ln -snf $(LIB_NAME) $(LIB_SONAME)
++ ln -snf $(LIB_SONAME) $(LIBX86).so
+
+-test:
+- make -C test
++check:
++ $(MAKE) -C test
+
+ clean:
+- make -C test clean
++ $(MAKE) -C test clean
+ rm -f *.o *~ include/*~ *.so.* .depend
+
+ ifneq "$(MAKECMDGOALS)" "clean"
+--- a/test/Makefile
++++ b/test/Makefile
+@@ -1,9 +1,10 @@
+-CC = gcc
+-CFLAGS = -g -Wall -fomit-frame-pointer -O2
++CFLAGS += -fPIC -Wall
++CPPFLAGS += -I../include
+ TST_FILES = $(wildcard *.tst)
+ INIT_FILES = $(addsuffix .init,$(basename $(wildcard *.tst)))
+ RES_FILES = $(addsuffix .result,$(basename $(wildcard *.tst)))
+ TEST_OPTS = --verbose --show code,regs,data,acc,io,ints,attr,time
++LDLIBS = -L.. -lx86emu
+
+ .PHONY: all test clean
+ .SECONDARY: $(INIT_FILES)
+@@ -12,13 +13,12 @@
+
+ all: x86test
+ @./prepare_test *.tst
+- @./x86test $(TEST_OPTS) *.init
++ @LD_LIBRARY_PATH=.. ./x86test $(TEST_OPTS) *.init
+
+-x86test: x86test.c
+- $(CC) $(CFLAGS) $< -lx86emu -o $@
++x86test: x86test.o
+
+-%.result: %.init
+- @./x86test $(TEST_OPTS) $<
++%.result: %.init x86test
++ @LD_LIBRARY_PATH=.. ./x86test $(TEST_OPTS) $<
+
+ %.init: %.tst
+ @./prepare_test $<
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
new file mode 100644
index 000000000000..8d69e874523d
--- /dev/null
+++ b/dev-libs/libx86emu/files/libx86emu-1.1-gcc10-fno-common.patch
@@ -0,0 +1,13 @@
+--- a/include/ops.h
++++ b/include/ops.h
+@@ -39,8 +39,8 @@
+ #ifndef __X86EMU_OPS_H
+ #define __X86EMU_OPS_H
+
+-void (*x86emu_optab[0x100])(u8 op1) L_SYM;
+-void (*x86emu_optab2[0x100])(u8 op2) L_SYM;
++extern void (*x86emu_optab[0x100])(u8 op1) L_SYM;
++extern void (*x86emu_optab2[0x100])(u8 op2) L_SYM;
+
+ void decode_cond(int type) L_SYM;
+
diff --git a/dev-libs/libx86emu/libx86emu-1.1.ebuild b/dev-libs/libx86emu/libx86emu-1.1.ebuild
index b8392b9291f2..21c131149a92 100644
--- a/dev-libs/libx86emu/libx86emu-1.1.ebuild
+++ b/dev-libs/libx86emu/libx86emu-1.1.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=4
+EAPI=7
-inherit multilib rpm toolchain-funcs
+inherit rpm toolchain-funcs
DESCRIPTION="A library for emulating x86"
HOMEPAGE="https://www.opensuse.org/"
@@ -12,24 +12,14 @@ SRC_URI="https://download.opensuse.org/source/factory/repo/oss/suse/src/${P}-9.8
LICENSE="HPND"
SLOT="0"
KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
-IUSE=""
-src_prepare() {
- sed -i \
- -e 's:$(CC) -shared:& $(LDFLAGS):' \
- Makefile || die
-}
-
-src_compile() {
- emake CC="$(tc-getCC)" CFLAGS="${CFLAGS} -fPIC -Wall"
-}
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.1-fix-makefile.patch
+ "${FILESDIR}"/${PN}-1.1-gcc10-fno-common.patch
+)
-src_test() {
- ln -sf libx86emu.so.1.1 libx86emu.so || die
- ln -sf libx86emu.so.1.1 libx86emu.so.1 || die
- emake \
- CC="$(tc-getCC)" \
- CFLAGS="${CFLAGS} ${LDFLAGS} -Wl,-rpath,${S} -fPIC -Wall -I../include/ -L../" test
+src_configure() {
+ tc-export CC
}
src_install() {