summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Popov <pinkbyte@gentoo.org>2016-04-29 10:56:18 +0300
committerSergey Popov <pinkbyte@gentoo.org>2016-04-29 10:59:08 +0300
commitc96dc7cf3ab2fb58fa22c7fd9c1557dda14d5290 (patch)
tree27876713ae77edf7a23eef1d453c5c006418774d
parentdev-ruby/colorator: add ruby23 (diff)
downloadgentoo-c96dc7cf3ab2fb58fa22c7fd9c1557dda14d5290.tar.gz
gentoo-c96dc7cf3ab2fb58fa22c7fd9c1557dda14d5290.tar.bz2
gentoo-c96dc7cf3ab2fb58fa22c7fd9c1557dda14d5290.zip
dev-libs/libx86: revision bump
Port to EAPI 6, bring wider arch support Reported-by: Oleg <oleg@funtoo.org> Gentoo-Bug: 579682 Package-Manager: portage-2.2.28
-rw-r--r--dev-libs/libx86/files/libx86-1.1-x86emu.patch38
-rw-r--r--dev-libs/libx86/libx86-1.1-r4.ebuild51
2 files changed, 89 insertions, 0 deletions
diff --git a/dev-libs/libx86/files/libx86-1.1-x86emu.patch b/dev-libs/libx86/files/libx86-1.1-x86emu.patch
new file mode 100644
index 000000000000..7b4fe428e1b3
--- /dev/null
+++ b/dev-libs/libx86/files/libx86-1.1-x86emu.patch
@@ -0,0 +1,38 @@
+diff -Naur libx86-1.1+ds1.orig/Makefile libx86-1.1+ds1/Makefile
+--- a/libx86-1.1/Makefile 2008-05-19 12:28:59.000000000 +0300
++++ b/libx86-1.1/Makefile 2012-02-20 01:32:03.750068423 +0200
+@@ -5,6 +5,7 @@
+ ifeq ($(BACKEND),x86emu)
+ OBJECTS += thunk.o x86emu/decode.o x86emu/debug.o x86emu/fpu.o \
+ x86emu/ops.o x86emu/ops2.o x86emu/prim_ops.o x86emu/sys.o
++ CFLAGS += -DX86EMU
+ else
+ OBJECTS += lrmi.o
+ endif
+diff -Naur libx86-1.1+ds1.orig/thunk.c libx86-1.1+ds1/thunk.c
+--- a/libx86-1.1+ds1.orig/thunk.c 2008-04-03 03:48:00.000000000 +0300
++++ b/libx86-1.1/thunk.c 2012-02-20 01:12:56.468820192 +0200
+@@ -32,6 +32,7 @@
+ #define TRUE 1
+ #define FALSE 0
+
++#ifndef X86EMU
+ #define __BUILDIO(bwl,bw,type) \
+ static inline void out##bwl##_local(unsigned long port, unsigned type value) { __asm__ __volatile__("out" #bwl " %" #bw "0, %w1" : : "a"(value), "Nd"(port)); \
+ }\
+@@ -44,6 +45,15 @@
+ __BUILDIO(b,b,char)
+ __BUILDIO(w,w,short)
+ __BUILDIO(l,,int)
++#else
++/* use libc functions */
++#define inb_local inb
++#define inw_local inw
++#define inl_local inl
++#define outb_local outb
++#define outw_local outw
++#define outl_local outl
++#endif /* X86EMU */
+
+
+ char *mmap_addr = SHMERRORPTR;
diff --git a/dev-libs/libx86/libx86-1.1-r4.ebuild b/dev-libs/libx86/libx86-1.1-r4.ebuild
new file mode 100644
index 000000000000..8b172d30d2ed
--- /dev/null
+++ b/dev-libs/libx86/libx86-1.1-r4.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit eutils toolchain-funcs flag-o-matic
+
+DESCRIPTION="A hardware-independent library for executing real-mode x86 code"
+HOMEPAGE="http://www.codon.org.uk/~mjg59/libx86"
+SRC_URI="http://www.codon.org.uk/~mjg59/${PN}/downloads/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="static-libs"
+
+src_prepare() {
+ # fix compile failure with linux-headers-2.6.26, bug 235599
+ eapply -p0 "${FILESDIR}/${PN}-0.99-ifmask.patch"
+ # Patch for bugs #236888 and #456648
+ eapply -p0 "${FILESDIR}/${P}-makefile.patch"
+ # Wider arch compatibility, bug #579682
+ eapply -p2 "${FILESDIR}/${P}-x86emu.patch"
+
+ eapply_user
+}
+
+src_configure() {
+ tc-export CC AR
+ append-flags -fno-delete-null-pointer-checks #523276
+}
+
+src_compile() {
+ local ARGS
+ use x86 || ARGS="BACKEND=x86emu"
+ emake ${ARGS} LIBRARY=shared shared
+ if use static-libs; then
+ emake ${ARGS} objclean
+ emake ${ARGS} LIBRARY=static static
+ fi
+}
+
+src_install() {
+ local install_static;
+ use static-libs && install_static='install-static'
+ emake \
+ LIBDIR="/usr/$(get_libdir)" \
+ DESTDIR="${D}" \
+ install-header install-shared ${install_static}
+}