Gentoo Archives: gentoo-commits

From: Sergey Popov <pinkbyte@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/libx86/, dev-libs/libx86/files/
Date: Fri, 29 Apr 2016 07:59:21
Message-Id: 1461916748.c96dc7cf3ab2fb58fa22c7fd9c1557dda14d5290.pinkbyte@gentoo
1 commit: c96dc7cf3ab2fb58fa22c7fd9c1557dda14d5290
2 Author: Sergey Popov <pinkbyte <AT> gentoo <DOT> org>
3 AuthorDate: Fri Apr 29 07:56:18 2016 +0000
4 Commit: Sergey Popov <pinkbyte <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 29 07:59:08 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c96dc7cf
7
8 dev-libs/libx86: revision bump
9
10 Port to EAPI 6, bring wider arch support
11
12 Reported-by: Oleg <oleg <AT> funtoo.org>
13 Gentoo-Bug: 579682
14
15 Package-Manager: portage-2.2.28
16
17 dev-libs/libx86/files/libx86-1.1-x86emu.patch | 38 ++++++++++++++++++++
18 dev-libs/libx86/libx86-1.1-r4.ebuild | 51 +++++++++++++++++++++++++++
19 2 files changed, 89 insertions(+)
20
21 diff --git a/dev-libs/libx86/files/libx86-1.1-x86emu.patch b/dev-libs/libx86/files/libx86-1.1-x86emu.patch
22 new file mode 100644
23 index 0000000..7b4fe42
24 --- /dev/null
25 +++ b/dev-libs/libx86/files/libx86-1.1-x86emu.patch
26 @@ -0,0 +1,38 @@
27 +diff -Naur libx86-1.1+ds1.orig/Makefile libx86-1.1+ds1/Makefile
28 +--- a/libx86-1.1/Makefile 2008-05-19 12:28:59.000000000 +0300
29 ++++ b/libx86-1.1/Makefile 2012-02-20 01:32:03.750068423 +0200
30 +@@ -5,6 +5,7 @@
31 + ifeq ($(BACKEND),x86emu)
32 + OBJECTS += thunk.o x86emu/decode.o x86emu/debug.o x86emu/fpu.o \
33 + x86emu/ops.o x86emu/ops2.o x86emu/prim_ops.o x86emu/sys.o
34 ++ CFLAGS += -DX86EMU
35 + else
36 + OBJECTS += lrmi.o
37 + endif
38 +diff -Naur libx86-1.1+ds1.orig/thunk.c libx86-1.1+ds1/thunk.c
39 +--- a/libx86-1.1+ds1.orig/thunk.c 2008-04-03 03:48:00.000000000 +0300
40 ++++ b/libx86-1.1/thunk.c 2012-02-20 01:12:56.468820192 +0200
41 +@@ -32,6 +32,7 @@
42 + #define TRUE 1
43 + #define FALSE 0
44 +
45 ++#ifndef X86EMU
46 + #define __BUILDIO(bwl,bw,type) \
47 + static inline void out##bwl##_local(unsigned long port, unsigned type value) { __asm__ __volatile__("out" #bwl " %" #bw "0, %w1" : : "a"(value), "Nd"(port)); \
48 + }\
49 +@@ -44,6 +45,15 @@
50 + __BUILDIO(b,b,char)
51 + __BUILDIO(w,w,short)
52 + __BUILDIO(l,,int)
53 ++#else
54 ++/* use libc functions */
55 ++#define inb_local inb
56 ++#define inw_local inw
57 ++#define inl_local inl
58 ++#define outb_local outb
59 ++#define outw_local outw
60 ++#define outl_local outl
61 ++#endif /* X86EMU */
62 +
63 +
64 + char *mmap_addr = SHMERRORPTR;
65
66 diff --git a/dev-libs/libx86/libx86-1.1-r4.ebuild b/dev-libs/libx86/libx86-1.1-r4.ebuild
67 new file mode 100644
68 index 0000000..8b172d3
69 --- /dev/null
70 +++ b/dev-libs/libx86/libx86-1.1-r4.ebuild
71 @@ -0,0 +1,51 @@
72 +# Copyright 1999-2016 Gentoo Foundation
73 +# Distributed under the terms of the GNU General Public License v2
74 +# $Id$
75 +
76 +EAPI=6
77 +
78 +inherit eutils toolchain-funcs flag-o-matic
79 +
80 +DESCRIPTION="A hardware-independent library for executing real-mode x86 code"
81 +HOMEPAGE="http://www.codon.org.uk/~mjg59/libx86"
82 +SRC_URI="http://www.codon.org.uk/~mjg59/${PN}/downloads/${P}.tar.gz"
83 +
84 +LICENSE="BSD"
85 +SLOT="0"
86 +KEYWORDS="~amd64 ~x86"
87 +IUSE="static-libs"
88 +
89 +src_prepare() {
90 + # fix compile failure with linux-headers-2.6.26, bug 235599
91 + eapply -p0 "${FILESDIR}/${PN}-0.99-ifmask.patch"
92 + # Patch for bugs #236888 and #456648
93 + eapply -p0 "${FILESDIR}/${P}-makefile.patch"
94 + # Wider arch compatibility, bug #579682
95 + eapply -p2 "${FILESDIR}/${P}-x86emu.patch"
96 +
97 + eapply_user
98 +}
99 +
100 +src_configure() {
101 + tc-export CC AR
102 + append-flags -fno-delete-null-pointer-checks #523276
103 +}
104 +
105 +src_compile() {
106 + local ARGS
107 + use x86 || ARGS="BACKEND=x86emu"
108 + emake ${ARGS} LIBRARY=shared shared
109 + if use static-libs; then
110 + emake ${ARGS} objclean
111 + emake ${ARGS} LIBRARY=static static
112 + fi
113 +}
114 +
115 +src_install() {
116 + local install_static;
117 + use static-libs && install_static='install-static'
118 + emake \
119 + LIBDIR="/usr/$(get_libdir)" \
120 + DESTDIR="${D}" \
121 + install-header install-shared ${install_static}
122 +}