Sync with portage [Thu Jun 27 19:53:31 MSK 2013].

mhiretskiy
root 11 years ago
parent a2f65af846
commit f28e165d86

@ -1,25 +0,0 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-arch/tarsync/tarsync-0.2.1.ebuild,v 1.6 2009/10/12 16:50:07 halcy0n Exp $
DESCRIPTION="Delta compression suite for using/generating binary patches"
HOMEPAGE="http://gentooexperimental.org/~ferringb/tarsync/"
SRC_URI="mirror://gentoo/${P}.tar.bz2"
SLOT="0"
LICENSE="GPL-2"
KEYWORDS="~hppa ppc x86 ~amd64"
IUSE=""
S="${WORKDIR}/${PN}"
DEPEND=">=dev-util/diffball-0.7"
RDEPEND="${DEPEND}"
src_compile() {
emake || die "emake failed"
}
src_install() {
make DESTDIR="${D}" install || die "failed installing"
}

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-backup/backintime/backintime-1.0.24.ebuild,v 1.2 2013/06/25 20:54:48 xmw Exp $
# $Header: /var/cvsroot/gentoo-x86/app-backup/backintime/backintime-1.0.24-r1.ebuild,v 1.1 2013/06/27 13:15:42 xmw Exp $
EAPI=5
@ -17,7 +17,8 @@ SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="kde gnome"
DEPEND="
RDEPEND="dev-python/keyring
dev-python/notify-python
net-misc/rsync[xattr,acl]
kde? (
>=kde-base/kdelibs-4
@ -33,10 +34,9 @@ DEPEND="
dev-python/libgnome-python
dev-python/pygobject:2
dev-python/pygtk
)
dev-python/notify-python"
)"
RDEPEND="${DEPEND}"
DEPEND="${RDEPEND}"
S=${WORKDIR}

@ -0,0 +1,33 @@
diff -r a2912073be85 lisp/paragraphs.el
--- a/lisp/paragraphs.el Wed Jun 19 09:30:30 2013 -0600
+++ b/lisp/paragraphs.el Sat Jun 22 13:27:48 2013 +0200
@@ -180,7 +180,10 @@
:type '(choice regexp (const :tag "Use default value" nil)))
(put 'sentence-end 'safe-local-variable 'string-or-null-p)
-(defcustom sentence-end-base "[.?!][]\"'”)}]*"
+(defcustom sentence-end-base
+ (concat "[.?!][]\"'"
+ (if (featurep 'mule) (string (unicode-to-char #x201D)) "")
+ ")}]*")
"Regexp matching the basic end of a sentence, not including following space."
:group 'paragraphs
:type 'string
@@ -201,14 +204,14 @@
in between. See Info node `(elisp)Standard Regexps'."
(or sentence-end
;; We accept non-break space along with space.
- (concat (if sentence-end-without-period "\\w[ \u00a0][ \u00a0]\\|")
+ (concat (if sentence-end-without-period "\\w[ \240][ \240]\\|")
"\\("
sentence-end-base
(if sentence-end-double-space
- "\\($\\|[ \u00a0]$\\|\t\\|[ \u00a0][ \u00a0]\\)" "\\($\\|[\t \u00a0]\\)")
+ "\\($\\|[ \240]$\\|\t\\|[ \240][ \240]\\)" "\\($\\|[\t \240]\\)")
"\\|[" sentence-end-without-space "]+"
"\\)"
- "[ \u00a0\t\n]*")))
+ "[ \240\t\n]*")))
(defcustom page-delimiter "^\014"
"*Regexp describing line-beginnings that separate pages."

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-editors/xemacs/xemacs-21.5.33.ebuild,v 1.1 2013/06/02 09:18:02 matsl Exp $
# $Header: /var/cvsroot/gentoo-x86/app-editors/xemacs/xemacs-21.5.33.ebuild,v 1.2 2013/06/26 22:52:02 matsl Exp $
# Note: xemacs currently does not work with a hardened profile. If you
# want to use xemacs on a hardened profile then compile with the
@ -63,6 +63,10 @@ src_unpack() {
src_prepare() {
use neXt && cp "${WORKDIR}"/NeXT.XEmacs/xemacs-icons/* "${S}"/etc/toolbar/
# Fix for no-mule build.
find "${S}"/lisp -name '*.elc' -exec rm {} \; || die
epatch "${FILESDIR}"/${P}-no-mule-build.patch
}
src_configure() {
@ -170,10 +174,10 @@ src_configure() {
src_install() {
emake prefix="${D}"/usr \
mandir="${D}"/usr/share/man/man1 \
infodir="${D}"/usr/share/info \
libdir="${D}"/usr/$(get_libdir) \
datadir="${D}"/usr/share \
mandir="${D}"/usr/share/man/man1 \
infodir="${D}"/usr/share/info \
libdir="${D}"/usr/$(get_libdir) \
datadir="${D}"/usr/share \
install gzip-el || die
# Rename some applications installed in bin so that it is clear

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-emulation/emul-linux-x86-soundlibs/emul-linux-x86-soundlibs-20130224-r1.ebuild,v 1.1 2013/06/26 18:18:39 aballier Exp $
# $Header: /var/cvsroot/gentoo-x86/app-emulation/emul-linux-x86-soundlibs/emul-linux-x86-soundlibs-20130224-r2.ebuild,v 1.2 2013/06/26 21:49:01 aballier Exp $
EAPI=5
inherit emul-linux-x86
@ -18,6 +18,10 @@ RDEPEND="~app-emulation/emul-linux-x86-baselibs-${PV}
>=media-libs/libvorbis-1.3.3-r1[abi_x86_32(-)]
>=media-libs/libmodplug-0.8.8.4-r1[abi_x86_32(-)]
>=media-sound/gsm-1.0.13-r1[abi_x86_32(-)]
>=media-libs/webrtc-audio-processing-0.1-r1[abi_x86_32(-)]
>=media-libs/alsa-lib-1.0.27.1[abi_x86_32(-)]
>=media-libs/flac-1.2.1-r5[abi_x86_32(-)]
>=media-libs/audiofile-0.3.6-r1[abi_x86_32(-)]
)"
src_prepare() {

@ -21,3 +21,26 @@ usr/lib32/libvorbisfile.so.3.3.5
usr/lib32/pkgconfig/vorbis.pc
usr/lib32/pkgconfig/vorbisenc.pc
usr/lib32/pkgconfig/vorbisfile.pc
usr/lib32/libwebrtc_audio_processing.so
usr/lib32/libwebrtc_audio_processing.so.0
usr/lib32/libwebrtc_audio_processing.so.0.0.0
usr/lib32/pkgconfig/webrtc-audio-processing.pc
usr/lib32/libasound.so
usr/lib32/libasound.so.2
usr/lib32/libasound.so.2.0.0
usr/lib32/pkgconfig/alsa.pc
usr/lib32/alsa-lib/smixer/smixer-ac97.so
usr/lib32/alsa-lib/smixer/smixer-hda.so
usr/lib32/alsa-lib/smixer/smixer-sbase.so
usr/lib32/libFLAC++.so
usr/lib32/libFLAC++.so.6
usr/lib32/libFLAC++.so.6.2.0
usr/lib32/libFLAC.so
usr/lib32/libFLAC.so.8
usr/lib32/libFLAC.so.8.2.0
usr/lib32/pkgconfig/flac++.pc
usr/lib32/pkgconfig/flac.pc
usr/lib32/libaudiofile.so
usr/lib32/libaudiofile.so.1
usr/lib32/libaudiofile.so.1.0.0
usr/lib32/pkgconfig/audiofile.pc

@ -1,4 +1 @@
DIST q4wine-0.121.tar.bz2 665208 SHA256 fc5a1a8c09d133a17a997a2b020ad03eaf06c81357863d9f69fd7206d86e3edc SHA512 2086b45a6ecc110b365b63317d6f3b0dd7c87fce548907167fd4ddb6ebffdaf01b3c86df6b54eb977cebb309e80e8786fdfd85c16ab98dcb3f829af74cf26132 WHIRLPOOL dbd47f6d5687500f14ac82af1a8f7335c50f8895cab4b61b7e3597754756e0a39fa84c66b78bb06e45744b093e9cb4146da4d76cbf1d6266ff6676dd62d9416b
DIST q4wine-1.0-r1.tar.bz2 858442 SHA256 a1020005ab4a71a0d11f37f65638dd8f97bd6f7b8d652f9b6042080046ba00a7 SHA512 bfb37c3bddf5cb6dacb08f71a2c278e977dc6b7bd0b8db1665be27316dc69a185282f9f4aa595eedc77df1ce9bdf386db8fa4b50ff43bc2276413216ea198c1d WHIRLPOOL 7b5ccc0e2cd52a6761517d09f05315a3cd865095de67cc81cde58937b5d0d81dfe5d0497a8c1029bade60322fab5b2c73a63ab75c421472f2b45fca7765fa1bc
DIST q4wine-1.0-r2.tar.bz2 876411 SHA256 c92a5e0f7ce8b6dd5d4d4f6f0ed38ad14ad93652387f513f0769ff6c7bc0be0e SHA512 1be57465c1d96c8250ab3a0ae74df822d6ec4d53e1eb5bf0666ae2340511718052e7471a94fe5bab0bf07e105c86c2064cf7799ece2d530a7ede8e3d8564e458 WHIRLPOOL 063641823f5449c8b22bd7dfc54dd1cc761ac98a36c2d076be231bd5c657ef01684ee662146e4d4d4f3aab77c367ebcff356f8fc221ce07c449bfc8a675499a4
DIST q4wine-1.0-r3.tar.bz2 889308 SHA256 9f1319dd0baff3834a3938e0a048c1529cb9ea521158370176b706fce0d4d2ff SHA512 df10a2fbf6874f4c4e02dd9c43031453a46c76f03d83321f2d6e9544d0540dd07da1bc9246767c5c91ce17d67d5d236227294efaed9de09f3d5a18afbd60b224 WHIRLPOOL 51b5b4cfc157da6b99154269ef4ef9f38ff91f861864158b789352505af485d8b523a21c6d4b59544804ed3c15cb1c6c756db3f3203c8e3ba55c8396c3630df3

@ -1,44 +0,0 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-emulation/q4wine/q4wine-0.121.ebuild,v 1.4 2013/03/02 19:25:09 hwoarang Exp $
EAPI="2"
inherit cmake-utils
DESCRIPTION="Qt4 GUI configuration tool for Wine"
HOMEPAGE="http://q4wine.brezblock.org.ua/"
SRC_URI="mirror://sourceforge/${PN}/${PF}.tar.bz2"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE="debug +icoutils +wineappdb -dbus gnome kde"
DEPEND="dev-qt/qtgui:4
dev-qt/qtsql:4[sqlite]
dev-util/cmake"
RDEPEND="dev-qt/qtgui:4
dev-qt/qtsql:4[sqlite]
app-admin/sudo
app-emulation/wine
>=sys-apps/which-2.19
icoutils? ( >=media-gfx/icoutils-0.26.0 )
sys-fs/fuseiso
kde? ( kde-base/kdesu )
gnome? ( x11-libs/gksu )
dbus? ( dev-qt/qtdbus:4 )"
DOCS="README AUTHORS ChangeLog"
S="${WORKDIR}/${PF}"
src_configure() {
mycmakeargs="${mycmakeargs} \
$(cmake-utils_use debug DEBUG) \
$(cmake-utils_use_with icoutils ICOUTILS) \
$(cmake-utils_use_with wineappdb WINEAPPDB) \
$(cmake-utils_use_with dbus DBUS)"
cmake-utils_src_configure
}

@ -1,59 +0,0 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-emulation/q4wine/q4wine-1.0-r1.ebuild,v 1.2 2013/03/02 19:25:09 hwoarang Exp $
EAPI="4"
LANGS="cs de en es he it ru uk pl pt"
inherit cmake-utils
DESCRIPTION="Qt4 GUI configuration tool for Wine"
HOMEPAGE="http://q4wine.brezblock.org.ua/"
SRC_URI="mirror://sourceforge/${PN}/${PN}/${PN}%20${PV}/${PF}.tar.bz2"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="debug +icoutils +wineappdb -dbus gnome kde"
for x in ${LANGS}; do
IUSE+=" linguas_${x}"
done
DEPEND="dev-qt/qtgui:4
dev-qt/qtsql:4[sqlite]
dev-util/cmake"
RDEPEND="dev-qt/qtgui:4
dev-qt/qtsql:4[sqlite]
app-admin/sudo
app-emulation/wine
>=sys-apps/which-2.19
icoutils? ( >=media-gfx/icoutils-0.26.0 )
sys-fs/fuseiso
kde? ( kde-base/kdesu )
gnome? ( x11-libs/gksu )
dbus? ( dev-qt/qtdbus:4 )"
DOCS="README AUTHORS ChangeLog"
S="${WORKDIR}/${PF}"
src_configure() {
mycmakeargs="${mycmakeargs} \
$(cmake-utils_use debug DEBUG) \
$(cmake-utils_use_with icoutils ICOUTILS) \
$(cmake-utils_use_with wineappdb WINEAPPDB) \
$(cmake-utils_use_with dbus DBUS)"
cmake-utils_src_configure
}
src_install() {
cmake-utils_src_install
for x in ${LANGS}; do
if ! has ${x} ${LINGUAS}; then
find "${D}" -name "${PN}_${x}*.qm" -exec rm {} \;
fi
done
}

@ -1,59 +0,0 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-emulation/q4wine/q4wine-1.0-r2.ebuild,v 1.1 2013/03/03 15:33:48 hwoarang Exp $
EAPI="4"
LANGS="cs de en es fa he it ru uk pl pt"
inherit cmake-utils
DESCRIPTION="Qt4 GUI configuration tool for Wine"
HOMEPAGE="http://q4wine.brezblock.org.ua/"
SRC_URI="mirror://sourceforge/${PN}/${PN}/${PN}%20${PV}/${PF}.tar.bz2"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="debug +icoutils +wineappdb -dbus gnome kde"
for x in ${LANGS}; do
IUSE+=" linguas_${x}"
done
DEPEND="dev-qt/qtgui:4
dev-qt/qtsql:4[sqlite]
dev-util/cmake"
RDEPEND="dev-qt/qtgui:4
dev-qt/qtsql:4[sqlite]
app-admin/sudo
app-emulation/wine
>=sys-apps/which-2.19
icoutils? ( >=media-gfx/icoutils-0.26.0 )
sys-fs/fuseiso
kde? ( kde-base/kdesu )
gnome? ( x11-libs/gksu )
dbus? ( dev-qt/qtdbus:4 )"
DOCS="README AUTHORS ChangeLog"
S="${WORKDIR}/${PF}"
src_configure() {
mycmakeargs="${mycmakeargs} \
$(cmake-utils_use debug DEBUG) \
$(cmake-utils_use_with icoutils ICOUTILS) \
$(cmake-utils_use_with wineappdb WINEAPPDB) \
$(cmake-utils_use_with dbus DBUS)"
cmake-utils_src_configure
}
src_install() {
cmake-utils_src_install
for x in ${LANGS}; do
if ! has ${x} ${LINGUAS}; then
find "${D}" -name "${PN}_${x}*.qm" -exec rm {} \;
fi
done
}

@ -1,3 +1,4 @@
DIST XSA-55patches.tar.gz 23888 SHA256 e86749d02ca5594ebcfdaea820a6cf1fe11015c7fdcc5836260498fae317d75b SHA512 ed1f321a1351df99cfb05e1dfc62dda1268544b0c0ceb7a01438805046e027fb9d59194d179b7a8c302b091a7bf444811b0b9359c4d42f7e902510515c275b6b WHIRLPOOL 5a611e5260f0fc97471f386da3499f7714e015c5c2556bd7199466558d8e375784d32655bdbe9ed4cbf492fa3b41091677d9fe6d3714b029c9a2b1dda6102edb
DIST grub-0.97.tar.gz 971783 SHA256 4e1d15d12dbd3e9208111d6b806ad5a9857ca8850c47877d36575b904559260b SHA512 c2bc9ffc8583aeae71cee9ddcc4418969768d4e3764d47307da54f93981c0109fb07d84b061b3a3628bd00ba4d14a54742bc04848110eb3ae8ca25dbfbaabadb WHIRLPOOL 0ad7f5dc035e2a3ad5fd29b6388f06fd12a8cc694117b4cbd42b5302433aa522db23566222d35219fe17fb95edb5090553156198507f70208eda5d858fd52dd5
DIST lwip-1.3.0.tar.gz 398933 SHA256 772e4d550e07826665ed0528c071dd5404ef7dbe1825a38c8adbc2a00bca948f SHA512 1465b58279af1647f909450e394fe002ca165f0ff4a0254bfa9fe0e64316f50facdde2729d79a4e632565b4500cf4d6c74192ac0dd3bc9fe09129bbd67ba089d WHIRLPOOL 63bdd9eb70f168ba2006a8f4bbe166b68528abe8364b23cdc1d468ccc4b137bb3447bf90695920f016e09d53d3b93ccf6e3697b3c46840f00b794789cb424acc
DIST newlib-1.16.0.tar.gz 12024353 SHA256 db426394965c48c1d29023e1cc6d965ea6b9a9035d8a849be2750ca4659a3d07 SHA512 40eb96bbc6736a16b6399e0cdb73e853d0d90b685c967e77899183446664d64570277a633fdafdefc351b46ce210a99115769a1d9f47ac749d7e82837d4d1ac3 WHIRLPOOL 47f7afd525f482d79d9e964f0e75ee8a77e59551bd19cd94f9b95ac3af9406afa381c9d8d224f76eb568441ab613b2b194f8e5be50aa222f9ed2d9b9761829db

@ -1,788 +0,0 @@
From cc8761371aac432318530c2ddfe2c8234bc0621f Mon Sep 17 00:00:00 2001
From: Ian Jackson <ian.jackson@eu.citrix.com>
Date: Fri, 14 Jun 2013 16:43:17 +0100
Subject: [PATCH 11/23] libelf: check all pointer accesses
We change the ELF_PTRVAL and ELF_HANDLE types and associated macros:
* PTRVAL becomes a uintptr_t, for which we provide a typedef
elf_ptrval. This means no arithmetic done on it can overflow so
the compiler cannot do any malicious invalid pointer arithmetic
"optimisations". It also means that any places where we
dereference one of these pointers without using the appropriate
macros or functions become a compilation error.
So we can be sure that we won't miss any memory accesses.
All the PTRVAL variables were previously void* or char*, so
the actual address calculations are unchanged.
* ELF_HANDLE becomes a union, one half of which keeps the pointer
value and the other half of which is just there to record the
type.
The new type is not a pointer type so there can be no address
calculations on it whose meaning would change. Every assignment or
access has to go through one of our macros.
* The distinction between const and non-const pointers and char*s
and void*s in libelf goes away. This was not important (and
anyway libelf tended to cast away const in various places).
* The fields elf->image and elf->dest are renamed. That proves
that we haven't missed any unchecked uses of these actual
pointer values.
* The caller may fill in elf->caller_xdest_base and _size to
specify another range of memory which is safe for libelf to
access, besides the input and output images.
* When accesses fail due to being out of range, we mark the elf
"broken". This will be checked and used for diagnostics in
a following patch.
We do not check for write accesses to the input image. This is
because libelf actually does this in a number of places. So we
simply permit that.
* Each caller of libelf which used to set dest now sets
dest_base and dest_size.
* In xc_dom_load_elf_symtab we provide a new actual-pointer
value hdr_ptr which we get from mapping the guest's kernel
area and use (checking carefully) as the caller_xdest area.
* The STAR(h) macro in libelf-dominfo.c now uses elf_access_unsigned.
* elf-init uses the new elf_uval_3264 accessor to access the 32-bit
fields, rather than an unchecked field access (ie, unchecked
pointer access).
* elf_uval has been reworked to use elf_uval_3264. Both of these
macros are essentially new in this patch (although they are derived
from the old elf_uval) and need careful review.
* ELF_ADVANCE_DEST is now safe in the sense that you can use it to
chop parts off the front of the dest area but if you chop more than
is available, the dest area is simply set to be empty, preventing
future accesses.
* We introduce some #defines for memcpy, memset, memmove and strcpy:
- We provide elf_memcpy_safe and elf_memset_safe which take
PTRVALs and do checking on the supplied pointers.
- Users inside libelf must all be changed to either
elf_mem*_unchecked (which are just like mem*), or
elf_mem*_safe (which take PTRVALs) and are checked. Any
unchanged call sites become compilation errors.
* We do _not_ at this time fix elf_access_unsigned so that it doesn't
make unaligned accesses. We hope that unaligned accesses are OK on
every supported architecture. But it does check the supplied
pointer for validity.
This is part of the fix to a security issue, XSA-55.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
tools/libxc/xc_dom_elfloader.c | 49 ++++++++--
tools/libxc/xc_hvm_build_x86.c | 10 +-
xen/arch/x86/domain_build.c | 3 +-
xen/common/libelf/libelf-dominfo.c | 2 +-
xen/common/libelf/libelf-loader.c | 16 ++--
xen/common/libelf/libelf-private.h | 13 +++
xen/common/libelf/libelf-tools.c | 106 ++++++++++++++++++-
xen/include/xen/libelf.h | 198 +++++++++++++++++++++++++-----------
8 files changed, 312 insertions(+), 85 deletions(-)
diff --git a/tools/libxc/xc_dom_elfloader.c b/tools/libxc/xc_dom_elfloader.c
index cc0f206..b82a08c 100644
--- a/tools/libxc/xc_dom_elfloader.c
+++ b/tools/libxc/xc_dom_elfloader.c
@@ -130,20 +130,30 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
if ( load )
{
- size_t allow_size; /* will be used in a forthcoming XSA-55 patch */
+ char *hdr_ptr;
+ size_t allow_size;
+
if ( !dom->bsd_symtab_start )
return 0;
size = dom->kernel_seg.vend - dom->bsd_symtab_start;
- hdr = xc_dom_vaddr_to_ptr(dom, dom->bsd_symtab_start, &allow_size);
- *(int *)hdr = size - sizeof(int);
+ hdr_ptr = xc_dom_vaddr_to_ptr(dom, dom->bsd_symtab_start, &allow_size);
+ elf->caller_xdest_base = hdr_ptr;
+ elf->caller_xdest_size = allow_size;
+ hdr = ELF_REALPTR2PTRVAL(hdr_ptr);
+ elf_store_val(elf, int, hdr, size - sizeof(int));
}
else
{
+ char *hdr_ptr;
+
size = sizeof(int) + elf_size(elf, elf->ehdr) +
elf_shdr_count(elf) * elf_size(elf, shdr);
- hdr = xc_dom_malloc(dom, size);
- if ( hdr == NULL )
+ hdr_ptr = xc_dom_malloc(dom, size);
+ if ( hdr_ptr == NULL )
return 0;
+ elf->caller_xdest_base = hdr_ptr;
+ elf->caller_xdest_size = size;
+ hdr = ELF_REALPTR2PTRVAL(hdr_ptr);
dom->bsd_symtab_start = elf_round_up(elf, dom->kernel_seg.vend);
}
@@ -171,9 +181,32 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
ehdr->e_shoff = elf_size(elf, elf->ehdr);
ehdr->e_shstrndx = SHN_UNDEF;
}
- if ( elf_init(&syms, hdr + sizeof(int), size - sizeof(int)) )
+ if ( elf->caller_xdest_size < sizeof(int) )
+ {
+ DOMPRINTF("%s/%s: header size %"PRIx64" too small",
+ __FUNCTION__, load ? "load" : "parse",
+ (uint64_t)elf->caller_xdest_size);
+ return -1;
+ }
+ if ( elf_init(&syms, elf->caller_xdest_base + sizeof(int),
+ elf->caller_xdest_size - sizeof(int)) )
return -1;
+ /*
+ * The caller_xdest_{base,size} and dest_{base,size} need to
+ * remain valid so long as each struct elf_image does. The
+ * principle we adopt is that these values are set when the
+ * memory is allocated or mapped, and cleared when (and if)
+ * they are unmapped.
+ *
+ * Mappings of the guest are normally undone by xc_dom_unmap_all
+ * (directly or via xc_dom_release). We do not explicitly clear
+ * these because in fact that happens only at the end of
+ * xc_dom_boot_image, at which time all of these ELF loading
+ * functions have returned. No relevant struct elf_binary*
+ * escapes this file.
+ */
+
xc_elf_set_logfile(dom->xch, &syms, 1);
symtab = dom->bsd_symtab_start + sizeof(int);
@@ -312,8 +345,10 @@ static int xc_dom_load_elf_kernel(struct xc_dom_image *dom)
{
struct elf_binary *elf = dom->private_loader;
int rc;
+ xen_pfn_t pages;
- elf->dest = xc_dom_seg_to_ptr(dom, &dom->kernel_seg);
+ elf->dest_base = xc_dom_seg_to_ptr_pages(dom, &dom->kernel_seg, &pages);
+ elf->dest_size = pages * XC_DOM_PAGE_SIZE(dom);
rc = elf_load_binary(elf);
if ( rc < 0 )
{
diff --git a/tools/libxc/xc_hvm_build_x86.c b/tools/libxc/xc_hvm_build_x86.c
index 15b603d..ccfd8b5 100644
--- a/tools/libxc/xc_hvm_build_x86.c
+++ b/tools/libxc/xc_hvm_build_x86.c
@@ -104,11 +104,12 @@ static int loadelfimage(
for ( i = 0; i < pages; i++ )
entries[i].mfn = parray[(elf->pstart >> PAGE_SHIFT) + i];
- elf->dest = xc_map_foreign_ranges(
+ elf->dest_base = xc_map_foreign_ranges(
xch, dom, pages << PAGE_SHIFT, PROT_READ | PROT_WRITE, 1 << PAGE_SHIFT,
entries, pages);
- if ( elf->dest == NULL )
+ if ( elf->dest_base == NULL )
goto err;
+ elf->dest_size = pages * PAGE_SIZE;
ELF_ADVANCE_DEST(elf, elf->pstart & (PAGE_SIZE - 1));
@@ -117,8 +118,9 @@ static int loadelfimage(
if ( rc < 0 )
PERROR("Failed to load elf binary\n");
- munmap(elf->dest, pages << PAGE_SHIFT);
- elf->dest = NULL;
+ munmap(elf->dest_base, pages << PAGE_SHIFT);
+ elf->dest_base = NULL;
+ elf->dest_size = 0;
err:
free(entries);
diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index 469d363..a655b21 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -908,7 +908,8 @@ int __init construct_dom0(
write_ptbase(v);
/* Copy the OS image and free temporary buffer. */
- elf.dest = (void*)vkern_start;
+ elf.dest_base = (void*)vkern_start;
+ elf.dest_size = vkern_end - vkern_start;
rc = elf_load_binary(&elf);
if ( rc < 0 )
{
diff --git a/xen/common/libelf/libelf-dominfo.c b/xen/common/libelf/libelf-dominfo.c
index b217f8f..98c80dc 100644
--- a/xen/common/libelf/libelf-dominfo.c
+++ b/xen/common/libelf/libelf-dominfo.c
@@ -254,7 +254,7 @@ int elf_xen_parse_guest_info(struct elf_binary *elf,
int len;
h = parms->guest_info;
-#define STAR(h) (*(h))
+#define STAR(h) (elf_access_unsigned(elf, (h), 0, 1))
while ( STAR(h) )
{
elf_memset_unchecked(name, 0, sizeof(name));
diff --git a/xen/common/libelf/libelf-loader.c b/xen/common/libelf/libelf-loader.c
index 0fef84c..a3310e7 100644
--- a/xen/common/libelf/libelf-loader.c
+++ b/xen/common/libelf/libelf-loader.c
@@ -24,23 +24,25 @@
/* ------------------------------------------------------------------------ */
-int elf_init(struct elf_binary *elf, const char *image, size_t size)
+int elf_init(struct elf_binary *elf, const char *image_input, size_t size)
{
ELF_HANDLE_DECL(elf_shdr) shdr;
uint64_t i, count, section, offset;
- if ( !elf_is_elfbinary(image) )
+ if ( !elf_is_elfbinary(image_input) )
{
elf_err(elf, "%s: not an ELF binary\n", __FUNCTION__);
return -1;
}
elf_memset_unchecked(elf, 0, sizeof(*elf));
- elf->image = image;
+ elf->image_base = image_input;
elf->size = size;
- elf->ehdr = (elf_ehdr *)image;
- elf->class = elf->ehdr->e32.e_ident[EI_CLASS];
- elf->data = elf->ehdr->e32.e_ident[EI_DATA];
+ elf->ehdr = ELF_MAKE_HANDLE(elf_ehdr, (elf_ptrval)image_input);
+ elf->class = elf_uval_3264(elf, elf->ehdr, e32.e_ident[EI_CLASS]);
+ elf->data = elf_uval_3264(elf, elf->ehdr, e32.e_ident[EI_DATA]);
+ elf->caller_xdest_base = NULL;
+ elf->caller_xdest_size = 0;
/* Sanity check phdr. */
offset = elf_uval(elf, elf->ehdr, e_phoff) +
@@ -300,7 +302,7 @@ int elf_load_binary(struct elf_binary *elf)
ELF_PTRVAL_VOID elf_get_ptr(struct elf_binary *elf, unsigned long addr)
{
- return elf->dest + addr - elf->pstart;
+ return ELF_REALPTR2PTRVAL(elf->dest_base) + addr - elf->pstart;
}
uint64_t elf_lookup_addr(struct elf_binary * elf, const char *symbol)
diff --git a/xen/common/libelf/libelf-private.h b/xen/common/libelf/libelf-private.h
index 3ef753c..280dfd1 100644
--- a/xen/common/libelf/libelf-private.h
+++ b/xen/common/libelf/libelf-private.h
@@ -86,6 +86,19 @@ do { strncpy((d),(s),sizeof((d))-1); \
#endif
+#undef memcpy
+#undef memset
+#undef memmove
+#undef strcpy
+
+#define memcpy MISTAKE_unspecified_memcpy
+#define memset MISTAKE_unspecified_memset
+#define memmove MISTAKE_unspecified_memmove
+#define strcpy MISTAKE_unspecified_strcpy
+ /* This prevents libelf from using these undecorated versions
+ * of memcpy, memset, memmove and strcpy. Every call site
+ * must either use elf_mem*_unchecked, or elf_mem*_safe. */
+
#endif /* __LIBELF_PRIVATE_H_ */
/*
diff --git a/xen/common/libelf/libelf-tools.c b/xen/common/libelf/libelf-tools.c
index 3a0cde1..46ca553 100644
--- a/xen/common/libelf/libelf-tools.c
+++ b/xen/common/libelf/libelf-tools.c
@@ -20,28 +20,100 @@
/* ------------------------------------------------------------------------ */
-uint64_t elf_access_unsigned(struct elf_binary * elf, const void *ptr,
- uint64_t offset, size_t size)
+void elf_mark_broken(struct elf_binary *elf, const char *msg)
{
+ if ( elf->broken == NULL )
+ elf->broken = msg;
+}
+
+const char *elf_check_broken(const struct elf_binary *elf)
+{
+ return elf->broken;
+}
+
+static int elf_ptrval_in_range(elf_ptrval ptrval, uint64_t size,
+ const void *region, uint64_t regionsize)
+ /*
+ * Returns true if the putative memory area [ptrval,ptrval+size>
+ * is completely inside the region [region,region+regionsize>.
+ *
+ * ptrval and size are the untrusted inputs to be checked.
+ * region and regionsize are trusted and must be correct and valid,
+ * although it is OK for region to perhaps be maliciously NULL
+ * (but not some other malicious value).
+ */
+{
+ elf_ptrval regionp = (elf_ptrval)region;
+
+ if ( (region == NULL) ||
+ (ptrval < regionp) || /* start is before region */
+ (ptrval > regionp + regionsize) || /* start is after region */
+ (size > regionsize - (ptrval - regionp)) ) /* too big */
+ return 0;
+ return 1;
+}
+
+int elf_access_ok(struct elf_binary * elf,
+ uint64_t ptrval, size_t size)
+{
+ if ( elf_ptrval_in_range(ptrval, size, elf->image_base, elf->size) )
+ return 1;
+ if ( elf_ptrval_in_range(ptrval, size, elf->dest_base, elf->dest_size) )
+ return 1;
+ if ( elf_ptrval_in_range(ptrval, size,
+ elf->caller_xdest_base, elf->caller_xdest_size) )
+ return 1;
+ elf_mark_broken(elf, "out of range access");
+ return 0;
+}
+
+void elf_memcpy_safe(struct elf_binary *elf, elf_ptrval dst,
+ elf_ptrval src, size_t size)
+{
+ if ( elf_access_ok(elf, dst, size) &&
+ elf_access_ok(elf, src, size) )
+ {
+ /* use memmove because these checks do not prove that the
+ * regions don't overlap and overlapping regions grant
+ * permission for compiler malice */
+ elf_memmove_unchecked(ELF_UNSAFE_PTR(dst), ELF_UNSAFE_PTR(src), size);
+ }
+}
+
+void elf_memset_safe(struct elf_binary *elf, elf_ptrval dst, int c, size_t size)
+{
+ if ( elf_access_ok(elf, dst, size) )
+ {
+ elf_memset_unchecked(ELF_UNSAFE_PTR(dst), c, size);
+ }
+}
+
+uint64_t elf_access_unsigned(struct elf_binary * elf, elf_ptrval base,
+ uint64_t moreoffset, size_t size)
+{
+ elf_ptrval ptrval = base + moreoffset;
int need_swap = elf_swap(elf);
const uint8_t *u8;
const uint16_t *u16;
const uint32_t *u32;
const uint64_t *u64;
+ if ( !elf_access_ok(elf, ptrval, size) )
+ return 0;
+
switch ( size )
{
case 1:
- u8 = ptr + offset;
+ u8 = (const void*)ptrval;
return *u8;
case 2:
- u16 = ptr + offset;
+ u16 = (const void*)ptrval;
return need_swap ? bswap_16(*u16) : *u16;
case 4:
- u32 = ptr + offset;
+ u32 = (const void*)ptrval;
return need_swap ? bswap_32(*u32) : *u32;
case 8:
- u64 = ptr + offset;
+ u64 = (const void*)ptrval;
return need_swap ? bswap_64(*u64) : *u64;
default:
return 0;
@@ -122,6 +194,28 @@ const char *elf_section_name(struct elf_binary *elf,
return elf_strval(elf, elf->sec_strtab + elf_uval(elf, shdr, sh_name));
}
+const char *elf_strval(struct elf_binary *elf, elf_ptrval start)
+{
+ uint64_t length;
+
+ for ( length = 0; ; length++ ) {
+ if ( !elf_access_ok(elf, start + length, 1) )
+ return NULL;
+ if ( !elf_access_unsigned(elf, start, length, 1) )
+ /* ok */
+ return ELF_UNSAFE_PTR(start);
+ }
+}
+
+const char *elf_strfmt(struct elf_binary *elf, elf_ptrval start)
+{
+ const char *str = elf_strval(elf, start);
+
+ if ( str == NULL )
+ return "(invalid)";
+ return str;
+}
+
ELF_PTRVAL_CONST_VOID elf_section_start(struct elf_binary *elf, ELF_HANDLE_DECL(elf_shdr) shdr)
{
return ELF_IMAGE_BASE(elf) + elf_uval(elf, shdr, sh_offset);
diff --git a/xen/include/xen/libelf.h b/xen/include/xen/libelf.h
index af5b5c5..ddc3ed7 100644
--- a/xen/include/xen/libelf.h
+++ b/xen/include/xen/libelf.h
@@ -57,8 +57,9 @@ typedef void elf_log_callback(struct elf_binary*, void *caller_data,
* on this.
* This replaces variables which were char*,void*
* and their const versions, so we provide four
- * different declaration macros:
+ * different obsolete declaration macros:
* ELF_PTRVAL_{,CONST}{VOID,CHAR}
+ * New code can simply use the elf_ptrval typedef.
* HANDLE A pointer to a struct. There is one of these types
* for each pointer type - that is, for each "structname".
* In the arguments to the various HANDLE macros, structname
@@ -67,54 +68,66 @@ typedef void elf_log_callback(struct elf_binary*, void *caller_data,
* pointers. In the current code attempts to do so will
* compile, but in the next patch this will become a
* compile error.
- * We provide two declaration macros for const and
- * non-const pointers.
+ * We also provide a second declaration macro for
+ * pointers which were to const; this is obsolete.
*/
-#define ELF_REALPTR2PTRVAL(realpointer) (realpointer)
+typedef uintptr_t elf_ptrval;
+
+#define ELF_REALPTR2PTRVAL(realpointer) ((elf_ptrval)(realpointer))
/* Converts an actual C pointer into a PTRVAL */
-#define ELF_HANDLE_DECL_NONCONST(structname) structname *
-#define ELF_HANDLE_DECL(structname) const structname *
+#define ELF_HANDLE_DECL_NONCONST(structname) structname##_handle /*obsolete*/
+#define ELF_HANDLE_DECL(structname) structname##_handle
/* Provides a type declaration for a HANDLE. */
- /* May only be used to declare ONE variable at a time */
-#define ELF_PTRVAL_VOID void *
-#define ELF_PTRVAL_CHAR char *
-#define ELF_PTRVAL_CONST_VOID const void *
-#define ELF_PTRVAL_CONST_CHAR const char *
- /* Provides a type declaration for a PTRVAL. */
- /* May only be used to declare ONE variable at a time */
+#define ELF_PTRVAL_VOID elf_ptrval /*obsolete*/
+#define ELF_PTRVAL_CHAR elf_ptrval /*obsolete*/
+#define ELF_PTRVAL_CONST_VOID elf_ptrval /*obsolete*/
+#define ELF_PTRVAL_CONST_CHAR elf_ptrval /*obsolete*/
+
+#ifdef __XEN__
+# define ELF_PRPTRVAL "lu"
+ /*
+ * PRIuPTR is misdefined in xen/include/xen/inttypes.h, on 32-bit,
+ * to "u", when in fact uintptr_t is an unsigned long.
+ */
+#else
+# define ELF_PRPTRVAL PRIuPTR
+#endif
+ /* printf format a la PRId... for a PTRVAL */
-#define ELF_DEFINE_HANDLE(structname) /* empty */
+#define ELF_DEFINE_HANDLE(structname) \
+ typedef union { \
+ elf_ptrval ptrval; \
+ const structname *typeonly; /* for sizeof, offsetof, &c only */ \
+ } structname##_handle;
/*
* This must be invoked for each HANDLE type to define
* the actual C type used for that kind of HANDLE.
*/
-#define ELF_PRPTRVAL "p"
- /* printf format a la PRId... for a PTRVAL */
-
-#define ELF_MAKE_HANDLE(structname, ptrval) (ptrval)
+#define ELF_MAKE_HANDLE(structname, ptrval) ((structname##_handle){ ptrval })
/* Converts a PTRVAL to a HANDLE */
-#define ELF_IMAGE_BASE(elf) ((elf)->image)
+#define ELF_IMAGE_BASE(elf) ((elf_ptrval)(elf)->image_base)
/* Returns the base of the image as a PTRVAL. */
-#define ELF_HANDLE_PTRVAL(handleval) ((void*)(handleval))
+#define ELF_HANDLE_PTRVAL(handleval) ((handleval).ptrval)
/* Converts a HANDLE to a PTRVAL. */
-#define ELF_OBSOLETE_VOIDP_CAST (void*)(uintptr_t)
+#define ELF_OBSOLETE_VOIDP_CAST /*empty*/
/*
- * In some places the existing code needs to
+ * In some places the old code used to need to
* - cast away const (the existing code uses const a fair
* bit but actually sometimes wants to write to its input)
* from a PTRVAL.
* - convert an integer representing a pointer to a PTRVAL
- * This macro provides a suitable cast.
+ * Nowadays all of these re uintptr_ts so there is no const problem
+ * and no need for any casting.
*/
-#define ELF_UNSAFE_PTR(ptrval) ((void*)(uintptr_t)(ptrval))
+#define ELF_UNSAFE_PTR(ptrval) ((void*)(elf_ptrval)(ptrval))
/*
* Turns a PTRVAL into an actual C pointer. Before this is done
* the caller must have ensured that the PTRVAL does in fact point
@@ -122,18 +135,21 @@ typedef void elf_log_callback(struct elf_binary*, void *caller_data,
*/
/* PTRVALs can be INVALID (ie, NULL). */
-#define ELF_INVALID_PTRVAL (NULL) /* returns NULL PTRVAL */
+#define ELF_INVALID_PTRVAL ((elf_ptrval)0) /* returns NULL PTRVAL */
#define ELF_INVALID_HANDLE(structname) /* returns NULL handle */ \
ELF_MAKE_HANDLE(structname, ELF_INVALID_PTRVAL)
-#define ELF_PTRVAL_VALID(ptrval) (ptrval) /* } */
-#define ELF_HANDLE_VALID(handleval) (handleval) /* } predicates */
-#define ELF_PTRVAL_INVALID(ptrval) ((ptrval) == NULL) /* } */
+#define ELF_PTRVAL_VALID(ptrval) (!!(ptrval)) /* } */
+#define ELF_HANDLE_VALID(handleval) (!!(handleval).ptrval) /* } predicates */
+#define ELF_PTRVAL_INVALID(ptrval) (!ELF_PTRVAL_VALID((ptrval))) /* } */
+
+#define ELF_MAX_PTRVAL (~(elf_ptrval)0)
+ /* PTRVAL value guaranteed to compare > to any valid PTRVAL */
/* For internal use by other macros here */
#define ELF__HANDLE_FIELD_TYPE(handleval, elm) \
- typeof((handleval)->elm)
+ typeof((handleval).typeonly->elm)
#define ELF__HANDLE_FIELD_OFFSET(handleval, elm) \
- offsetof(typeof(*(handleval)),elm)
+ offsetof(typeof(*(handleval).typeonly),elm)
/* ------------------------------------------------------------------------ */
@@ -182,7 +198,7 @@ ELF_DEFINE_HANDLE(elf_note)
struct elf_binary {
/* elf binary */
- const char *image;
+ const void *image_base;
size_t size;
char class;
char data;
@@ -190,10 +206,16 @@ struct elf_binary {
ELF_HANDLE_DECL(elf_ehdr) ehdr;
ELF_PTRVAL_CONST_CHAR sec_strtab;
ELF_HANDLE_DECL(elf_shdr) sym_tab;
- ELF_PTRVAL_CONST_CHAR sym_strtab;
+ uint64_t sym_strtab;
/* loaded to */
- char *dest;
+ /*
+ * dest_base and dest_size are trusted and must be correct;
+ * whenever dest_size is not 0, both of these must be valid
+ * so long as the struct elf_binary is in use.
+ */
+ char *dest_base;
+ size_t dest_size;
uint64_t pstart;
uint64_t pend;
uint64_t reloc_offset;
@@ -201,12 +223,22 @@ struct elf_binary {
uint64_t bsd_symtab_pstart;
uint64_t bsd_symtab_pend;
+ /*
+ * caller's other acceptable destination
+ *
+ * Again, these are trusted and must be valid (or 0) so long
+ * as the struct elf_binary is in use.
+ */
+ void *caller_xdest_base;
+ uint64_t caller_xdest_size;
+
#ifndef __XEN__
/* misc */
elf_log_callback *log_callback;
void *log_caller_data;
#endif
int verbose;
+ const char *broken;
};
/* ------------------------------------------------------------------------ */
@@ -224,22 +256,27 @@ struct elf_binary {
#define elf_lsb(elf) (ELFDATA2LSB == (elf)->data)
#define elf_swap(elf) (NATIVE_ELFDATA != (elf)->data)
-#define elf_uval(elf, str, elem) \
- ((ELFCLASS64 == (elf)->class) \
- ? elf_access_unsigned((elf), (str), \
- offsetof(typeof(*(str)),e64.elem), \
- sizeof((str)->e64.elem)) \
- : elf_access_unsigned((elf), (str), \
- offsetof(typeof(*(str)),e32.elem), \
- sizeof((str)->e32.elem)))
+#define elf_uval_3264(elf, handle, elem) \
+ elf_access_unsigned((elf), (handle).ptrval, \
+ offsetof(typeof(*(handle).typeonly),elem), \
+ sizeof((handle).typeonly->elem))
+
+#define elf_uval(elf, handle, elem) \
+ ((ELFCLASS64 == (elf)->class) \
+ ? elf_uval_3264(elf, handle, e64.elem) \
+ : elf_uval_3264(elf, handle, e32.elem))
/*
* Reads an unsigned field in a header structure in the ELF.
* str is a HANDLE, and elem is the field name in it.
*/
-#define elf_size(elf, str) \
+
+#define elf_size(elf, handle_or_handletype) ({ \
+ typeof(handle_or_handletype) elf_size__dummy; \
((ELFCLASS64 == (elf)->class) \
- ? sizeof((str)->e64) : sizeof((str)->e32))
+ ? sizeof(elf_size__dummy.typeonly->e64) \
+ : sizeof(elf_size__dummy.typeonly->e32)); \
+})
/*
* Returns the size of the substructure for the appropriate 32/64-bitness.
* str should be a HANDLE.
@@ -251,23 +288,37 @@ uint64_t elf_access_unsigned(struct elf_binary *elf, ELF_PTRVAL_CONST_VOID ptr,
uint64_t elf_round_up(struct elf_binary *elf, uint64_t addr);
+const char *elf_strval(struct elf_binary *elf, elf_ptrval start);
+ /* may return NULL if the string is out of range etc. */
-#define elf_strval(elf,x) ((const char*)(x)) /* may return NULL in the future */
-#define elf_strfmt(elf,x) ((const char*)(x)) /* will return (invalid) instead */
+const char *elf_strfmt(struct elf_binary *elf, elf_ptrval start);
+ /* like elf_strval but returns "(invalid)" instead of NULL */
-#define elf_memcpy_safe(elf, dst, src, sz) memcpy((dst),(src),(sz))
-#define elf_memset_safe(elf, dst, c, sz) memset((dst),(c),(sz))
+void elf_memcpy_safe(struct elf_binary*, elf_ptrval dst, elf_ptrval src, size_t);
+void elf_memset_safe(struct elf_binary*, elf_ptrval dst, int c, size_t);
/*
- * Versions of memcpy and memset which will (in the next patch)
- * arrange never to write outside permitted areas.
+ * Versions of memcpy and memset which arrange never to write
+ * outside permitted areas.
*/
-#define elf_store_val(elf, type, ptr, val) (*(type*)(ptr) = (val))
+int elf_access_ok(struct elf_binary * elf,
+ uint64_t ptrval, size_t size);
+
+#define elf_store_val(elf, type, ptr, val) \
+ ({ \
+ typeof(type) elf_store__val = (val); \
+ elf_ptrval elf_store__targ = ptr; \
+ if (elf_access_ok((elf), elf_store__targ, \
+ sizeof(elf_store__val))) { \
+ elf_memcpy_unchecked((void*)elf_store__targ, &elf_store__val, \
+ sizeof(elf_store__val)); \
+ } \
+ }) \
/* Stores a value at a particular PTRVAL. */
-#define elf_store_field(elf, hdr, elm, val) \
- (elf_store_val((elf), ELF__HANDLE_FIELD_TYPE(hdr, elm), \
- &((hdr)->elm), \
+#define elf_store_field(elf, hdr, elm, val) \
+ (elf_store_val((elf), ELF__HANDLE_FIELD_TYPE(hdr, elm), \
+ ELF_HANDLE_PTRVAL(hdr) + ELF__HANDLE_FIELD_OFFSET(hdr, elm), \
(val)))
/* Stores a 32/64-bit field. hdr is a HANDLE and elm is the field name. */
@@ -306,6 +357,10 @@ int elf_phdr_is_loadable(struct elf_binary *elf, ELF_HANDLE_DECL(elf_phdr) phdr)
/* xc_libelf_loader.c */
int elf_init(struct elf_binary *elf, const char *image, size_t size);
+ /*
+ * image and size must be correct. They will be recorded in
+ * *elf, and must remain valid while the elf is in use.
+ */
#ifdef __XEN__
void elf_set_verbose(struct elf_binary *elf);
#else
@@ -321,6 +376,9 @@ uint64_t elf_lookup_addr(struct elf_binary *elf, const char *symbol);
void elf_parse_bsdsyms(struct elf_binary *elf, uint64_t pstart); /* private */
+void elf_mark_broken(struct elf_binary *elf, const char *msg);
+const char *elf_check_broken(const struct elf_binary *elf); /* NULL means OK */
+
/* ------------------------------------------------------------------------ */
/* xc_libelf_relocate.c */
@@ -395,16 +453,38 @@ int elf_xen_parse_guest_info(struct elf_binary *elf,
int elf_xen_parse(struct elf_binary *elf,
struct elf_dom_parms *parms);
-#define elf_memcpy_unchecked memcpy
-#define elf_memset_unchecked memset
+static inline void *elf_memcpy_unchecked(void *dest, const void *src, size_t n)
+ { return memcpy(dest, src, n); }
+static inline void *elf_memmove_unchecked(void *dest, const void *src, size_t n)
+ { return memmove(dest, src, n); }
+static inline void *elf_memset_unchecked(void *s, int c, size_t n)
+ { return memset(s, c, n); }
/*
- * Unsafe versions of memcpy and memset which take actual C
- * pointers. These are just like real memcpy and memset.
+ * Unsafe versions of memcpy, memmove memset which take actual C
+ * pointers. These are just like the real functions.
+ * We provide these so that in libelf-private.h we can #define
+ * memcpy, memset and memmove to undefined MISTAKE things.
*/
-#define ELF_ADVANCE_DEST(elf, amount) elf->dest += (amount)
- /* Advances past amount bytes of the current destination area. */
+/* Advances past amount bytes of the current destination area. */
+static inline void ELF_ADVANCE_DEST(struct elf_binary *elf, uint64_t amount)
+{
+ if ( elf->dest_base == NULL )
+ {
+ elf_mark_broken(elf, "advancing in null image");
+ }
+ else if ( elf->dest_size >= amount )
+ {
+ elf->dest_base += amount;
+ elf->dest_size -= amount;
+ }
+ else
+ {
+ elf->dest_size = 0;
+ elf_mark_broken(elf, "advancing past end (image very short?)");
+ }
+}
#endif /* __XEN_LIBELF_H__ */
--
1.7.2.5

@ -1,759 +0,0 @@
From e673ca50127b6c1263727aa31de0b8bb966ca7a2 Mon Sep 17 00:00:00 2001
From: Ian Jackson <ian.jackson@eu.citrix.com>
Date: Fri, 14 Jun 2013 16:43:18 +0100
Subject: [PATCH 15/23] libelf: use only unsigned integers
Signed integers have undesirable undefined behaviours on overflow.
Malicious compilers can turn apparently-correct code into code with
security vulnerabilities etc.
So use only unsigned integers. Exceptions are booleans (which we have
already changed) and error codes.
We _do_ change all the chars which aren't fixed constants from our own
text segment, but not the char*s. This is because it is safe to
access an arbitrary byte through a char*, but not necessarily safe to
convert an arbitrary value to a char.
As a consequence we need to compile libelf with -Wno-pointer-sign.
It is OK to change all the signed integers to unsigned because all the
inequalities in libelf are in contexts where we don't "expect"
negative numbers.
In libelf-dominfo.c:elf_xen_parse we rename a variable "rc" to
"more_notes" as it actually contains a note count derived from the
input image. The "error" return value from elf_xen_parse_notes is
changed from -1 to ~0U.
grepping shows only one occurrence of "PRId" or "%d" or "%ld" in
libelf and xc_dom_elfloader.c (a "%d" which becomes "%u").
This is part of the fix to a security issue, XSA-55.
For those concerned about unintentional functional changes, the
following rune produces a version of the patch which is much smaller
and eliminates only non-functional changes:
GIT_EXTERNAL_DIFF=.../unsigned-differ git-diff <before>..<after>
where <before> and <after> are git refs for the code before and after
this patch, and unsigned-differ is this shell script:
#!/bin/bash
set -e
seddery () {
perl -pe 's/\b(?:elf_errorstatus|elf_negerrnoval)\b/int/g'
}
path="$1"
in="$2"
out="$5"
set +e
diff -pu --label "$path~" <(seddery <"$in") --label "$path" <(seddery <"$out")
rc=$?
set -e
if [ $rc = 1 ]; then rc=0; fi
exit $rc
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
tools/libxc/Makefile | 9 +++++-
tools/libxc/xc_dom.h | 7 +++--
tools/libxc/xc_dom_elfloader.c | 42 ++++++++++++++++-------------
tools/xcutils/readnotes.c | 15 +++++-----
xen/common/libelf/Makefile | 2 +
xen/common/libelf/libelf-dominfo.c | 52 ++++++++++++++++++-----------------
xen/common/libelf/libelf-loader.c | 20 +++++++-------
xen/common/libelf/libelf-tools.c | 24 ++++++++--------
xen/include/xen/libelf.h | 21 ++++++++------
9 files changed, 105 insertions(+), 87 deletions(-)
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index d8c6a60..a3fd90c 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -52,8 +52,13 @@ endif
vpath %.c ../../xen/common/libelf
CFLAGS += -I../../xen/common/libelf
-GUEST_SRCS-y += libelf-tools.c libelf-loader.c
-GUEST_SRCS-y += libelf-dominfo.c
+ELF_SRCS-y += libelf-tools.c libelf-loader.c
+ELF_SRCS-y += libelf-dominfo.c
+
+GUEST_SRCS-y += $(ELF_SRCS-y)
+
+$(patsubst %.c,%.o,$(ELF_SRCS-y)): CFLAGS += -Wno-pointer-sign
+$(patsubst %.c,%.opic,$(ELF_SRCS-y)): CFLAGS += -Wno-pointer-sign
# new domain builder
GUEST_SRCS-y += xc_dom_core.c xc_dom_boot.c
diff --git a/tools/libxc/xc_dom.h b/tools/libxc/xc_dom.h
index 9f8037e..0161459 100644
--- a/tools/libxc/xc_dom.h
+++ b/tools/libxc/xc_dom.h
@@ -140,9 +140,10 @@ struct xc_dom_image {
struct xc_dom_loader {
char *name;
- int (*probe) (struct xc_dom_image * dom);
- int (*parser) (struct xc_dom_image * dom);
- int (*loader) (struct xc_dom_image * dom);
+ /* Sadly the error returns from these functions are not consistent: */
+ elf_negerrnoval (*probe) (struct xc_dom_image * dom);
+ elf_negerrnoval (*parser) (struct xc_dom_image * dom);
+ elf_errorstatus (*loader) (struct xc_dom_image * dom);
struct xc_dom_loader *next;
};
diff --git a/tools/libxc/xc_dom_elfloader.c b/tools/libxc/xc_dom_elfloader.c
index 9ba64ae..62a0d3b 100644
--- a/tools/libxc/xc_dom_elfloader.c
+++ b/tools/libxc/xc_dom_elfloader.c
@@ -84,7 +84,7 @@ static char *xc_dom_guest_type(struct xc_dom_image *dom,
/* ------------------------------------------------------------------------ */
/* parse elf binary */
-static int check_elf_kernel(struct xc_dom_image *dom, bool verbose)
+static elf_negerrnoval check_elf_kernel(struct xc_dom_image *dom, bool verbose)
{
if ( dom->kernel_blob == NULL )
{
@@ -106,12 +106,12 @@ static int check_elf_kernel(struct xc_dom_image *dom, bool verbose)
return 0;
}
-static int xc_dom_probe_elf_kernel(struct xc_dom_image *dom)
+static elf_negerrnoval xc_dom_probe_elf_kernel(struct xc_dom_image *dom)
{
return check_elf_kernel(dom, 0);
}
-static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
+static elf_errorstatus xc_dom_load_elf_symtab(struct xc_dom_image *dom,
struct elf_binary *elf, bool load)
{
struct elf_binary syms;
@@ -119,7 +119,7 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
xen_vaddr_t symtab, maxaddr;
ELF_PTRVAL_CHAR hdr;
size_t size;
- int h, count, type, i, tables = 0;
+ unsigned h, count, type, i, tables = 0;
if ( elf_swap(elf) )
{
@@ -140,13 +140,13 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
elf->caller_xdest_base = hdr_ptr;
elf->caller_xdest_size = allow_size;
hdr = ELF_REALPTR2PTRVAL(hdr_ptr);
- elf_store_val(elf, int, hdr, size - sizeof(int));
+ elf_store_val(elf, unsigned, hdr, size - sizeof(unsigned));
}
else
{
char *hdr_ptr;
- size = sizeof(int) + elf_size(elf, elf->ehdr) +
+ size = sizeof(unsigned) + elf_size(elf, elf->ehdr) +
elf_shdr_count(elf) * elf_size(elf, shdr);
hdr_ptr = xc_dom_malloc(dom, size);
if ( hdr_ptr == NULL )
@@ -157,15 +157,15 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
dom->bsd_symtab_start = elf_round_up(elf, dom->kernel_seg.vend);
}
- elf_memcpy_safe(elf, hdr + sizeof(int),
+ elf_memcpy_safe(elf, hdr + sizeof(unsigned),
ELF_IMAGE_BASE(elf),
elf_size(elf, elf->ehdr));
- elf_memcpy_safe(elf, hdr + sizeof(int) + elf_size(elf, elf->ehdr),
+ elf_memcpy_safe(elf, hdr + sizeof(unsigned) + elf_size(elf, elf->ehdr),
ELF_IMAGE_BASE(elf) + elf_uval(elf, elf->ehdr, e_shoff),
elf_shdr_count(elf) * elf_size(elf, shdr));
if ( elf_64bit(elf) )
{
- Elf64_Ehdr *ehdr = (Elf64_Ehdr *)(hdr + sizeof(int));
+ Elf64_Ehdr *ehdr = (Elf64_Ehdr *)(hdr + sizeof(unsigned));
ehdr->e_phoff = 0;
ehdr->e_phentsize = 0;
ehdr->e_phnum = 0;
@@ -174,22 +174,22 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
}
else
{
- Elf32_Ehdr *ehdr = (Elf32_Ehdr *)(hdr + sizeof(int));
+ Elf32_Ehdr *ehdr = (Elf32_Ehdr *)(hdr + sizeof(unsigned));
ehdr->e_phoff = 0;
ehdr->e_phentsize = 0;
ehdr->e_phnum = 0;
ehdr->e_shoff = elf_size(elf, elf->ehdr);
ehdr->e_shstrndx = SHN_UNDEF;
}
- if ( elf->caller_xdest_size < sizeof(int) )
+ if ( elf->caller_xdest_size < sizeof(unsigned) )
{
DOMPRINTF("%s/%s: header size %"PRIx64" too small",
__FUNCTION__, load ? "load" : "parse",
(uint64_t)elf->caller_xdest_size);
return -1;
}
- if ( elf_init(&syms, elf->caller_xdest_base + sizeof(int),
- elf->caller_xdest_size - sizeof(int)) )
+ if ( elf_init(&syms, elf->caller_xdest_base + sizeof(unsigned),
+ elf->caller_xdest_size - sizeof(unsigned)) )
return -1;
/*
@@ -209,7 +209,7 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
xc_elf_set_logfile(dom->xch, &syms, 1);
- symtab = dom->bsd_symtab_start + sizeof(int);
+ symtab = dom->bsd_symtab_start + sizeof(unsigned);
maxaddr = elf_round_up(&syms, symtab + elf_size(&syms, syms.ehdr) +
elf_shdr_count(&syms) * elf_size(&syms, shdr));
@@ -255,7 +255,7 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
size = elf_uval(&syms, shdr, sh_size);
maxaddr = elf_round_up(&syms, maxaddr + size);
tables++;
- DOMPRINTF("%s: h=%d %s, size=0x%zx, maxaddr=0x%" PRIx64 "",
+ DOMPRINTF("%s: h=%u %s, size=0x%zx, maxaddr=0x%" PRIx64 "",
__FUNCTION__, h,
type == SHT_SYMTAB ? "symtab" : "strtab",
size, maxaddr);
@@ -294,10 +294,14 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
return 0;
}
-static int xc_dom_parse_elf_kernel(struct xc_dom_image *dom)
+static elf_errorstatus xc_dom_parse_elf_kernel(struct xc_dom_image *dom)
+ /*
+ * This function sometimes returns -1 for error and sometimes
+ * an errno value. ?!?!
+ */
{
struct elf_binary *elf;
- int rc;
+ elf_errorstatus rc;
rc = check_elf_kernel(dom, 1);
if ( rc != 0 )
@@ -358,10 +362,10 @@ out:
return rc;
}
-static int xc_dom_load_elf_kernel(struct xc_dom_image *dom)
+static elf_errorstatus xc_dom_load_elf_kernel(struct xc_dom_image *dom)
{
struct elf_binary *elf = dom->private_loader;
- int rc;
+ elf_errorstatus rc;
xen_pfn_t pages;
elf->dest_base = xc_dom_seg_to_ptr_pages(dom, &dom->kernel_seg, &pages);
diff --git a/tools/xcutils/readnotes.c b/tools/xcutils/readnotes.c
index d1f7a30..2ca7732 100644
--- a/tools/xcutils/readnotes.c
+++ b/tools/xcutils/readnotes.c
@@ -70,7 +70,7 @@ static void print_numeric_note(const char *prefix, struct elf_binary *elf,
ELF_HANDLE_DECL(elf_note) note)
{
uint64_t value = elf_note_numeric(elf, note);
- int descsz = elf_uval(elf, note, descsz);
+ unsigned descsz = elf_uval(elf, note, descsz);
printf("%s: %#*" PRIx64 " (%d bytes)\n",
prefix, 2+2*descsz, value, descsz);
@@ -79,7 +79,7 @@ static void print_numeric_note(const char *prefix, struct elf_binary *elf,
static void print_l1_mfn_valid_note(const char *prefix, struct elf_binary *elf,
ELF_HANDLE_DECL(elf_note) note)
{
- int descsz = elf_uval(elf, note, descsz);
+ unsigned descsz = elf_uval(elf, note, descsz);
ELF_PTRVAL_CONST_VOID desc = elf_note_desc(elf, note);
/* XXX should be able to cope with a list of values. */
@@ -99,10 +99,10 @@ static void print_l1_mfn_valid_note(const char *prefix, struct elf_binary *elf,
}
-static int print_notes(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) start, ELF_HANDLE_DECL(elf_note) end)
+static unsigned print_notes(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) start, ELF_HANDLE_DECL(elf_note) end)
{
ELF_HANDLE_DECL(elf_note) note;
- int notes_found = 0;
+ unsigned notes_found = 0;
const char *this_note_name;
for ( note = start; ELF_HANDLE_PTRVAL(note) < ELF_HANDLE_PTRVAL(end); note = elf_note_next(elf, note) )
@@ -161,7 +161,7 @@ static int print_notes(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) start,
break;
default:
printf("unknown note type %#x\n",
- (int)elf_uval(elf, note, type));
+ (unsigned)elf_uval(elf, note, type));
break;
}
}
@@ -171,12 +171,13 @@ static int print_notes(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) start,
int main(int argc, char **argv)
{
const char *f;
- int fd,h,size,usize,count;
+ int fd;
+ unsigned h,size,usize,count;
void *image,*tmp;
struct stat st;
struct elf_binary elf;
ELF_HANDLE_DECL(elf_shdr) shdr;
- int notes_found = 0;
+ unsigned notes_found = 0;
struct setup_header *hdr;
uint64_t payload_offset, payload_length;
diff --git a/xen/common/libelf/Makefile b/xen/common/libelf/Makefile
index 18dc8e2..5bf8f76 100644
--- a/xen/common/libelf/Makefile
+++ b/xen/common/libelf/Makefile
@@ -2,6 +2,8 @@ obj-bin-y := libelf.o
SECTIONS := text data $(SPECIAL_DATA_SECTIONS)
+CFLAGS += -Wno-pointer-sign
+
libelf.o: libelf-temp.o Makefile
$(OBJCOPY) $(foreach s,$(SECTIONS),--rename-section .$(s)=.init.$(s)) $< $@
diff --git a/xen/common/libelf/libelf-dominfo.c b/xen/common/libelf/libelf-dominfo.c
index 12b6c2a..cdd0d31 100644
--- a/xen/common/libelf/libelf-dominfo.c
+++ b/xen/common/libelf/libelf-dominfo.c
@@ -29,15 +29,15 @@ static const char *const elf_xen_feature_names[] = {
[XENFEAT_pae_pgdir_above_4gb] = "pae_pgdir_above_4gb",
[XENFEAT_dom0] = "dom0"
};
-static const int elf_xen_features =
+static const unsigned elf_xen_features =
sizeof(elf_xen_feature_names) / sizeof(elf_xen_feature_names[0]);
-int elf_xen_parse_features(const char *features,
+elf_errorstatus elf_xen_parse_features(const char *features,
uint32_t *supported,
uint32_t *required)
{
- char feature[64];
- int pos, len, i;
+ unsigned char feature[64];
+ unsigned pos, len, i;
if ( features == NULL )
return 0;
@@ -94,7 +94,7 @@ int elf_xen_parse_features(const char *features,
/* ------------------------------------------------------------------------ */
/* xen elf notes */
-int elf_xen_parse_note(struct elf_binary *elf,
+elf_errorstatus elf_xen_parse_note(struct elf_binary *elf,
struct elf_dom_parms *parms,
ELF_HANDLE_DECL(elf_note) note)
{
@@ -125,7 +125,7 @@ int elf_xen_parse_note(struct elf_binary *elf,
const char *str = NULL;
uint64_t val = 0;
unsigned int i;
- int type = elf_uval(elf, note, type);
+ unsigned type = elf_uval(elf, note, type);
if ( (type >= sizeof(note_desc) / sizeof(note_desc[0])) ||
(note_desc[type].name == NULL) )
@@ -216,12 +216,14 @@ int elf_xen_parse_note(struct elf_binary *elf,
return 0;
}
-static int elf_xen_parse_notes(struct elf_binary *elf,
+#define ELF_NOTE_INVALID (~0U)
+
+static unsigned elf_xen_parse_notes(struct elf_binary *elf,
struct elf_dom_parms *parms,
ELF_PTRVAL_CONST_VOID start,
ELF_PTRVAL_CONST_VOID end)
{
- int xen_elfnotes = 0;
+ unsigned xen_elfnotes = 0;
ELF_HANDLE_DECL(elf_note) note;
const char *note_name;
@@ -237,7 +239,7 @@ static int elf_xen_parse_notes(struct elf_binary *elf,
if ( strcmp(note_name, "Xen") )
continue;
if ( elf_xen_parse_note(elf, parms, note) )
- return -1;
+ return ELF_NOTE_INVALID;
xen_elfnotes++;
}
return xen_elfnotes;
@@ -246,12 +248,12 @@ static int elf_xen_parse_notes(struct elf_binary *elf,
/* ------------------------------------------------------------------------ */
/* __xen_guest section */
-int elf_xen_parse_guest_info(struct elf_binary *elf,
+elf_errorstatus elf_xen_parse_guest_info(struct elf_binary *elf,
struct elf_dom_parms *parms)
{
ELF_PTRVAL_CONST_CHAR h;
- char name[32], value[128];
- int len;
+ unsigned char name[32], value[128];
+ unsigned len;
h = parms->guest_info;
#define STAR(h) (elf_access_unsigned(elf, (h), 0, 1))
@@ -334,13 +336,13 @@ int elf_xen_parse_guest_info(struct elf_binary *elf,
/* ------------------------------------------------------------------------ */
/* sanity checks */
-static int elf_xen_note_check(struct elf_binary *elf,
+static elf_errorstatus elf_xen_note_check(struct elf_binary *elf,
struct elf_dom_parms *parms)
{
if ( (ELF_PTRVAL_INVALID(parms->elf_note_start)) &&
(ELF_PTRVAL_INVALID(parms->guest_info)) )
{
- int machine = elf_uval(elf, elf->ehdr, e_machine);
+ unsigned machine = elf_uval(elf, elf->ehdr, e_machine);
if ( (machine == EM_386) || (machine == EM_X86_64) )
{
elf_err(elf, "%s: ERROR: Not a Xen-ELF image: "
@@ -378,7 +380,7 @@ static int elf_xen_note_check(struct elf_binary *elf,
return 0;
}
-static int elf_xen_addr_calc_check(struct elf_binary *elf,
+static elf_errorstatus elf_xen_addr_calc_check(struct elf_binary *elf,
struct elf_dom_parms *parms)
{
if ( (parms->elf_paddr_offset != UNSET_ADDR) &&
@@ -464,13 +466,13 @@ static int elf_xen_addr_calc_check(struct elf_binary *elf,
/* ------------------------------------------------------------------------ */
/* glue it all together ... */
-int elf_xen_parse(struct elf_binary *elf,
+elf_errorstatus elf_xen_parse(struct elf_binary *elf,
struct elf_dom_parms *parms)
{
ELF_HANDLE_DECL(elf_shdr) shdr;
ELF_HANDLE_DECL(elf_phdr) phdr;
- int xen_elfnotes = 0;
- int i, count, rc;
+ unsigned xen_elfnotes = 0;
+ unsigned i, count, more_notes;
elf_memset_unchecked(parms, 0, sizeof(*parms));
parms->virt_base = UNSET_ADDR;
@@ -495,13 +497,13 @@ int elf_xen_parse(struct elf_binary *elf,
if (elf_uval(elf, phdr, p_offset) == 0)
continue;
- rc = elf_xen_parse_notes(elf, parms,
+ more_notes = elf_xen_parse_notes(elf, parms,
elf_segment_start(elf, phdr),
elf_segment_end(elf, phdr));
- if ( rc == -1 )
+ if ( more_notes == ELF_NOTE_INVALID )
return -1;
- xen_elfnotes += rc;
+ xen_elfnotes += more_notes;
}
/*
@@ -518,17 +520,17 @@ int elf_xen_parse(struct elf_binary *elf,
if ( elf_uval(elf, shdr, sh_type) != SHT_NOTE )
continue;
- rc = elf_xen_parse_notes(elf, parms,
+ more_notes = elf_xen_parse_notes(elf, parms,
elf_section_start(elf, shdr),
elf_section_end(elf, shdr));
- if ( rc == -1 )
+ if ( more_notes == ELF_NOTE_INVALID )
return -1;
- if ( xen_elfnotes == 0 && rc > 0 )
+ if ( xen_elfnotes == 0 && more_notes > 0 )
elf_msg(elf, "%s: using notes from SHT_NOTE section\n", __FUNCTION__);
- xen_elfnotes += rc;
+ xen_elfnotes += more_notes;
}
}
diff --git a/xen/common/libelf/libelf-loader.c b/xen/common/libelf/libelf-loader.c
index 0dccd4d..c3a9e51 100644
--- a/xen/common/libelf/libelf-loader.c
+++ b/xen/common/libelf/libelf-loader.c
@@ -24,7 +24,7 @@
/* ------------------------------------------------------------------------ */
-int elf_init(struct elf_binary *elf, const char *image_input, size_t size)
+elf_errorstatus elf_init(struct elf_binary *elf, const char *image_input, size_t size)
{
ELF_HANDLE_DECL(elf_shdr) shdr;
uint64_t i, count, section, offset;
@@ -114,7 +114,7 @@ void elf_set_log(struct elf_binary *elf, elf_log_callback *log_callback,
elf->verbose = verbose;
}
-static int elf_load_image(struct elf_binary *elf,
+static elf_errorstatus elf_load_image(struct elf_binary *elf,
ELF_PTRVAL_VOID dst, ELF_PTRVAL_CONST_VOID src,
uint64_t filesz, uint64_t memsz)
{
@@ -129,9 +129,9 @@ void elf_set_verbose(struct elf_binary *elf)
elf->verbose = 1;
}
-static int elf_load_image(struct elf_binary *elf, ELF_PTRVAL_VOID dst, ELF_PTRVAL_CONST_VOID src, uint64_t filesz, uint64_t memsz)
+static elf_errorstatus elf_load_image(struct elf_binary *elf, ELF_PTRVAL_VOID dst, ELF_PTRVAL_CONST_VOID src, uint64_t filesz, uint64_t memsz)
{
- int rc;
+ elf_errorstatus rc;
if ( filesz > ULONG_MAX || memsz > ULONG_MAX )
return -1;
/* We trust the dom0 kernel image completely, so we don't care
@@ -151,7 +151,7 @@ void elf_parse_bsdsyms(struct elf_binary *elf, uint64_t pstart)
{
uint64_t sz;
ELF_HANDLE_DECL(elf_shdr) shdr;
- int i, type;
+ unsigned i, type;
if ( !ELF_HANDLE_VALID(elf->sym_tab) )
return;
@@ -187,7 +187,7 @@ static void elf_load_bsdsyms(struct elf_binary *elf)
ELF_PTRVAL_VOID symbase;
ELF_PTRVAL_VOID symtab_addr;
ELF_HANDLE_DECL_NONCONST(elf_shdr) shdr;
- int i, type;
+ unsigned i, type;
if ( !elf->bsd_symtab_pstart )
return;
@@ -220,7 +220,7 @@ do { \
elf_memcpy_safe(elf, ELF_HANDLE_PTRVAL(shdr),
ELF_IMAGE_BASE(elf) + elf_uval(elf, elf->ehdr, e_shoff),
sz);
- maxva = ELF_OBSOLETE_VOIDP_CAST elf_round_up(elf, (long)maxva + sz);
+ maxva = ELF_OBSOLETE_VOIDP_CAST elf_round_up(elf, (unsigned long)maxva + sz);
for ( i = 0; i < elf_shdr_count(elf); i++ )
{
@@ -233,10 +233,10 @@ do { \
elf_memcpy_safe(elf, maxva, elf_section_start(elf, shdr), sz);
/* Mangled to be based on ELF header location. */
elf_hdr_elm(elf, shdr, sh_offset, maxva - symtab_addr);
- maxva = ELF_OBSOLETE_VOIDP_CAST elf_round_up(elf, (long)maxva + sz);
+ maxva = ELF_OBSOLETE_VOIDP_CAST elf_round_up(elf, (unsigned long)maxva + sz);
}
shdr = ELF_MAKE_HANDLE(elf_shdr, ELF_HANDLE_PTRVAL(shdr) +
- (long)elf_uval(elf, elf->ehdr, e_shentsize));
+ (unsigned long)elf_uval(elf, elf->ehdr, e_shentsize));
}
/* Write down the actual sym size. */
@@ -273,7 +273,7 @@ void elf_parse_binary(struct elf_binary *elf)
__FUNCTION__, elf->pstart, elf->pend);
}
-int elf_load_binary(struct elf_binary *elf)
+elf_errorstatus elf_load_binary(struct elf_binary *elf)
{
ELF_HANDLE_DECL(elf_phdr) phdr;
uint64_t i, count, paddr, offset, filesz, memsz;
diff --git a/xen/common/libelf/libelf-tools.c b/xen/common/libelf/libelf-tools.c
index fa58f76..46d4ab1 100644
--- a/xen/common/libelf/libelf-tools.c
+++ b/xen/common/libelf/libelf-tools.c
@@ -122,19 +122,19 @@ uint64_t elf_access_unsigned(struct elf_binary * elf, elf_ptrval base,
uint64_t elf_round_up(struct elf_binary *elf, uint64_t addr)
{
- int elf_round = (elf_64bit(elf) ? 8 : 4) - 1;
+ uint64_t elf_round = (elf_64bit(elf) ? 8 : 4) - 1;
return (addr + elf_round) & ~elf_round;
}
/* ------------------------------------------------------------------------ */
-int elf_shdr_count(struct elf_binary *elf)
+unsigned elf_shdr_count(struct elf_binary *elf)
{
return elf_uval(elf, elf->ehdr, e_shnum);
}
-int elf_phdr_count(struct elf_binary *elf)
+unsigned elf_phdr_count(struct elf_binary *elf)
{
return elf_uval(elf, elf->ehdr, e_phnum);
}
@@ -144,7 +144,7 @@ ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_name(struct elf_binary *elf, const char *n
uint64_t count = elf_shdr_count(elf);
ELF_HANDLE_DECL(elf_shdr) shdr;
const char *sname;
- int i;
+ unsigned i;
for ( i = 0; i < count; i++ )
{
@@ -156,7 +156,7 @@ ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_name(struct elf_binary *elf, const char *n
return ELF_INVALID_HANDLE(elf_shdr);
}
-ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_index(struct elf_binary *elf, int index)
+ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_index(struct elf_binary *elf, unsigned index)
{
uint64_t count = elf_shdr_count(elf);
ELF_PTRVAL_CONST_VOID ptr;
@@ -170,7 +170,7 @@ ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_index(struct elf_binary *elf, int index)
return ELF_MAKE_HANDLE(elf_shdr, ptr);
}
-ELF_HANDLE_DECL(elf_phdr) elf_phdr_by_index(struct elf_binary *elf, int index)
+ELF_HANDLE_DECL(elf_phdr) elf_phdr_by_index(struct elf_binary *elf, unsigned index)
{
uint64_t count = elf_uval(elf, elf->ehdr, e_phnum);
ELF_PTRVAL_CONST_VOID ptr;
@@ -264,7 +264,7 @@ ELF_HANDLE_DECL(elf_sym) elf_sym_by_name(struct elf_binary *elf, const char *sym
return ELF_INVALID_HANDLE(elf_sym);
}
-ELF_HANDLE_DECL(elf_sym) elf_sym_by_index(struct elf_binary *elf, int index)
+ELF_HANDLE_DECL(elf_sym) elf_sym_by_index(struct elf_binary *elf, unsigned index)
{
ELF_PTRVAL_CONST_VOID ptr = elf_section_start(elf, elf->sym_tab);
ELF_HANDLE_DECL(elf_sym) sym;
@@ -280,7 +280,7 @@ const char *elf_note_name(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) note
ELF_PTRVAL_CONST_VOID elf_note_desc(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) note)
{
- int namesz = (elf_uval(elf, note, namesz) + 3) & ~3;
+ unsigned namesz = (elf_uval(elf, note, namesz) + 3) & ~3;
return ELF_HANDLE_PTRVAL(note) + elf_size(elf, note) + namesz;
}
@@ -288,7 +288,7 @@ ELF_PTRVAL_CONST_VOID elf_note_desc(struct elf_binary *elf, ELF_HANDLE_DECL(elf_
uint64_t elf_note_numeric(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) note)
{
ELF_PTRVAL_CONST_VOID desc = elf_note_desc(elf, note);
- int descsz = elf_uval(elf, note, descsz);
+ unsigned descsz = elf_uval(elf, note, descsz);
switch (descsz)
{
@@ -306,7 +306,7 @@ uint64_t elf_note_numeric_array(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note
unsigned int unitsz, unsigned int idx)
{
ELF_PTRVAL_CONST_VOID desc = elf_note_desc(elf, note);
- int descsz = elf_uval(elf, note, descsz);
+ unsigned descsz = elf_uval(elf, note, descsz);
if ( descsz % unitsz || idx >= descsz / unitsz )
return 0;
@@ -324,8 +324,8 @@ uint64_t elf_note_numeric_array(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note
ELF_HANDLE_DECL(elf_note) elf_note_next(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) note)
{
- int namesz = (elf_uval(elf, note, namesz) + 3) & ~3;
- int descsz = (elf_uval(elf, note, descsz) + 3) & ~3;
+ unsigned namesz = (elf_uval(elf, note, namesz) + 3) & ~3;
+ unsigned descsz = (elf_uval(elf, note, descsz) + 3) & ~3;
return ELF_MAKE_HANDLE(elf_note, ELF_HANDLE_PTRVAL(note) + elf_size(elf, note) + namesz + descsz);
}
diff --git a/xen/include/xen/libelf.h b/xen/include/xen/libelf.h
index 951430f..87e126a 100644
--- a/xen/include/xen/libelf.h
+++ b/xen/include/xen/libelf.h
@@ -31,6 +31,9 @@
#include <stdbool.h>
+typedef int elf_errorstatus; /* 0: ok; -ve (normally -1): error */
+typedef int elf_negerrnoval; /* 0: ok; -EFOO: error */
+
#undef ELFSIZE
#include "elfstructs.h"
#ifdef __XEN__
@@ -328,12 +331,12 @@ bool elf_access_ok(struct elf_binary * elf,
/* ------------------------------------------------------------------------ */
/* xc_libelf_tools.c */
-int elf_shdr_count(struct elf_binary *elf);
-int elf_phdr_count(struct elf_binary *elf);
+unsigned elf_shdr_count(struct elf_binary *elf);
+unsigned elf_phdr_count(struct elf_binary *elf);
ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_name(struct elf_binary *elf, const char *name);
-ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_index(struct elf_binary *elf, int index);
-ELF_HANDLE_DECL(elf_phdr) elf_phdr_by_index(struct elf_binary *elf, int index);
+ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_index(struct elf_binary *elf, unsigned index);
+ELF_HANDLE_DECL(elf_phdr) elf_phdr_by_index(struct elf_binary *elf, unsigned index);
const char *elf_section_name(struct elf_binary *elf, ELF_HANDLE_DECL(elf_shdr) shdr); /* might return NULL if inputs are invalid */
ELF_PTRVAL_CONST_VOID elf_section_start(struct elf_binary *elf, ELF_HANDLE_DECL(elf_shdr) shdr);
@@ -343,7 +346,7 @@ ELF_PTRVAL_CONST_VOID elf_segment_start(struct elf_binary *elf, ELF_HANDLE_DECL(
ELF_PTRVAL_CONST_VOID elf_segment_end(struct elf_binary *elf, ELF_HANDLE_DECL(elf_phdr) phdr);
ELF_HANDLE_DECL(elf_sym) elf_sym_by_name(struct elf_binary *elf, const char *symbol);
-ELF_HANDLE_DECL(elf_sym) elf_sym_by_index(struct elf_binary *elf, int index);
+ELF_HANDLE_DECL(elf_sym) elf_sym_by_index(struct elf_binary *elf, unsigned index);
const char *elf_note_name(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) note); /* may return NULL */
ELF_PTRVAL_CONST_VOID elf_note_desc(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) note);
@@ -360,7 +363,7 @@ bool elf_phdr_is_loadable(struct elf_binary *elf, ELF_HANDLE_DECL(elf_phdr) phdr
/* ------------------------------------------------------------------------ */
/* xc_libelf_loader.c */
-int elf_init(struct elf_binary *elf, const char *image, size_t size);
+elf_errorstatus elf_init(struct elf_binary *elf, const char *image, size_t size);
/*
* image and size must be correct. They will be recorded in
* *elf, and must remain valid while the elf is in use.
@@ -373,7 +376,7 @@ void elf_set_log(struct elf_binary *elf, elf_log_callback*,
#endif
void elf_parse_binary(struct elf_binary *elf);
-int elf_load_binary(struct elf_binary *elf);
+elf_errorstatus elf_load_binary(struct elf_binary *elf);
ELF_PTRVAL_VOID elf_get_ptr(struct elf_binary *elf, unsigned long addr);
uint64_t elf_lookup_addr(struct elf_binary *elf, const char *symbol);
@@ -386,7 +389,7 @@ const char *elf_check_broken(const struct elf_binary *elf); /* NULL means OK */
/* ------------------------------------------------------------------------ */
/* xc_libelf_relocate.c */
-int elf_reloc(struct elf_binary *elf);
+elf_errorstatus elf_reloc(struct elf_binary *elf);
/* ------------------------------------------------------------------------ */
/* xc_libelf_dominfo.c */
@@ -420,7 +423,7 @@ struct elf_dom_parms {
char guest_ver[16];
char xen_ver[16];
char loader[16];
- int pae;
+ int pae; /* some kind of enum apparently */
bool bsd_symtab;
uint64_t virt_base;
uint64_t virt_entry;
--
1.7.2.5

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-pvgrub/xen-pvgrub-4.2.1-r3.ebuild,v 1.1 2013/06/26 16:16:38 idella4 Exp $
# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-pvgrub/xen-pvgrub-4.2.1-r3.ebuild,v 1.2 2013/06/27 05:32:10 idella4 Exp $
EAPI=4
PYTHON_DEPEND="2:2.6"
@ -10,13 +10,16 @@ inherit flag-o-matic eutils multilib python toolchain-funcs
XEN_EXTFILES_URL="http://xenbits.xensource.com/xen-extfiles"
LIBPCI_URL=ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci
GRUB_URL=mirror://gnu-alpha/grub
XSAPATCHES="http://dev.gentoo.org/~idella4/"
SRC_URI="
http://bits.xensource.com/oss-xen/release/${PV}/xen-${PV}.tar.gz
$GRUB_URL/grub-0.97.tar.gz
$XEN_EXTFILES_URL/zlib-1.2.3.tar.gz
$LIBPCI_URL/pciutils-2.2.9.tar.bz2
$XEN_EXTFILES_URL/lwip-1.3.0.tar.gz
$XEN_EXTFILES_URL/newlib/newlib-1.16.0.tar.gz"
$XEN_EXTFILES_URL/newlib/newlib-1.16.0.tar.gz
$XSAPATCHES/patches/XSA-55patches.tar.gz
"
S="${WORKDIR}/xen-${PV}"
@ -85,28 +88,29 @@ src_prepare() {
#Sec patch
epatch "${FILESDIR}"/${PN/-pvgrub/}-4-CVE-2012-6075-XSA-41.patch \
"${FILESDIR}"/xen-4-CVE-2013-0215-XSA-38.patch \
"${FILESDIR}"/xen-4-CVE-2013-1919-XSA-46.patch \
"${FILESDIR}"/xen-4-CVE-2013-1922-XSA-48.patch \
"${FILESDIR}"/xen-4-CVE-2013-1952-XSA_49.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-1-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-2-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-3-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-4-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-5to7-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-8-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-9to10-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-11-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-12to13-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-14-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-15-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-16-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-17-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-18to19-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-20to23-XSA-55.patch
#Substitute for internal downloading. pciutils copied only due to the only .bz2
"${FILESDIR}"/xen-4-CVE-2013-0215-XSA-38.patch \
"${FILESDIR}"/xen-4-CVE-2013-1919-XSA-46.patch \
"${FILESDIR}"/xen-4-CVE-2013-1922-XSA-48.patch \
"${FILESDIR}"/xen-4-CVE-2013-1952-XSA_49.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-1-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-2-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-3-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-4-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-5to7-XSA-55.patch \
"${WORKDIR}"/files/xen-4.2-CVE-2013-8-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-9to10-XSA-55.patch \
"${WORKDIR}"/files/xen-4.2-CVE-2013-11-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-12to13-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-14-XSA-55.patch \
"${WORKDIR}"/files/xen-4.2-CVE-2013-15-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-16-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-17-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-18to19-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-20to23-XSA-55.patch
# Substitute for internal downloading. pciutils copied only due to the only .bz2
cp $DISTDIR/pciutils-2.2.9.tar.bz2 ./stubdom/ || die "pciutils not copied to stubdom"
retar-externals || die "re-tar procedure failed"
}

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-pvgrub/xen-pvgrub-4.2.2-r1.ebuild,v 1.1 2013/06/26 16:16:38 idella4 Exp $
# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-pvgrub/xen-pvgrub-4.2.2-r1.ebuild,v 1.2 2013/06/27 05:32:10 idella4 Exp $
EAPI=4
PYTHON_DEPEND="2:2.6"
@ -10,13 +10,16 @@ inherit flag-o-matic eutils multilib python toolchain-funcs
XEN_EXTFILES_URL="http://xenbits.xensource.com/xen-extfiles"
LIBPCI_URL=ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci
GRUB_URL=mirror://gnu-alpha/grub
XSAPATCHES="http://dev.gentoo.org/~idella4/"
SRC_URI="
http://bits.xensource.com/oss-xen/release/${PV}/xen-${PV}.tar.gz
$GRUB_URL/grub-0.97.tar.gz
$XEN_EXTFILES_URL/zlib-1.2.3.tar.gz
$LIBPCI_URL/pciutils-2.2.9.tar.bz2
$XEN_EXTFILES_URL/lwip-1.3.0.tar.gz
$XEN_EXTFILES_URL/newlib/newlib-1.16.0.tar.gz"
$XEN_EXTFILES_URL/newlib/newlib-1.16.0.tar.gz
$XSAPATCHES/patches/XSA-55patches.tar.gz
"
S="${WORKDIR}/xen-${PV}"
@ -92,12 +95,12 @@ src_prepare() {
"${FILESDIR}"/xen-4.2-CVE-2013-3-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-4-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-5to7-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-8-XSA-55.patch \
"${WORKDIR}"/files/xen-4.2-CVE-2013-8-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-9to10-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-11-XSA-55.patch \
"${WORKDIR}"/files/xen-4.2-CVE-2013-11-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-12to13-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-14-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-15-XSA-55.patch \
"${WORKDIR}"/files/xen-4.2-CVE-2013-15-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-16-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-17-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-18to19-XSA-55.patch \

@ -1,3 +1,4 @@
DIST XSA-55patches.tar.gz 23888 SHA256 e86749d02ca5594ebcfdaea820a6cf1fe11015c7fdcc5836260498fae317d75b SHA512 ed1f321a1351df99cfb05e1dfc62dda1268544b0c0ceb7a01438805046e027fb9d59194d179b7a8c302b091a7bf444811b0b9359c4d42f7e902510515c275b6b WHIRLPOOL 5a611e5260f0fc97471f386da3499f7714e015c5c2556bd7199466558d8e375784d32655bdbe9ed4cbf492fa3b41091677d9fe6d3714b029c9a2b1dda6102edb
DIST ipxe.tar.gz 2867999 SHA256 632ce8c193ccacc3012bd354bdb733a4be126f7c098e111930aa41dad537405c SHA512 c5cb1cdff40d2d71fd3e692a9d0efadf2aa17290daf5195391a1c81ddd9dfc913a8e44d5be2b12be85b2a5565ea31631c99c7053564f2fb2225c80ea0bb0e4a4 WHIRLPOOL 58b7459aaf7323968e2f4d1cdcb563a04a0ee40d7d0e8fc600495baf6914127fbbbcddfb66199cd9f462eb59565b3d1ae90a05b3c771b8f13c2d2dcb6070eebc
DIST seabios-0-20121121.tar.bz2 2199282 SHA256 f7f67181c6c0b4cea3a9db48e2569fdcbbc81b732a2f672079c42fb44153ee62 SHA512 4f886088ebaa911590b8cb19db5c5dbc8f1384d2d5a7c4bf04df083e177513b3123b1839dad744171670eded8b69ce092a774288aec1804d00aa32b1b6778599 WHIRLPOOL f2e62682d7213ee5eaecbc2590637ef36d9c86f746840c0ee758c0c153139f485032ea2cd098c87bb8a2b5f17f91375b8fb65599e3b71b45b1645df85a88887f
DIST xen-4.2.1.tar.gz 15593695 SHA256 fb8df5827ce3e2d2d3b078d9e5afde502beb5e7ab9442e51a94087061bd450c6 SHA512 fe27a965e2b34035bd025482eda9fc4d4e82523c929323fd30813367d5ffbe2fa1ed3d7d4479f2632e8b5625972448b7bd6a7768e8dc1dcd1b6747d281cc1a9e WHIRLPOOL 226bbed059541e804f1a44e721023ffbc04bae43000653b1d7d6a9bfec0d9efbf7a48b1b0a7ad3fcb8e34f8b91e1c620c2a8eddf97baad487e9db37d49a58f37

@ -1,788 +0,0 @@
From cc8761371aac432318530c2ddfe2c8234bc0621f Mon Sep 17 00:00:00 2001
From: Ian Jackson <ian.jackson@eu.citrix.com>
Date: Fri, 14 Jun 2013 16:43:17 +0100
Subject: [PATCH 11/23] libelf: check all pointer accesses
We change the ELF_PTRVAL and ELF_HANDLE types and associated macros:
* PTRVAL becomes a uintptr_t, for which we provide a typedef
elf_ptrval. This means no arithmetic done on it can overflow so
the compiler cannot do any malicious invalid pointer arithmetic
"optimisations". It also means that any places where we
dereference one of these pointers without using the appropriate
macros or functions become a compilation error.
So we can be sure that we won't miss any memory accesses.
All the PTRVAL variables were previously void* or char*, so
the actual address calculations are unchanged.
* ELF_HANDLE becomes a union, one half of which keeps the pointer
value and the other half of which is just there to record the
type.
The new type is not a pointer type so there can be no address
calculations on it whose meaning would change. Every assignment or
access has to go through one of our macros.
* The distinction between const and non-const pointers and char*s
and void*s in libelf goes away. This was not important (and
anyway libelf tended to cast away const in various places).
* The fields elf->image and elf->dest are renamed. That proves
that we haven't missed any unchecked uses of these actual
pointer values.
* The caller may fill in elf->caller_xdest_base and _size to
specify another range of memory which is safe for libelf to
access, besides the input and output images.
* When accesses fail due to being out of range, we mark the elf
"broken". This will be checked and used for diagnostics in
a following patch.
We do not check for write accesses to the input image. This is
because libelf actually does this in a number of places. So we
simply permit that.
* Each caller of libelf which used to set dest now sets
dest_base and dest_size.
* In xc_dom_load_elf_symtab we provide a new actual-pointer
value hdr_ptr which we get from mapping the guest's kernel
area and use (checking carefully) as the caller_xdest area.
* The STAR(h) macro in libelf-dominfo.c now uses elf_access_unsigned.
* elf-init uses the new elf_uval_3264 accessor to access the 32-bit
fields, rather than an unchecked field access (ie, unchecked
pointer access).
* elf_uval has been reworked to use elf_uval_3264. Both of these
macros are essentially new in this patch (although they are derived
from the old elf_uval) and need careful review.
* ELF_ADVANCE_DEST is now safe in the sense that you can use it to
chop parts off the front of the dest area but if you chop more than
is available, the dest area is simply set to be empty, preventing
future accesses.
* We introduce some #defines for memcpy, memset, memmove and strcpy:
- We provide elf_memcpy_safe and elf_memset_safe which take
PTRVALs and do checking on the supplied pointers.
- Users inside libelf must all be changed to either
elf_mem*_unchecked (which are just like mem*), or
elf_mem*_safe (which take PTRVALs) and are checked. Any
unchanged call sites become compilation errors.
* We do _not_ at this time fix elf_access_unsigned so that it doesn't
make unaligned accesses. We hope that unaligned accesses are OK on
every supported architecture. But it does check the supplied
pointer for validity.
This is part of the fix to a security issue, XSA-55.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
tools/libxc/xc_dom_elfloader.c | 49 ++++++++--
tools/libxc/xc_hvm_build_x86.c | 10 +-
xen/arch/x86/domain_build.c | 3 +-
xen/common/libelf/libelf-dominfo.c | 2 +-
xen/common/libelf/libelf-loader.c | 16 ++--
xen/common/libelf/libelf-private.h | 13 +++
xen/common/libelf/libelf-tools.c | 106 ++++++++++++++++++-
xen/include/xen/libelf.h | 198 +++++++++++++++++++++++++-----------
8 files changed, 312 insertions(+), 85 deletions(-)
diff --git a/tools/libxc/xc_dom_elfloader.c b/tools/libxc/xc_dom_elfloader.c
index cc0f206..b82a08c 100644
--- a/tools/libxc/xc_dom_elfloader.c
+++ b/tools/libxc/xc_dom_elfloader.c
@@ -130,20 +130,30 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
if ( load )
{
- size_t allow_size; /* will be used in a forthcoming XSA-55 patch */
+ char *hdr_ptr;
+ size_t allow_size;
+
if ( !dom->bsd_symtab_start )
return 0;
size = dom->kernel_seg.vend - dom->bsd_symtab_start;
- hdr = xc_dom_vaddr_to_ptr(dom, dom->bsd_symtab_start, &allow_size);
- *(int *)hdr = size - sizeof(int);
+ hdr_ptr = xc_dom_vaddr_to_ptr(dom, dom->bsd_symtab_start, &allow_size);
+ elf->caller_xdest_base = hdr_ptr;
+ elf->caller_xdest_size = allow_size;
+ hdr = ELF_REALPTR2PTRVAL(hdr_ptr);
+ elf_store_val(elf, int, hdr, size - sizeof(int));
}
else
{
+ char *hdr_ptr;
+
size = sizeof(int) + elf_size(elf, elf->ehdr) +
elf_shdr_count(elf) * elf_size(elf, shdr);
- hdr = xc_dom_malloc(dom, size);
- if ( hdr == NULL )
+ hdr_ptr = xc_dom_malloc(dom, size);
+ if ( hdr_ptr == NULL )
return 0;
+ elf->caller_xdest_base = hdr_ptr;
+ elf->caller_xdest_size = size;
+ hdr = ELF_REALPTR2PTRVAL(hdr_ptr);
dom->bsd_symtab_start = elf_round_up(elf, dom->kernel_seg.vend);
}
@@ -171,9 +181,32 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
ehdr->e_shoff = elf_size(elf, elf->ehdr);
ehdr->e_shstrndx = SHN_UNDEF;
}
- if ( elf_init(&syms, hdr + sizeof(int), size - sizeof(int)) )
+ if ( elf->caller_xdest_size < sizeof(int) )
+ {
+ DOMPRINTF("%s/%s: header size %"PRIx64" too small",
+ __FUNCTION__, load ? "load" : "parse",
+ (uint64_t)elf->caller_xdest_size);
+ return -1;
+ }
+ if ( elf_init(&syms, elf->caller_xdest_base + sizeof(int),
+ elf->caller_xdest_size - sizeof(int)) )
return -1;
+ /*
+ * The caller_xdest_{base,size} and dest_{base,size} need to
+ * remain valid so long as each struct elf_image does. The
+ * principle we adopt is that these values are set when the
+ * memory is allocated or mapped, and cleared when (and if)
+ * they are unmapped.
+ *
+ * Mappings of the guest are normally undone by xc_dom_unmap_all
+ * (directly or via xc_dom_release). We do not explicitly clear
+ * these because in fact that happens only at the end of
+ * xc_dom_boot_image, at which time all of these ELF loading
+ * functions have returned. No relevant struct elf_binary*
+ * escapes this file.
+ */
+
xc_elf_set_logfile(dom->xch, &syms, 1);
symtab = dom->bsd_symtab_start + sizeof(int);
@@ -312,8 +345,10 @@ static int xc_dom_load_elf_kernel(struct xc_dom_image *dom)
{
struct elf_binary *elf = dom->private_loader;
int rc;
+ xen_pfn_t pages;
- elf->dest = xc_dom_seg_to_ptr(dom, &dom->kernel_seg);
+ elf->dest_base = xc_dom_seg_to_ptr_pages(dom, &dom->kernel_seg, &pages);
+ elf->dest_size = pages * XC_DOM_PAGE_SIZE(dom);
rc = elf_load_binary(elf);
if ( rc < 0 )
{
diff --git a/tools/libxc/xc_hvm_build_x86.c b/tools/libxc/xc_hvm_build_x86.c
index 15b603d..ccfd8b5 100644
--- a/tools/libxc/xc_hvm_build_x86.c
+++ b/tools/libxc/xc_hvm_build_x86.c
@@ -104,11 +104,12 @@ static int loadelfimage(
for ( i = 0; i < pages; i++ )
entries[i].mfn = parray[(elf->pstart >> PAGE_SHIFT) + i];
- elf->dest = xc_map_foreign_ranges(
+ elf->dest_base = xc_map_foreign_ranges(
xch, dom, pages << PAGE_SHIFT, PROT_READ | PROT_WRITE, 1 << PAGE_SHIFT,
entries, pages);
- if ( elf->dest == NULL )
+ if ( elf->dest_base == NULL )
goto err;
+ elf->dest_size = pages * PAGE_SIZE;
ELF_ADVANCE_DEST(elf, elf->pstart & (PAGE_SIZE - 1));
@@ -117,8 +118,9 @@ static int loadelfimage(
if ( rc < 0 )
PERROR("Failed to load elf binary\n");
- munmap(elf->dest, pages << PAGE_SHIFT);
- elf->dest = NULL;
+ munmap(elf->dest_base, pages << PAGE_SHIFT);
+ elf->dest_base = NULL;
+ elf->dest_size = 0;
err:
free(entries);
diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index 469d363..a655b21 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -908,7 +908,8 @@ int __init construct_dom0(
write_ptbase(v);
/* Copy the OS image and free temporary buffer. */
- elf.dest = (void*)vkern_start;
+ elf.dest_base = (void*)vkern_start;
+ elf.dest_size = vkern_end - vkern_start;
rc = elf_load_binary(&elf);
if ( rc < 0 )
{
diff --git a/xen/common/libelf/libelf-dominfo.c b/xen/common/libelf/libelf-dominfo.c
index b217f8f..98c80dc 100644
--- a/xen/common/libelf/libelf-dominfo.c
+++ b/xen/common/libelf/libelf-dominfo.c
@@ -254,7 +254,7 @@ int elf_xen_parse_guest_info(struct elf_binary *elf,
int len;
h = parms->guest_info;
-#define STAR(h) (*(h))
+#define STAR(h) (elf_access_unsigned(elf, (h), 0, 1))
while ( STAR(h) )
{
elf_memset_unchecked(name, 0, sizeof(name));
diff --git a/xen/common/libelf/libelf-loader.c b/xen/common/libelf/libelf-loader.c
index 0fef84c..a3310e7 100644
--- a/xen/common/libelf/libelf-loader.c
+++ b/xen/common/libelf/libelf-loader.c
@@ -24,23 +24,25 @@
/* ------------------------------------------------------------------------ */
-int elf_init(struct elf_binary *elf, const char *image, size_t size)
+int elf_init(struct elf_binary *elf, const char *image_input, size_t size)
{
ELF_HANDLE_DECL(elf_shdr) shdr;
uint64_t i, count, section, offset;
- if ( !elf_is_elfbinary(image) )
+ if ( !elf_is_elfbinary(image_input) )
{
elf_err(elf, "%s: not an ELF binary\n", __FUNCTION__);
return -1;
}
elf_memset_unchecked(elf, 0, sizeof(*elf));
- elf->image = image;
+ elf->image_base = image_input;
elf->size = size;
- elf->ehdr = (elf_ehdr *)image;
- elf->class = elf->ehdr->e32.e_ident[EI_CLASS];
- elf->data = elf->ehdr->e32.e_ident[EI_DATA];
+ elf->ehdr = ELF_MAKE_HANDLE(elf_ehdr, (elf_ptrval)image_input);
+ elf->class = elf_uval_3264(elf, elf->ehdr, e32.e_ident[EI_CLASS]);
+ elf->data = elf_uval_3264(elf, elf->ehdr, e32.e_ident[EI_DATA]);
+ elf->caller_xdest_base = NULL;
+ elf->caller_xdest_size = 0;
/* Sanity check phdr. */
offset = elf_uval(elf, elf->ehdr, e_phoff) +
@@ -300,7 +302,7 @@ int elf_load_binary(struct elf_binary *elf)
ELF_PTRVAL_VOID elf_get_ptr(struct elf_binary *elf, unsigned long addr)
{
- return elf->dest + addr - elf->pstart;
+ return ELF_REALPTR2PTRVAL(elf->dest_base) + addr - elf->pstart;
}
uint64_t elf_lookup_addr(struct elf_binary * elf, const char *symbol)
diff --git a/xen/common/libelf/libelf-private.h b/xen/common/libelf/libelf-private.h
index 3ef753c..280dfd1 100644
--- a/xen/common/libelf/libelf-private.h
+++ b/xen/common/libelf/libelf-private.h
@@ -86,6 +86,19 @@ do { strncpy((d),(s),sizeof((d))-1); \
#endif
+#undef memcpy
+#undef memset
+#undef memmove
+#undef strcpy
+
+#define memcpy MISTAKE_unspecified_memcpy
+#define memset MISTAKE_unspecified_memset
+#define memmove MISTAKE_unspecified_memmove
+#define strcpy MISTAKE_unspecified_strcpy
+ /* This prevents libelf from using these undecorated versions
+ * of memcpy, memset, memmove and strcpy. Every call site
+ * must either use elf_mem*_unchecked, or elf_mem*_safe. */
+
#endif /* __LIBELF_PRIVATE_H_ */
/*
diff --git a/xen/common/libelf/libelf-tools.c b/xen/common/libelf/libelf-tools.c
index 3a0cde1..46ca553 100644
--- a/xen/common/libelf/libelf-tools.c
+++ b/xen/common/libelf/libelf-tools.c
@@ -20,28 +20,100 @@
/* ------------------------------------------------------------------------ */
-uint64_t elf_access_unsigned(struct elf_binary * elf, const void *ptr,
- uint64_t offset, size_t size)
+void elf_mark_broken(struct elf_binary *elf, const char *msg)
{
+ if ( elf->broken == NULL )
+ elf->broken = msg;
+}
+
+const char *elf_check_broken(const struct elf_binary *elf)
+{
+ return elf->broken;
+}
+
+static int elf_ptrval_in_range(elf_ptrval ptrval, uint64_t size,
+ const void *region, uint64_t regionsize)
+ /*
+ * Returns true if the putative memory area [ptrval,ptrval+size>
+ * is completely inside the region [region,region+regionsize>.
+ *
+ * ptrval and size are the untrusted inputs to be checked.
+ * region and regionsize are trusted and must be correct and valid,
+ * although it is OK for region to perhaps be maliciously NULL
+ * (but not some other malicious value).
+ */
+{
+ elf_ptrval regionp = (elf_ptrval)region;
+
+ if ( (region == NULL) ||
+ (ptrval < regionp) || /* start is before region */
+ (ptrval > regionp + regionsize) || /* start is after region */
+ (size > regionsize - (ptrval - regionp)) ) /* too big */
+ return 0;
+ return 1;
+}
+
+int elf_access_ok(struct elf_binary * elf,
+ uint64_t ptrval, size_t size)
+{
+ if ( elf_ptrval_in_range(ptrval, size, elf->image_base, elf->size) )
+ return 1;
+ if ( elf_ptrval_in_range(ptrval, size, elf->dest_base, elf->dest_size) )
+ return 1;
+ if ( elf_ptrval_in_range(ptrval, size,
+ elf->caller_xdest_base, elf->caller_xdest_size) )
+ return 1;
+ elf_mark_broken(elf, "out of range access");
+ return 0;
+}
+
+void elf_memcpy_safe(struct elf_binary *elf, elf_ptrval dst,
+ elf_ptrval src, size_t size)
+{
+ if ( elf_access_ok(elf, dst, size) &&
+ elf_access_ok(elf, src, size) )
+ {
+ /* use memmove because these checks do not prove that the
+ * regions don't overlap and overlapping regions grant
+ * permission for compiler malice */
+ elf_memmove_unchecked(ELF_UNSAFE_PTR(dst), ELF_UNSAFE_PTR(src), size);
+ }
+}
+
+void elf_memset_safe(struct elf_binary *elf, elf_ptrval dst, int c, size_t size)
+{
+ if ( elf_access_ok(elf, dst, size) )
+ {
+ elf_memset_unchecked(ELF_UNSAFE_PTR(dst), c, size);
+ }
+}
+
+uint64_t elf_access_unsigned(struct elf_binary * elf, elf_ptrval base,
+ uint64_t moreoffset, size_t size)
+{
+ elf_ptrval ptrval = base + moreoffset;
int need_swap = elf_swap(elf);
const uint8_t *u8;
const uint16_t *u16;
const uint32_t *u32;
const uint64_t *u64;
+ if ( !elf_access_ok(elf, ptrval, size) )
+ return 0;
+
switch ( size )
{
case 1:
- u8 = ptr + offset;
+ u8 = (const void*)ptrval;
return *u8;
case 2:
- u16 = ptr + offset;
+ u16 = (const void*)ptrval;
return need_swap ? bswap_16(*u16) : *u16;
case 4:
- u32 = ptr + offset;
+ u32 = (const void*)ptrval;
return need_swap ? bswap_32(*u32) : *u32;
case 8:
- u64 = ptr + offset;
+ u64 = (const void*)ptrval;
return need_swap ? bswap_64(*u64) : *u64;
default:
return 0;
@@ -122,6 +194,28 @@ const char *elf_section_name(struct elf_binary *elf,
return elf_strval(elf, elf->sec_strtab + elf_uval(elf, shdr, sh_name));
}
+const char *elf_strval(struct elf_binary *elf, elf_ptrval start)
+{
+ uint64_t length;
+
+ for ( length = 0; ; length++ ) {
+ if ( !elf_access_ok(elf, start + length, 1) )
+ return NULL;
+ if ( !elf_access_unsigned(elf, start, length, 1) )
+ /* ok */
+ return ELF_UNSAFE_PTR(start);
+ }
+}
+
+const char *elf_strfmt(struct elf_binary *elf, elf_ptrval start)
+{
+ const char *str = elf_strval(elf, start);
+
+ if ( str == NULL )
+ return "(invalid)";
+ return str;
+}
+
ELF_PTRVAL_CONST_VOID elf_section_start(struct elf_binary *elf, ELF_HANDLE_DECL(elf_shdr) shdr)
{
return ELF_IMAGE_BASE(elf) + elf_uval(elf, shdr, sh_offset);
diff --git a/xen/include/xen/libelf.h b/xen/include/xen/libelf.h
index af5b5c5..ddc3ed7 100644
--- a/xen/include/xen/libelf.h
+++ b/xen/include/xen/libelf.h
@@ -57,8 +57,9 @@ typedef void elf_log_callback(struct elf_binary*, void *caller_data,
* on this.
* This replaces variables which were char*,void*
* and their const versions, so we provide four
- * different declaration macros:
+ * different obsolete declaration macros:
* ELF_PTRVAL_{,CONST}{VOID,CHAR}
+ * New code can simply use the elf_ptrval typedef.
* HANDLE A pointer to a struct. There is one of these types
* for each pointer type - that is, for each "structname".
* In the arguments to the various HANDLE macros, structname
@@ -67,54 +68,66 @@ typedef void elf_log_callback(struct elf_binary*, void *caller_data,
* pointers. In the current code attempts to do so will
* compile, but in the next patch this will become a
* compile error.
- * We provide two declaration macros for const and
- * non-const pointers.
+ * We also provide a second declaration macro for
+ * pointers which were to const; this is obsolete.
*/
-#define ELF_REALPTR2PTRVAL(realpointer) (realpointer)
+typedef uintptr_t elf_ptrval;
+
+#define ELF_REALPTR2PTRVAL(realpointer) ((elf_ptrval)(realpointer))
/* Converts an actual C pointer into a PTRVAL */
-#define ELF_HANDLE_DECL_NONCONST(structname) structname *
-#define ELF_HANDLE_DECL(structname) const structname *
+#define ELF_HANDLE_DECL_NONCONST(structname) structname##_handle /*obsolete*/
+#define ELF_HANDLE_DECL(structname) structname##_handle
/* Provides a type declaration for a HANDLE. */
- /* May only be used to declare ONE variable at a time */
-#define ELF_PTRVAL_VOID void *
-#define ELF_PTRVAL_CHAR char *
-#define ELF_PTRVAL_CONST_VOID const void *
-#define ELF_PTRVAL_CONST_CHAR const char *
- /* Provides a type declaration for a PTRVAL. */
- /* May only be used to declare ONE variable at a time */
+#define ELF_PTRVAL_VOID elf_ptrval /*obsolete*/
+#define ELF_PTRVAL_CHAR elf_ptrval /*obsolete*/
+#define ELF_PTRVAL_CONST_VOID elf_ptrval /*obsolete*/
+#define ELF_PTRVAL_CONST_CHAR elf_ptrval /*obsolete*/
+
+#ifdef __XEN__
+# define ELF_PRPTRVAL "lu"
+ /*
+ * PRIuPTR is misdefined in xen/include/xen/inttypes.h, on 32-bit,
+ * to "u", when in fact uintptr_t is an unsigned long.
+ */
+#else
+# define ELF_PRPTRVAL PRIuPTR
+#endif
+ /* printf format a la PRId... for a PTRVAL */
-#define ELF_DEFINE_HANDLE(structname) /* empty */
+#define ELF_DEFINE_HANDLE(structname) \
+ typedef union { \
+ elf_ptrval ptrval; \
+ const structname *typeonly; /* for sizeof, offsetof, &c only */ \
+ } structname##_handle;
/*
* This must be invoked for each HANDLE type to define
* the actual C type used for that kind of HANDLE.
*/
-#define ELF_PRPTRVAL "p"
- /* printf format a la PRId... for a PTRVAL */
-
-#define ELF_MAKE_HANDLE(structname, ptrval) (ptrval)
+#define ELF_MAKE_HANDLE(structname, ptrval) ((structname##_handle){ ptrval })
/* Converts a PTRVAL to a HANDLE */
-#define ELF_IMAGE_BASE(elf) ((elf)->image)
+#define ELF_IMAGE_BASE(elf) ((elf_ptrval)(elf)->image_base)
/* Returns the base of the image as a PTRVAL. */
-#define ELF_HANDLE_PTRVAL(handleval) ((void*)(handleval))
+#define ELF_HANDLE_PTRVAL(handleval) ((handleval).ptrval)
/* Converts a HANDLE to a PTRVAL. */
-#define ELF_OBSOLETE_VOIDP_CAST (void*)(uintptr_t)
+#define ELF_OBSOLETE_VOIDP_CAST /*empty*/
/*
- * In some places the existing code needs to
+ * In some places the old code used to need to
* - cast away const (the existing code uses const a fair
* bit but actually sometimes wants to write to its input)
* from a PTRVAL.
* - convert an integer representing a pointer to a PTRVAL
- * This macro provides a suitable cast.
+ * Nowadays all of these re uintptr_ts so there is no const problem
+ * and no need for any casting.
*/
-#define ELF_UNSAFE_PTR(ptrval) ((void*)(uintptr_t)(ptrval))
+#define ELF_UNSAFE_PTR(ptrval) ((void*)(elf_ptrval)(ptrval))
/*
* Turns a PTRVAL into an actual C pointer. Before this is done
* the caller must have ensured that the PTRVAL does in fact point
@@ -122,18 +135,21 @@ typedef void elf_log_callback(struct elf_binary*, void *caller_data,
*/
/* PTRVALs can be INVALID (ie, NULL). */
-#define ELF_INVALID_PTRVAL (NULL) /* returns NULL PTRVAL */
+#define ELF_INVALID_PTRVAL ((elf_ptrval)0) /* returns NULL PTRVAL */
#define ELF_INVALID_HANDLE(structname) /* returns NULL handle */ \
ELF_MAKE_HANDLE(structname, ELF_INVALID_PTRVAL)
-#define ELF_PTRVAL_VALID(ptrval) (ptrval) /* } */
-#define ELF_HANDLE_VALID(handleval) (handleval) /* } predicates */
-#define ELF_PTRVAL_INVALID(ptrval) ((ptrval) == NULL) /* } */
+#define ELF_PTRVAL_VALID(ptrval) (!!(ptrval)) /* } */
+#define ELF_HANDLE_VALID(handleval) (!!(handleval).ptrval) /* } predicates */
+#define ELF_PTRVAL_INVALID(ptrval) (!ELF_PTRVAL_VALID((ptrval))) /* } */
+
+#define ELF_MAX_PTRVAL (~(elf_ptrval)0)
+ /* PTRVAL value guaranteed to compare > to any valid PTRVAL */
/* For internal use by other macros here */
#define ELF__HANDLE_FIELD_TYPE(handleval, elm) \
- typeof((handleval)->elm)
+ typeof((handleval).typeonly->elm)
#define ELF__HANDLE_FIELD_OFFSET(handleval, elm) \
- offsetof(typeof(*(handleval)),elm)
+ offsetof(typeof(*(handleval).typeonly),elm)
/* ------------------------------------------------------------------------ */
@@ -182,7 +198,7 @@ ELF_DEFINE_HANDLE(elf_note)
struct elf_binary {
/* elf binary */
- const char *image;
+ const void *image_base;
size_t size;
char class;
char data;
@@ -190,10 +206,16 @@ struct elf_binary {
ELF_HANDLE_DECL(elf_ehdr) ehdr;
ELF_PTRVAL_CONST_CHAR sec_strtab;
ELF_HANDLE_DECL(elf_shdr) sym_tab;
- ELF_PTRVAL_CONST_CHAR sym_strtab;
+ uint64_t sym_strtab;
/* loaded to */
- char *dest;
+ /*
+ * dest_base and dest_size are trusted and must be correct;
+ * whenever dest_size is not 0, both of these must be valid
+ * so long as the struct elf_binary is in use.
+ */
+ char *dest_base;
+ size_t dest_size;
uint64_t pstart;
uint64_t pend;
uint64_t reloc_offset;
@@ -201,12 +223,22 @@ struct elf_binary {
uint64_t bsd_symtab_pstart;
uint64_t bsd_symtab_pend;
+ /*
+ * caller's other acceptable destination
+ *
+ * Again, these are trusted and must be valid (or 0) so long
+ * as the struct elf_binary is in use.
+ */
+ void *caller_xdest_base;
+ uint64_t caller_xdest_size;
+
#ifndef __XEN__
/* misc */
elf_log_callback *log_callback;
void *log_caller_data;
#endif
int verbose;
+ const char *broken;
};
/* ------------------------------------------------------------------------ */
@@ -224,22 +256,27 @@ struct elf_binary {
#define elf_lsb(elf) (ELFDATA2LSB == (elf)->data)
#define elf_swap(elf) (NATIVE_ELFDATA != (elf)->data)
-#define elf_uval(elf, str, elem) \
- ((ELFCLASS64 == (elf)->class) \
- ? elf_access_unsigned((elf), (str), \
- offsetof(typeof(*(str)),e64.elem), \
- sizeof((str)->e64.elem)) \
- : elf_access_unsigned((elf), (str), \
- offsetof(typeof(*(str)),e32.elem), \
- sizeof((str)->e32.elem)))
+#define elf_uval_3264(elf, handle, elem) \
+ elf_access_unsigned((elf), (handle).ptrval, \
+ offsetof(typeof(*(handle).typeonly),elem), \
+ sizeof((handle).typeonly->elem))
+
+#define elf_uval(elf, handle, elem) \
+ ((ELFCLASS64 == (elf)->class) \
+ ? elf_uval_3264(elf, handle, e64.elem) \
+ : elf_uval_3264(elf, handle, e32.elem))
/*
* Reads an unsigned field in a header structure in the ELF.
* str is a HANDLE, and elem is the field name in it.
*/
-#define elf_size(elf, str) \
+
+#define elf_size(elf, handle_or_handletype) ({ \
+ typeof(handle_or_handletype) elf_size__dummy; \
((ELFCLASS64 == (elf)->class) \
- ? sizeof((str)->e64) : sizeof((str)->e32))
+ ? sizeof(elf_size__dummy.typeonly->e64) \
+ : sizeof(elf_size__dummy.typeonly->e32)); \
+})
/*
* Returns the size of the substructure for the appropriate 32/64-bitness.
* str should be a HANDLE.
@@ -251,23 +288,37 @@ uint64_t elf_access_unsigned(struct elf_binary *elf, ELF_PTRVAL_CONST_VOID ptr,
uint64_t elf_round_up(struct elf_binary *elf, uint64_t addr);
+const char *elf_strval(struct elf_binary *elf, elf_ptrval start);
+ /* may return NULL if the string is out of range etc. */
-#define elf_strval(elf,x) ((const char*)(x)) /* may return NULL in the future */
-#define elf_strfmt(elf,x) ((const char*)(x)) /* will return (invalid) instead */
+const char *elf_strfmt(struct elf_binary *elf, elf_ptrval start);
+ /* like elf_strval but returns "(invalid)" instead of NULL */
-#define elf_memcpy_safe(elf, dst, src, sz) memcpy((dst),(src),(sz))
-#define elf_memset_safe(elf, dst, c, sz) memset((dst),(c),(sz))
+void elf_memcpy_safe(struct elf_binary*, elf_ptrval dst, elf_ptrval src, size_t);
+void elf_memset_safe(struct elf_binary*, elf_ptrval dst, int c, size_t);
/*
- * Versions of memcpy and memset which will (in the next patch)
- * arrange never to write outside permitted areas.
+ * Versions of memcpy and memset which arrange never to write
+ * outside permitted areas.
*/
-#define elf_store_val(elf, type, ptr, val) (*(type*)(ptr) = (val))
+int elf_access_ok(struct elf_binary * elf,
+ uint64_t ptrval, size_t size);
+
+#define elf_store_val(elf, type, ptr, val) \
+ ({ \
+ typeof(type) elf_store__val = (val); \
+ elf_ptrval elf_store__targ = ptr; \
+ if (elf_access_ok((elf), elf_store__targ, \
+ sizeof(elf_store__val))) { \
+ elf_memcpy_unchecked((void*)elf_store__targ, &elf_store__val, \
+ sizeof(elf_store__val)); \
+ } \
+ }) \
/* Stores a value at a particular PTRVAL. */
-#define elf_store_field(elf, hdr, elm, val) \
- (elf_store_val((elf), ELF__HANDLE_FIELD_TYPE(hdr, elm), \
- &((hdr)->elm), \
+#define elf_store_field(elf, hdr, elm, val) \
+ (elf_store_val((elf), ELF__HANDLE_FIELD_TYPE(hdr, elm), \
+ ELF_HANDLE_PTRVAL(hdr) + ELF__HANDLE_FIELD_OFFSET(hdr, elm), \
(val)))
/* Stores a 32/64-bit field. hdr is a HANDLE and elm is the field name. */
@@ -306,6 +357,10 @@ int elf_phdr_is_loadable(struct elf_binary *elf, ELF_HANDLE_DECL(elf_phdr) phdr)
/* xc_libelf_loader.c */
int elf_init(struct elf_binary *elf, const char *image, size_t size);
+ /*
+ * image and size must be correct. They will be recorded in
+ * *elf, and must remain valid while the elf is in use.
+ */
#ifdef __XEN__
void elf_set_verbose(struct elf_binary *elf);
#else
@@ -321,6 +376,9 @@ uint64_t elf_lookup_addr(struct elf_binary *elf, const char *symbol);
void elf_parse_bsdsyms(struct elf_binary *elf, uint64_t pstart); /* private */
+void elf_mark_broken(struct elf_binary *elf, const char *msg);
+const char *elf_check_broken(const struct elf_binary *elf); /* NULL means OK */
+
/* ------------------------------------------------------------------------ */
/* xc_libelf_relocate.c */
@@ -395,16 +453,38 @@ int elf_xen_parse_guest_info(struct elf_binary *elf,
int elf_xen_parse(struct elf_binary *elf,
struct elf_dom_parms *parms);
-#define elf_memcpy_unchecked memcpy
-#define elf_memset_unchecked memset
+static inline void *elf_memcpy_unchecked(void *dest, const void *src, size_t n)
+ { return memcpy(dest, src, n); }
+static inline void *elf_memmove_unchecked(void *dest, const void *src, size_t n)
+ { return memmove(dest, src, n); }
+static inline void *elf_memset_unchecked(void *s, int c, size_t n)
+ { return memset(s, c, n); }
/*
- * Unsafe versions of memcpy and memset which take actual C
- * pointers. These are just like real memcpy and memset.
+ * Unsafe versions of memcpy, memmove memset which take actual C
+ * pointers. These are just like the real functions.
+ * We provide these so that in libelf-private.h we can #define
+ * memcpy, memset and memmove to undefined MISTAKE things.
*/
-#define ELF_ADVANCE_DEST(elf, amount) elf->dest += (amount)
- /* Advances past amount bytes of the current destination area. */
+/* Advances past amount bytes of the current destination area. */
+static inline void ELF_ADVANCE_DEST(struct elf_binary *elf, uint64_t amount)
+{
+ if ( elf->dest_base == NULL )
+ {
+ elf_mark_broken(elf, "advancing in null image");
+ }
+ else if ( elf->dest_size >= amount )
+ {
+ elf->dest_base += amount;
+ elf->dest_size -= amount;
+ }
+ else
+ {
+ elf->dest_size = 0;
+ elf_mark_broken(elf, "advancing past end (image very short?)");
+ }
+}
#endif /* __XEN_LIBELF_H__ */
--
1.7.2.5

@ -1,759 +0,0 @@
From e673ca50127b6c1263727aa31de0b8bb966ca7a2 Mon Sep 17 00:00:00 2001
From: Ian Jackson <ian.jackson@eu.citrix.com>
Date: Fri, 14 Jun 2013 16:43:18 +0100
Subject: [PATCH 15/23] libelf: use only unsigned integers
Signed integers have undesirable undefined behaviours on overflow.
Malicious compilers can turn apparently-correct code into code with
security vulnerabilities etc.
So use only unsigned integers. Exceptions are booleans (which we have
already changed) and error codes.
We _do_ change all the chars which aren't fixed constants from our own
text segment, but not the char*s. This is because it is safe to
access an arbitrary byte through a char*, but not necessarily safe to
convert an arbitrary value to a char.
As a consequence we need to compile libelf with -Wno-pointer-sign.
It is OK to change all the signed integers to unsigned because all the
inequalities in libelf are in contexts where we don't "expect"
negative numbers.
In libelf-dominfo.c:elf_xen_parse we rename a variable "rc" to
"more_notes" as it actually contains a note count derived from the
input image. The "error" return value from elf_xen_parse_notes is
changed from -1 to ~0U.
grepping shows only one occurrence of "PRId" or "%d" or "%ld" in
libelf and xc_dom_elfloader.c (a "%d" which becomes "%u").
This is part of the fix to a security issue, XSA-55.
For those concerned about unintentional functional changes, the
following rune produces a version of the patch which is much smaller
and eliminates only non-functional changes:
GIT_EXTERNAL_DIFF=.../unsigned-differ git-diff <before>..<after>
where <before> and <after> are git refs for the code before and after
this patch, and unsigned-differ is this shell script:
#!/bin/bash
set -e
seddery () {
perl -pe 's/\b(?:elf_errorstatus|elf_negerrnoval)\b/int/g'
}
path="$1"
in="$2"
out="$5"
set +e
diff -pu --label "$path~" <(seddery <"$in") --label "$path" <(seddery <"$out")
rc=$?
set -e
if [ $rc = 1 ]; then rc=0; fi
exit $rc
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
tools/libxc/Makefile | 9 +++++-
tools/libxc/xc_dom.h | 7 +++--
tools/libxc/xc_dom_elfloader.c | 42 ++++++++++++++++-------------
tools/xcutils/readnotes.c | 15 +++++-----
xen/common/libelf/Makefile | 2 +
xen/common/libelf/libelf-dominfo.c | 52 ++++++++++++++++++-----------------
xen/common/libelf/libelf-loader.c | 20 +++++++-------
xen/common/libelf/libelf-tools.c | 24 ++++++++--------
xen/include/xen/libelf.h | 21 ++++++++------
9 files changed, 105 insertions(+), 87 deletions(-)
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index d8c6a60..a3fd90c 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -52,8 +52,13 @@ endif
vpath %.c ../../xen/common/libelf
CFLAGS += -I../../xen/common/libelf
-GUEST_SRCS-y += libelf-tools.c libelf-loader.c
-GUEST_SRCS-y += libelf-dominfo.c
+ELF_SRCS-y += libelf-tools.c libelf-loader.c
+ELF_SRCS-y += libelf-dominfo.c
+
+GUEST_SRCS-y += $(ELF_SRCS-y)
+
+$(patsubst %.c,%.o,$(ELF_SRCS-y)): CFLAGS += -Wno-pointer-sign
+$(patsubst %.c,%.opic,$(ELF_SRCS-y)): CFLAGS += -Wno-pointer-sign
# new domain builder
GUEST_SRCS-y += xc_dom_core.c xc_dom_boot.c
diff --git a/tools/libxc/xc_dom.h b/tools/libxc/xc_dom.h
index 9f8037e..0161459 100644
--- a/tools/libxc/xc_dom.h
+++ b/tools/libxc/xc_dom.h
@@ -140,9 +140,10 @@ struct xc_dom_image {
struct xc_dom_loader {
char *name;
- int (*probe) (struct xc_dom_image * dom);
- int (*parser) (struct xc_dom_image * dom);
- int (*loader) (struct xc_dom_image * dom);
+ /* Sadly the error returns from these functions are not consistent: */
+ elf_negerrnoval (*probe) (struct xc_dom_image * dom);
+ elf_negerrnoval (*parser) (struct xc_dom_image * dom);
+ elf_errorstatus (*loader) (struct xc_dom_image * dom);
struct xc_dom_loader *next;
};
diff --git a/tools/libxc/xc_dom_elfloader.c b/tools/libxc/xc_dom_elfloader.c
index 9ba64ae..62a0d3b 100644
--- a/tools/libxc/xc_dom_elfloader.c
+++ b/tools/libxc/xc_dom_elfloader.c
@@ -84,7 +84,7 @@ static char *xc_dom_guest_type(struct xc_dom_image *dom,
/* ------------------------------------------------------------------------ */
/* parse elf binary */
-static int check_elf_kernel(struct xc_dom_image *dom, bool verbose)
+static elf_negerrnoval check_elf_kernel(struct xc_dom_image *dom, bool verbose)
{
if ( dom->kernel_blob == NULL )
{
@@ -106,12 +106,12 @@ static int check_elf_kernel(struct xc_dom_image *dom, bool verbose)
return 0;
}
-static int xc_dom_probe_elf_kernel(struct xc_dom_image *dom)
+static elf_negerrnoval xc_dom_probe_elf_kernel(struct xc_dom_image *dom)
{
return check_elf_kernel(dom, 0);
}
-static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
+static elf_errorstatus xc_dom_load_elf_symtab(struct xc_dom_image *dom,
struct elf_binary *elf, bool load)
{
struct elf_binary syms;
@@ -119,7 +119,7 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
xen_vaddr_t symtab, maxaddr;
ELF_PTRVAL_CHAR hdr;
size_t size;
- int h, count, type, i, tables = 0;
+ unsigned h, count, type, i, tables = 0;
if ( elf_swap(elf) )
{
@@ -140,13 +140,13 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
elf->caller_xdest_base = hdr_ptr;
elf->caller_xdest_size = allow_size;
hdr = ELF_REALPTR2PTRVAL(hdr_ptr);
- elf_store_val(elf, int, hdr, size - sizeof(int));
+ elf_store_val(elf, unsigned, hdr, size - sizeof(unsigned));
}
else
{
char *hdr_ptr;
- size = sizeof(int) + elf_size(elf, elf->ehdr) +
+ size = sizeof(unsigned) + elf_size(elf, elf->ehdr) +
elf_shdr_count(elf) * elf_size(elf, shdr);
hdr_ptr = xc_dom_malloc(dom, size);
if ( hdr_ptr == NULL )
@@ -157,15 +157,15 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
dom->bsd_symtab_start = elf_round_up(elf, dom->kernel_seg.vend);
}
- elf_memcpy_safe(elf, hdr + sizeof(int),
+ elf_memcpy_safe(elf, hdr + sizeof(unsigned),
ELF_IMAGE_BASE(elf),
elf_size(elf, elf->ehdr));
- elf_memcpy_safe(elf, hdr + sizeof(int) + elf_size(elf, elf->ehdr),
+ elf_memcpy_safe(elf, hdr + sizeof(unsigned) + elf_size(elf, elf->ehdr),
ELF_IMAGE_BASE(elf) + elf_uval(elf, elf->ehdr, e_shoff),
elf_shdr_count(elf) * elf_size(elf, shdr));
if ( elf_64bit(elf) )
{
- Elf64_Ehdr *ehdr = (Elf64_Ehdr *)(hdr + sizeof(int));
+ Elf64_Ehdr *ehdr = (Elf64_Ehdr *)(hdr + sizeof(unsigned));
ehdr->e_phoff = 0;
ehdr->e_phentsize = 0;
ehdr->e_phnum = 0;
@@ -174,22 +174,22 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
}
else
{
- Elf32_Ehdr *ehdr = (Elf32_Ehdr *)(hdr + sizeof(int));
+ Elf32_Ehdr *ehdr = (Elf32_Ehdr *)(hdr + sizeof(unsigned));
ehdr->e_phoff = 0;
ehdr->e_phentsize = 0;
ehdr->e_phnum = 0;
ehdr->e_shoff = elf_size(elf, elf->ehdr);
ehdr->e_shstrndx = SHN_UNDEF;
}
- if ( elf->caller_xdest_size < sizeof(int) )
+ if ( elf->caller_xdest_size < sizeof(unsigned) )
{
DOMPRINTF("%s/%s: header size %"PRIx64" too small",
__FUNCTION__, load ? "load" : "parse",
(uint64_t)elf->caller_xdest_size);
return -1;
}
- if ( elf_init(&syms, elf->caller_xdest_base + sizeof(int),
- elf->caller_xdest_size - sizeof(int)) )
+ if ( elf_init(&syms, elf->caller_xdest_base + sizeof(unsigned),
+ elf->caller_xdest_size - sizeof(unsigned)) )
return -1;
/*
@@ -209,7 +209,7 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
xc_elf_set_logfile(dom->xch, &syms, 1);
- symtab = dom->bsd_symtab_start + sizeof(int);
+ symtab = dom->bsd_symtab_start + sizeof(unsigned);
maxaddr = elf_round_up(&syms, symtab + elf_size(&syms, syms.ehdr) +
elf_shdr_count(&syms) * elf_size(&syms, shdr));
@@ -255,7 +255,7 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
size = elf_uval(&syms, shdr, sh_size);
maxaddr = elf_round_up(&syms, maxaddr + size);
tables++;
- DOMPRINTF("%s: h=%d %s, size=0x%zx, maxaddr=0x%" PRIx64 "",
+ DOMPRINTF("%s: h=%u %s, size=0x%zx, maxaddr=0x%" PRIx64 "",
__FUNCTION__, h,
type == SHT_SYMTAB ? "symtab" : "strtab",
size, maxaddr);
@@ -294,10 +294,14 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
return 0;
}
-static int xc_dom_parse_elf_kernel(struct xc_dom_image *dom)
+static elf_errorstatus xc_dom_parse_elf_kernel(struct xc_dom_image *dom)
+ /*
+ * This function sometimes returns -1 for error and sometimes
+ * an errno value. ?!?!
+ */
{
struct elf_binary *elf;
- int rc;
+ elf_errorstatus rc;
rc = check_elf_kernel(dom, 1);
if ( rc != 0 )
@@ -358,10 +362,10 @@ out:
return rc;
}
-static int xc_dom_load_elf_kernel(struct xc_dom_image *dom)
+static elf_errorstatus xc_dom_load_elf_kernel(struct xc_dom_image *dom)
{
struct elf_binary *elf = dom->private_loader;
- int rc;
+ elf_errorstatus rc;
xen_pfn_t pages;
elf->dest_base = xc_dom_seg_to_ptr_pages(dom, &dom->kernel_seg, &pages);
diff --git a/tools/xcutils/readnotes.c b/tools/xcutils/readnotes.c
index d1f7a30..2ca7732 100644
--- a/tools/xcutils/readnotes.c
+++ b/tools/xcutils/readnotes.c
@@ -70,7 +70,7 @@ static void print_numeric_note(const char *prefix, struct elf_binary *elf,
ELF_HANDLE_DECL(elf_note) note)
{
uint64_t value = elf_note_numeric(elf, note);
- int descsz = elf_uval(elf, note, descsz);
+ unsigned descsz = elf_uval(elf, note, descsz);
printf("%s: %#*" PRIx64 " (%d bytes)\n",
prefix, 2+2*descsz, value, descsz);
@@ -79,7 +79,7 @@ static void print_numeric_note(const char *prefix, struct elf_binary *elf,
static void print_l1_mfn_valid_note(const char *prefix, struct elf_binary *elf,
ELF_HANDLE_DECL(elf_note) note)
{
- int descsz = elf_uval(elf, note, descsz);
+ unsigned descsz = elf_uval(elf, note, descsz);
ELF_PTRVAL_CONST_VOID desc = elf_note_desc(elf, note);
/* XXX should be able to cope with a list of values. */
@@ -99,10 +99,10 @@ static void print_l1_mfn_valid_note(const char *prefix, struct elf_binary *elf,
}
-static int print_notes(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) start, ELF_HANDLE_DECL(elf_note) end)
+static unsigned print_notes(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) start, ELF_HANDLE_DECL(elf_note) end)
{
ELF_HANDLE_DECL(elf_note) note;
- int notes_found = 0;
+ unsigned notes_found = 0;
const char *this_note_name;
for ( note = start; ELF_HANDLE_PTRVAL(note) < ELF_HANDLE_PTRVAL(end); note = elf_note_next(elf, note) )
@@ -161,7 +161,7 @@ static int print_notes(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) start,
break;
default:
printf("unknown note type %#x\n",
- (int)elf_uval(elf, note, type));
+ (unsigned)elf_uval(elf, note, type));
break;
}
}
@@ -171,12 +171,13 @@ static int print_notes(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) start,
int main(int argc, char **argv)
{
const char *f;
- int fd,h,size,usize,count;
+ int fd;
+ unsigned h,size,usize,count;
void *image,*tmp;
struct stat st;
struct elf_binary elf;
ELF_HANDLE_DECL(elf_shdr) shdr;
- int notes_found = 0;
+ unsigned notes_found = 0;
struct setup_header *hdr;
uint64_t payload_offset, payload_length;
diff --git a/xen/common/libelf/Makefile b/xen/common/libelf/Makefile
index 18dc8e2..5bf8f76 100644
--- a/xen/common/libelf/Makefile
+++ b/xen/common/libelf/Makefile
@@ -2,6 +2,8 @@ obj-bin-y := libelf.o
SECTIONS := text data $(SPECIAL_DATA_SECTIONS)
+CFLAGS += -Wno-pointer-sign
+
libelf.o: libelf-temp.o Makefile
$(OBJCOPY) $(foreach s,$(SECTIONS),--rename-section .$(s)=.init.$(s)) $< $@
diff --git a/xen/common/libelf/libelf-dominfo.c b/xen/common/libelf/libelf-dominfo.c
index 12b6c2a..cdd0d31 100644
--- a/xen/common/libelf/libelf-dominfo.c
+++ b/xen/common/libelf/libelf-dominfo.c
@@ -29,15 +29,15 @@ static const char *const elf_xen_feature_names[] = {
[XENFEAT_pae_pgdir_above_4gb] = "pae_pgdir_above_4gb",
[XENFEAT_dom0] = "dom0"
};
-static const int elf_xen_features =
+static const unsigned elf_xen_features =
sizeof(elf_xen_feature_names) / sizeof(elf_xen_feature_names[0]);
-int elf_xen_parse_features(const char *features,
+elf_errorstatus elf_xen_parse_features(const char *features,
uint32_t *supported,
uint32_t *required)
{
- char feature[64];
- int pos, len, i;
+ unsigned char feature[64];
+ unsigned pos, len, i;
if ( features == NULL )
return 0;
@@ -94,7 +94,7 @@ int elf_xen_parse_features(const char *features,
/* ------------------------------------------------------------------------ */
/* xen elf notes */
-int elf_xen_parse_note(struct elf_binary *elf,
+elf_errorstatus elf_xen_parse_note(struct elf_binary *elf,
struct elf_dom_parms *parms,
ELF_HANDLE_DECL(elf_note) note)
{
@@ -125,7 +125,7 @@ int elf_xen_parse_note(struct elf_binary *elf,
const char *str = NULL;
uint64_t val = 0;
unsigned int i;
- int type = elf_uval(elf, note, type);
+ unsigned type = elf_uval(elf, note, type);
if ( (type >= sizeof(note_desc) / sizeof(note_desc[0])) ||
(note_desc[type].name == NULL) )
@@ -216,12 +216,14 @@ int elf_xen_parse_note(struct elf_binary *elf,
return 0;
}
-static int elf_xen_parse_notes(struct elf_binary *elf,
+#define ELF_NOTE_INVALID (~0U)
+
+static unsigned elf_xen_parse_notes(struct elf_binary *elf,
struct elf_dom_parms *parms,
ELF_PTRVAL_CONST_VOID start,
ELF_PTRVAL_CONST_VOID end)
{
- int xen_elfnotes = 0;
+ unsigned xen_elfnotes = 0;
ELF_HANDLE_DECL(elf_note) note;
const char *note_name;
@@ -237,7 +239,7 @@ static int elf_xen_parse_notes(struct elf_binary *elf,
if ( strcmp(note_name, "Xen") )
continue;
if ( elf_xen_parse_note(elf, parms, note) )
- return -1;
+ return ELF_NOTE_INVALID;
xen_elfnotes++;
}
return xen_elfnotes;
@@ -246,12 +248,12 @@ static int elf_xen_parse_notes(struct elf_binary *elf,
/* ------------------------------------------------------------------------ */
/* __xen_guest section */
-int elf_xen_parse_guest_info(struct elf_binary *elf,
+elf_errorstatus elf_xen_parse_guest_info(struct elf_binary *elf,
struct elf_dom_parms *parms)
{
ELF_PTRVAL_CONST_CHAR h;
- char name[32], value[128];
- int len;
+ unsigned char name[32], value[128];
+ unsigned len;
h = parms->guest_info;
#define STAR(h) (elf_access_unsigned(elf, (h), 0, 1))
@@ -334,13 +336,13 @@ int elf_xen_parse_guest_info(struct elf_binary *elf,
/* ------------------------------------------------------------------------ */
/* sanity checks */
-static int elf_xen_note_check(struct elf_binary *elf,
+static elf_errorstatus elf_xen_note_check(struct elf_binary *elf,
struct elf_dom_parms *parms)
{
if ( (ELF_PTRVAL_INVALID(parms->elf_note_start)) &&
(ELF_PTRVAL_INVALID(parms->guest_info)) )
{
- int machine = elf_uval(elf, elf->ehdr, e_machine);
+ unsigned machine = elf_uval(elf, elf->ehdr, e_machine);
if ( (machine == EM_386) || (machine == EM_X86_64) )
{
elf_err(elf, "%s: ERROR: Not a Xen-ELF image: "
@@ -378,7 +380,7 @@ static int elf_xen_note_check(struct elf_binary *elf,
return 0;
}
-static int elf_xen_addr_calc_check(struct elf_binary *elf,
+static elf_errorstatus elf_xen_addr_calc_check(struct elf_binary *elf,
struct elf_dom_parms *parms)
{
if ( (parms->elf_paddr_offset != UNSET_ADDR) &&
@@ -464,13 +466,13 @@ static int elf_xen_addr_calc_check(struct elf_binary *elf,
/* ------------------------------------------------------------------------ */
/* glue it all together ... */
-int elf_xen_parse(struct elf_binary *elf,
+elf_errorstatus elf_xen_parse(struct elf_binary *elf,
struct elf_dom_parms *parms)
{
ELF_HANDLE_DECL(elf_shdr) shdr;
ELF_HANDLE_DECL(elf_phdr) phdr;
- int xen_elfnotes = 0;
- int i, count, rc;
+ unsigned xen_elfnotes = 0;
+ unsigned i, count, more_notes;
elf_memset_unchecked(parms, 0, sizeof(*parms));
parms->virt_base = UNSET_ADDR;
@@ -495,13 +497,13 @@ int elf_xen_parse(struct elf_binary *elf,
if (elf_uval(elf, phdr, p_offset) == 0)
continue;
- rc = elf_xen_parse_notes(elf, parms,
+ more_notes = elf_xen_parse_notes(elf, parms,
elf_segment_start(elf, phdr),
elf_segment_end(elf, phdr));
- if ( rc == -1 )
+ if ( more_notes == ELF_NOTE_INVALID )
return -1;
- xen_elfnotes += rc;
+ xen_elfnotes += more_notes;
}
/*
@@ -518,17 +520,17 @@ int elf_xen_parse(struct elf_binary *elf,
if ( elf_uval(elf, shdr, sh_type) != SHT_NOTE )
continue;
- rc = elf_xen_parse_notes(elf, parms,
+ more_notes = elf_xen_parse_notes(elf, parms,
elf_section_start(elf, shdr),
elf_section_end(elf, shdr));
- if ( rc == -1 )
+ if ( more_notes == ELF_NOTE_INVALID )
return -1;
- if ( xen_elfnotes == 0 && rc > 0 )
+ if ( xen_elfnotes == 0 && more_notes > 0 )
elf_msg(elf, "%s: using notes from SHT_NOTE section\n", __FUNCTION__);
- xen_elfnotes += rc;
+ xen_elfnotes += more_notes;
}
}
diff --git a/xen/common/libelf/libelf-loader.c b/xen/common/libelf/libelf-loader.c
index 0dccd4d..c3a9e51 100644
--- a/xen/common/libelf/libelf-loader.c
+++ b/xen/common/libelf/libelf-loader.c
@@ -24,7 +24,7 @@
/* ------------------------------------------------------------------------ */
-int elf_init(struct elf_binary *elf, const char *image_input, size_t size)
+elf_errorstatus elf_init(struct elf_binary *elf, const char *image_input, size_t size)
{
ELF_HANDLE_DECL(elf_shdr) shdr;
uint64_t i, count, section, offset;
@@ -114,7 +114,7 @@ void elf_set_log(struct elf_binary *elf, elf_log_callback *log_callback,
elf->verbose = verbose;
}
-static int elf_load_image(struct elf_binary *elf,
+static elf_errorstatus elf_load_image(struct elf_binary *elf,
ELF_PTRVAL_VOID dst, ELF_PTRVAL_CONST_VOID src,
uint64_t filesz, uint64_t memsz)
{
@@ -129,9 +129,9 @@ void elf_set_verbose(struct elf_binary *elf)
elf->verbose = 1;
}
-static int elf_load_image(struct elf_binary *elf, ELF_PTRVAL_VOID dst, ELF_PTRVAL_CONST_VOID src, uint64_t filesz, uint64_t memsz)
+static elf_errorstatus elf_load_image(struct elf_binary *elf, ELF_PTRVAL_VOID dst, ELF_PTRVAL_CONST_VOID src, uint64_t filesz, uint64_t memsz)
{
- int rc;
+ elf_errorstatus rc;
if ( filesz > ULONG_MAX || memsz > ULONG_MAX )
return -1;
/* We trust the dom0 kernel image completely, so we don't care
@@ -151,7 +151,7 @@ void elf_parse_bsdsyms(struct elf_binary *elf, uint64_t pstart)
{
uint64_t sz;
ELF_HANDLE_DECL(elf_shdr) shdr;
- int i, type;
+ unsigned i, type;
if ( !ELF_HANDLE_VALID(elf->sym_tab) )
return;
@@ -187,7 +187,7 @@ static void elf_load_bsdsyms(struct elf_binary *elf)
ELF_PTRVAL_VOID symbase;
ELF_PTRVAL_VOID symtab_addr;
ELF_HANDLE_DECL_NONCONST(elf_shdr) shdr;
- int i, type;
+ unsigned i, type;
if ( !elf->bsd_symtab_pstart )
return;
@@ -220,7 +220,7 @@ do { \
elf_memcpy_safe(elf, ELF_HANDLE_PTRVAL(shdr),
ELF_IMAGE_BASE(elf) + elf_uval(elf, elf->ehdr, e_shoff),
sz);
- maxva = ELF_OBSOLETE_VOIDP_CAST elf_round_up(elf, (long)maxva + sz);
+ maxva = ELF_OBSOLETE_VOIDP_CAST elf_round_up(elf, (unsigned long)maxva + sz);
for ( i = 0; i < elf_shdr_count(elf); i++ )
{
@@ -233,10 +233,10 @@ do { \
elf_memcpy_safe(elf, maxva, elf_section_start(elf, shdr), sz);
/* Mangled to be based on ELF header location. */
elf_hdr_elm(elf, shdr, sh_offset, maxva - symtab_addr);
- maxva = ELF_OBSOLETE_VOIDP_CAST elf_round_up(elf, (long)maxva + sz);
+ maxva = ELF_OBSOLETE_VOIDP_CAST elf_round_up(elf, (unsigned long)maxva + sz);
}
shdr = ELF_MAKE_HANDLE(elf_shdr, ELF_HANDLE_PTRVAL(shdr) +
- (long)elf_uval(elf, elf->ehdr, e_shentsize));
+ (unsigned long)elf_uval(elf, elf->ehdr, e_shentsize));
}
/* Write down the actual sym size. */
@@ -273,7 +273,7 @@ void elf_parse_binary(struct elf_binary *elf)
__FUNCTION__, elf->pstart, elf->pend);
}
-int elf_load_binary(struct elf_binary *elf)
+elf_errorstatus elf_load_binary(struct elf_binary *elf)
{
ELF_HANDLE_DECL(elf_phdr) phdr;
uint64_t i, count, paddr, offset, filesz, memsz;
diff --git a/xen/common/libelf/libelf-tools.c b/xen/common/libelf/libelf-tools.c
index fa58f76..46d4ab1 100644
--- a/xen/common/libelf/libelf-tools.c
+++ b/xen/common/libelf/libelf-tools.c
@@ -122,19 +122,19 @@ uint64_t elf_access_unsigned(struct elf_binary * elf, elf_ptrval base,
uint64_t elf_round_up(struct elf_binary *elf, uint64_t addr)
{
- int elf_round = (elf_64bit(elf) ? 8 : 4) - 1;
+ uint64_t elf_round = (elf_64bit(elf) ? 8 : 4) - 1;
return (addr + elf_round) & ~elf_round;
}
/* ------------------------------------------------------------------------ */
-int elf_shdr_count(struct elf_binary *elf)
+unsigned elf_shdr_count(struct elf_binary *elf)
{
return elf_uval(elf, elf->ehdr, e_shnum);
}
-int elf_phdr_count(struct elf_binary *elf)
+unsigned elf_phdr_count(struct elf_binary *elf)
{
return elf_uval(elf, elf->ehdr, e_phnum);
}
@@ -144,7 +144,7 @@ ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_name(struct elf_binary *elf, const char *n
uint64_t count = elf_shdr_count(elf);
ELF_HANDLE_DECL(elf_shdr) shdr;
const char *sname;
- int i;
+ unsigned i;
for ( i = 0; i < count; i++ )
{
@@ -156,7 +156,7 @@ ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_name(struct elf_binary *elf, const char *n
return ELF_INVALID_HANDLE(elf_shdr);
}
-ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_index(struct elf_binary *elf, int index)
+ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_index(struct elf_binary *elf, unsigned index)
{
uint64_t count = elf_shdr_count(elf);
ELF_PTRVAL_CONST_VOID ptr;
@@ -170,7 +170,7 @@ ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_index(struct elf_binary *elf, int index)
return ELF_MAKE_HANDLE(elf_shdr, ptr);
}
-ELF_HANDLE_DECL(elf_phdr) elf_phdr_by_index(struct elf_binary *elf, int index)
+ELF_HANDLE_DECL(elf_phdr) elf_phdr_by_index(struct elf_binary *elf, unsigned index)
{
uint64_t count = elf_uval(elf, elf->ehdr, e_phnum);
ELF_PTRVAL_CONST_VOID ptr;
@@ -264,7 +264,7 @@ ELF_HANDLE_DECL(elf_sym) elf_sym_by_name(struct elf_binary *elf, const char *sym
return ELF_INVALID_HANDLE(elf_sym);
}
-ELF_HANDLE_DECL(elf_sym) elf_sym_by_index(struct elf_binary *elf, int index)
+ELF_HANDLE_DECL(elf_sym) elf_sym_by_index(struct elf_binary *elf, unsigned index)
{
ELF_PTRVAL_CONST_VOID ptr = elf_section_start(elf, elf->sym_tab);
ELF_HANDLE_DECL(elf_sym) sym;
@@ -280,7 +280,7 @@ const char *elf_note_name(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) note
ELF_PTRVAL_CONST_VOID elf_note_desc(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) note)
{
- int namesz = (elf_uval(elf, note, namesz) + 3) & ~3;
+ unsigned namesz = (elf_uval(elf, note, namesz) + 3) & ~3;
return ELF_HANDLE_PTRVAL(note) + elf_size(elf, note) + namesz;
}
@@ -288,7 +288,7 @@ ELF_PTRVAL_CONST_VOID elf_note_desc(struct elf_binary *elf, ELF_HANDLE_DECL(elf_
uint64_t elf_note_numeric(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) note)
{
ELF_PTRVAL_CONST_VOID desc = elf_note_desc(elf, note);
- int descsz = elf_uval(elf, note, descsz);
+ unsigned descsz = elf_uval(elf, note, descsz);
switch (descsz)
{
@@ -306,7 +306,7 @@ uint64_t elf_note_numeric_array(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note
unsigned int unitsz, unsigned int idx)
{
ELF_PTRVAL_CONST_VOID desc = elf_note_desc(elf, note);
- int descsz = elf_uval(elf, note, descsz);
+ unsigned descsz = elf_uval(elf, note, descsz);
if ( descsz % unitsz || idx >= descsz / unitsz )
return 0;
@@ -324,8 +324,8 @@ uint64_t elf_note_numeric_array(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note
ELF_HANDLE_DECL(elf_note) elf_note_next(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) note)
{
- int namesz = (elf_uval(elf, note, namesz) + 3) & ~3;
- int descsz = (elf_uval(elf, note, descsz) + 3) & ~3;
+ unsigned namesz = (elf_uval(elf, note, namesz) + 3) & ~3;
+ unsigned descsz = (elf_uval(elf, note, descsz) + 3) & ~3;
return ELF_MAKE_HANDLE(elf_note, ELF_HANDLE_PTRVAL(note) + elf_size(elf, note) + namesz + descsz);
}
diff --git a/xen/include/xen/libelf.h b/xen/include/xen/libelf.h
index 951430f..87e126a 100644
--- a/xen/include/xen/libelf.h
+++ b/xen/include/xen/libelf.h
@@ -31,6 +31,9 @@
#include <stdbool.h>
+typedef int elf_errorstatus; /* 0: ok; -ve (normally -1): error */
+typedef int elf_negerrnoval; /* 0: ok; -EFOO: error */
+
#undef ELFSIZE
#include "elfstructs.h"
#ifdef __XEN__
@@ -328,12 +331,12 @@ bool elf_access_ok(struct elf_binary * elf,
/* ------------------------------------------------------------------------ */
/* xc_libelf_tools.c */
-int elf_shdr_count(struct elf_binary *elf);
-int elf_phdr_count(struct elf_binary *elf);
+unsigned elf_shdr_count(struct elf_binary *elf);
+unsigned elf_phdr_count(struct elf_binary *elf);
ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_name(struct elf_binary *elf, const char *name);
-ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_index(struct elf_binary *elf, int index);
-ELF_HANDLE_DECL(elf_phdr) elf_phdr_by_index(struct elf_binary *elf, int index);
+ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_index(struct elf_binary *elf, unsigned index);
+ELF_HANDLE_DECL(elf_phdr) elf_phdr_by_index(struct elf_binary *elf, unsigned index);
const char *elf_section_name(struct elf_binary *elf, ELF_HANDLE_DECL(elf_shdr) shdr); /* might return NULL if inputs are invalid */
ELF_PTRVAL_CONST_VOID elf_section_start(struct elf_binary *elf, ELF_HANDLE_DECL(elf_shdr) shdr);
@@ -343,7 +346,7 @@ ELF_PTRVAL_CONST_VOID elf_segment_start(struct elf_binary *elf, ELF_HANDLE_DECL(
ELF_PTRVAL_CONST_VOID elf_segment_end(struct elf_binary *elf, ELF_HANDLE_DECL(elf_phdr) phdr);
ELF_HANDLE_DECL(elf_sym) elf_sym_by_name(struct elf_binary *elf, const char *symbol);
-ELF_HANDLE_DECL(elf_sym) elf_sym_by_index(struct elf_binary *elf, int index);
+ELF_HANDLE_DECL(elf_sym) elf_sym_by_index(struct elf_binary *elf, unsigned index);
const char *elf_note_name(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) note); /* may return NULL */
ELF_PTRVAL_CONST_VOID elf_note_desc(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) note);
@@ -360,7 +363,7 @@ bool elf_phdr_is_loadable(struct elf_binary *elf, ELF_HANDLE_DECL(elf_phdr) phdr
/* ------------------------------------------------------------------------ */
/* xc_libelf_loader.c */
-int elf_init(struct elf_binary *elf, const char *image, size_t size);
+elf_errorstatus elf_init(struct elf_binary *elf, const char *image, size_t size);
/*
* image and size must be correct. They will be recorded in
* *elf, and must remain valid while the elf is in use.
@@ -373,7 +376,7 @@ void elf_set_log(struct elf_binary *elf, elf_log_callback*,
#endif
void elf_parse_binary(struct elf_binary *elf);
-int elf_load_binary(struct elf_binary *elf);
+elf_errorstatus elf_load_binary(struct elf_binary *elf);
ELF_PTRVAL_VOID elf_get_ptr(struct elf_binary *elf, unsigned long addr);
uint64_t elf_lookup_addr(struct elf_binary *elf, const char *symbol);
@@ -386,7 +389,7 @@ const char *elf_check_broken(const struct elf_binary *elf); /* NULL means OK */
/* ------------------------------------------------------------------------ */
/* xc_libelf_relocate.c */
-int elf_reloc(struct elf_binary *elf);
+elf_errorstatus elf_reloc(struct elf_binary *elf);
/* ------------------------------------------------------------------------ */
/* xc_libelf_dominfo.c */
@@ -420,7 +423,7 @@ struct elf_dom_parms {
char guest_ver[16];
char xen_ver[16];
char loader[16];
- int pae;
+ int pae; /* some kind of enum apparently */
bool bsd_symtab;
uint64_t virt_base;
uint64_t virt_entry;
--
1.7.2.5

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/xen-tools-4.2.1-r4.ebuild,v 1.1 2013/06/26 14:41:37 idella4 Exp $
# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/xen-tools-4.2.1-r4.ebuild,v 1.3 2013/06/27 13:21:11 idella4 Exp $
EAPI=5
@ -9,6 +9,7 @@ PYTHON_REQ_USE='xml,threads'
IPXE_TARBALL_URL="http://dev.gentoo.org/~idella4/tarballs/ipxe.tar.gz"
XEN_SEABIOS_URL="http://dev.gentoo.org/~idella4/tarballs/seabios-0-20121121.tar.bz2"
XSAPATCHES="http://dev.gentoo.org/~idella4/"
if [[ $PV == *9999 ]]; then
KEYWORDS=""
@ -20,7 +21,8 @@ else
KEYWORDS="~amd64 ~x86"
SRC_URI="http://bits.xensource.com/oss-xen/release/${PV}/xen-${PV}.tar.gz
$IPXE_TARBALL_URL
$XEN_SEABIOS_URL"
$XEN_SEABIOS_URL
$XSAPATCHES/patches/XSA-55patches.tar.gz"
S="${WORKDIR}/xen-${PV}"
fi
@ -67,8 +69,7 @@ DEPEND="${CDEPEND}
dev-texlive/texlive-pictures
dev-texlive/texlive-latexrecommended
)
hvm? ( x11-proto/xproto )
qemu? ( >=sys-apps/texinfo-5 )"
hvm? ( x11-proto/xproto )"
RDEPEND="${CDEPEND}
sys-apps/iproute2
net-misc/bridge-utils
@ -209,12 +210,12 @@ src_prepare() {
"${FILESDIR}"/xen-4.2-CVE-2013-3-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-4-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-5to7-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-8-XSA-55.patch \
"${WORKDIR}"/files/xen-4.2-CVE-2013-8-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-9to10-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-11-XSA-55.patch \
"${WORKDIR}"/files/xen-4.2-CVE-2013-11-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-12to13-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-14-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-15-XSA-55.patch \
"${WORKDIR}"/files/xen-4.2-CVE-2013-15-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-16-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-17-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-18to19-XSA-55.patch \

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/xen-tools-4.2.2-r2.ebuild,v 1.1 2013/06/26 14:41:37 idella4 Exp $
# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/xen-tools-4.2.2-r2.ebuild,v 1.3 2013/06/27 13:21:11 idella4 Exp $
EAPI=5
@ -9,7 +9,7 @@ PYTHON_REQ_USE='xml,threads'
IPXE_TARBALL_URL="http://dev.gentoo.org/~idella4/tarballs/ipxe.tar.gz"
XEN_SEABIOS_URL="http://dev.gentoo.org/~idella4/tarballs/seabios-0-20121121.tar.bz2"
XSAPATCHES="http://dev.gentoo.org/~idella4/"
if [[ $PV == *9999 ]]; then
KEYWORDS=""
REPO="xen-unstable.hg"
@ -20,7 +20,8 @@ else
KEYWORDS="~amd64 ~x86"
SRC_URI="http://bits.xensource.com/oss-xen/release/${PV}/xen-${PV}.tar.gz
$IPXE_TARBALL_URL
$XEN_SEABIOS_URL"
$XEN_SEABIOS_URL
$XSAPATCHES/patches/XSA-55patches.tar.gz"
S="${WORKDIR}/xen-${PV}"
fi
@ -68,8 +69,7 @@ DEPEND="${CDEPEND}
dev-texlive/texlive-pictures
dev-texlive/texlive-latexrecommended
)
hvm? ( x11-proto/xproto )
qemu? ( >=sys-apps/texinfo-5 )"
hvm? ( x11-proto/xproto )"
RDEPEND="${CDEPEND}
sys-apps/iproute2
net-misc/bridge-utils
@ -208,12 +208,12 @@ src_prepare() {
"${FILESDIR}"/xen-4.2-CVE-2013-3-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-4-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-5to7-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-8-XSA-55.patch \
"${WORKDIR}"/files/xen-4.2-CVE-2013-8-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-9to10-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-11-XSA-55.patch \
"${WORKDIR}"/files/xen-4.2-CVE-2013-11-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-12to13-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-14-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-15-XSA-55.patch \
"${WORKDIR}"/files/xen-4.2-CVE-2013-15-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-16-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-17-XSA-55.patch \
"${FILESDIR}"/xen-4.2-CVE-2013-18to19-XSA-55.patch \

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen/xen-4.2.1-r4.ebuild,v 1.1 2013/06/26 06:35:38 idella4 Exp $
# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen/xen-4.2.1-r4.ebuild,v 1.2 2013/06/27 06:05:11 idella4 Exp $
EAPI=5
@ -94,7 +94,7 @@ src_prepare() {
"${FILESDIR}"/${PN}-4-CVE-2013-0153-XSA-36.patch \
"${FILESDIR}"/${PN}-4-CVE-2013-1917-XSA-44.patch \
"${FILESDIR}"/${PN}-4-CVE-2013-1918-XSA-45_[1-7].patch \
"${FILESDIR}"/${PN}-4.2-2013-2076-XSA-52.patch
"${FILESDIR}"/${PN}-4.2-2013-2076-XSA-52to54.patch
}
src_configure() {

@ -0,0 +1 @@
DIST gcalcli-2.4.2.tar.gz 1667739 SHA256 bcfaada7092fd988a23659cd285ec40919541bae2d9516daefcbd278f78bbc3b SHA512 ae0d4ddb4befa43df5ebbe434d44719522246725b2950549fcf43969038fcbab76012ee0855c02cb623bfd75351bf7b854ca6f74c34cbc57ca9a28e6d467bed1 WHIRLPOOL 2c58c276b6cc18d2768e9dd9dd88564a84427e6685f3f3809c66b9f0608bc2d60a3a81b961ea1dc6b1d4713ca200402a4cd3fbb5b5f34772cf4b012d364c2926

@ -0,0 +1,29 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-misc/gcalcli/gcalcli-2.4.2.ebuild,v 1.2 2013/06/27 03:15:21 robbat2 Exp $
EAPI=5
# google-api-python-client only supports these
PYTHON_COMPAT=( python{2_6,2_7} pypy{1_9,2_0} )
inherit python-r1
DESCRIPTION="Google Calendar Command Line Interface"
HOMEPAGE="https://github.com/insanum/gcalcli"
SRC_URI="https://github.com/insanum/gcalcli/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
DEPEND=""
RDEPEND="dev-python/python-dateutil
dev-python/google-api-python-client
dev-python/vobject"
src_install() {
dodoc -r ChangeLog README.md docs
python_foreach_impl python_doscript ${PN}
}

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer>
<email>robbat2@gentoo.org</email>
<name>Robin H. Johnson</name>
</maintainer>
</pkgmetadata>

@ -1,2 +1 @@
DIST ignuit-0.0.16.tar.gz 499016 SHA256 cfb4de8907662f35eb6044c60b8aa736ecc24bdae0a45fc4574ecb563824d846 SHA512 daf193a92b67dffcf1ff72c5a19a3caf2a4b4318ed90e406518ca1f598b6ebf2266578bdf730933ec6ec3b7ac8440719122a8327583b1ca697807d9a5cff7367 WHIRLPOOL f1f976df0229645004693cfa7318e0385fdea28a5dcb9470bfc98834673d7fa18c6a60c027c8b42e28476bd41fabaf5beef0db652d14b31d1f46a2b26e375520
DIST ignuit-2.20.0.tar.gz 541546 SHA256 5dc75cef0707677421c272c430cebf5c3730cbcfaeba6428fe14f6bd085d3630 SHA512 3d3a786ce87e252b1529ba427da52356d43554da6c23dfd3353f91b2c3962a83769431794c433c8ba8478ef48b8ef470a042416c5d2b2c0683711b09c959e106 WHIRLPOOL d93d2acb472bd23721c866f7231d301da8d9ee1f6894d51e1166bdc538ce0b99af2d3a79dd27ca72fd7ca6ab9a5a8b6aefd97d0219292e893ada9bdb7e8dd649

@ -1,42 +0,0 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-misc/ignuit/ignuit-0.0.16.ebuild,v 1.7 2013/06/14 12:38:03 pinkbyte Exp $
EAPI="2"
DESCRIPTION="memorization aid based on the Leitner flashcard system"
HOMEPAGE="http://homepages.ihug.co.nz/~trmusson/programs.html#ignuit"
SRC_URI="http://homepages.ihug.co.nz/~trmusson/stuff/${P}.tar.gz"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="amd64 ppc ppc64 x86"
IUSE="examples"
RDEPEND=">=gnome-base/libgnomeui-2.22.1
gnome-base/gconf:2
gnome-base/libglade:2.0
dev-libs/glib:2
x11-libs/gtk+:2
>=media-libs/gstreamer-0.10.20:0.10
dev-libs/libxslt
dev-libs/libxml2:2
x11-libs/pango
app-text/dvipng
app-text/scrollkeeper
virtual/latex-base
>=app-text/gnome-doc-utils-0.3.2"
DEPEND="${RDEPEND}
sys-devel/gettext
dev-util/intltool"
src_install() {
emake DESTDIR="${D}" install || die "emake install failed."
dodoc AUTHORS NEWS README TODO || die "dodoc failed"
if use examples; then
insinto /usr/share/doc/${PF}
doins -r examples
fi
}

@ -1 +1,2 @@
DIST klavaro-1.9.6.tar.bz2 773462 SHA256 6d7fc916eb83d0381b0719c1525c8ea13a5032abcadd438755c7451b9f071561 SHA512 487110b4abfd5be5503bee82b100be538881acea88f7fefa374aa9f1ec349016ac8c0200e9c6fc1669c110c718ae4f2477a844b169e72eca5dd5750ce933d2ab WHIRLPOOL e49237ad5c4d290f71503c5a27fb368ecd0167ae2e295917dafd2e215e9fdab090267274a99e47eb3ad3881f5ee6483c9a8a0edde85ad1fe26f45c96523a66f5
DIST klavaro-1.9.7.tar.bz2 802138 SHA256 4ebe693639ae59e560e0bbc54077c804eae7c495f8a8436fb559cdbdf4e5c1c8 SHA512 1f27d2e1003e03644bc1ac765a56b9416314ce5a7088f8ece7e5abd450a3ac7c084caf7cdbdac4088edc5dedaf94540fc655781126050c1b14fe2939a78d503f WHIRLPOOL 9ef8d76ba8f4344313d3643a480f743c266dcff03e095b162143ce94aa212adb985cba8fa0330958a862adc22b4d9414b13df02f7652f90e56d8b480a54e3295

@ -0,0 +1,28 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-misc/klavaro/klavaro-1.9.7.ebuild,v 1.1 2013/06/27 13:21:04 xmw Exp $
EAPI=5
AUTOTOOLS_AUTORECONF=yes
inherit autotools-utils
DESCRIPTION="Another free touch typing tutor program"
HOMEPAGE="http://klavaro.sourceforge.net/"
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
RDEPEND="net-misc/curl
x11-libs/gtk+:2
x11-libs/gtkdatabox"
DEPEND="${RDEPEND}
sys-devel/gettext
|| ( dev-util/gtk-builder-convert <=x11-libs/gtk+-2.24.10:2 )"
PATCHES=( "${FILESDIR}"/${PN}-1.9.5-gold.patch )

@ -1,7 +1,10 @@
DIST texlive-20110705-source.tar.xz 131207904 SHA256 772d19795fd841737f5b00472810b49d98b3b62373fba67c12c757e95c510da2 SHA512 1efb5713bf80379f5104b41576911a4194d378ce35be5afb568c3b4aff6461b2b22e72fb34bc294021cf14a28d07bab083872f17752441f269f36c50f9363cc1 WHIRLPOOL 11cc5b53dedae8977b5d776f9141a849b23b877b836f56469336018e3529ebbf369c99d534c1d645aa99fe0750968f0089034a232dcf9401967e20afb5ce8dd5
DIST texlive-20120701-source.tar.xz 131904044 SHA256 9666617d5dac3e82578e696835cc9f251ee0a56d162d86dff08659ac5dcb6c81 SHA512 0e8653aa21094e079900d17256f0768ac5514690a3725d96923d5fdc7633484d611441df1af8c674b38b9ce6a8845a9004976cd00635742dfc6837aa433caf5f WHIRLPOOL 9d570a1bd58cca8baed399ab53eb767c7c3db607c00363ce563e14dfccdd235703c538e6a651aa7f2934adf21f8477775f1547f9e7f3d957b89af644c89bcb57
DIST texlive-20130530-source.tar.xz 179963948 SHA256 a905832e4c04dd1cb16db4bb7baacb78fbc19682bd33ac2697a3a85ce78d79d4 SHA512 4aa85273a675af2453f09777b7cb348c18add77410d72f562c6586f6814d4e7c34b6f3690e3453020654fb0a265339fcabf590d9155367d52846224499af334c WHIRLPOOL 3affaf25d3936505d971599092964b0f0e97d107d22dbac6a85ad547e1d2726a6a09c5075fecb0c6ff8c88bc1bd09d78f95902f76eb76c608f8a7bc42dd6bc33
DIST texlive-core-upstream-patches-1.tar.xz 4316 SHA256 0a3eccc79ad608ea543e2ce04adcca0dbe968dbaebaa43014854f51d609659a5 SHA512 a559700fffbe2985b3eade84a9f8f539ba624ab5f92f2127769180073c6f05a9444c11599fef879d0f91aaa8ecbe76f6d4b4ebda2fae83da48074dc888eaa4b6 WHIRLPOOL f62e16fa7ab92c4f7800b48c82383d916f6450f08f6c39765672590e6c52088e252da398855d3b70a3c857a2f975d7b782ae045be083c4124fe84920dd0a4658
DIST texlive-module-dvips-2011.tar.xz 93692 SHA256 dbf5c731fa4a0b34db1854b6704f197607253f5716051538bda28db1044bd276 SHA512 9384e20e09c6ca23e17ef7ad220979f0df963b8029c42ca6cdcb2ad8236373ae79486576eac38fa6c7dd5358e15335b058f49fdbb4adcd0ec09ed2138d43c751 WHIRLPOOL f05f98c191bc79c1d8c213ea7583c8556c5720e962061fe628243e458724d8fe542cb906b6b0276b449eeb5709a4fcf35b47f16d205900ab9045b08e83bb3f03
DIST texlive-module-dvips-2012.tar.xz 95692 SHA256 9f12bb214eb245061bca42cd79fff999751725e35e972b2aa11439ced23f0d10 SHA512 cc5a5070fd04b501e2fae92864bfe027db2fb01cc5c0087fa62ba71ea044baa1166f5990d8545fc0b6ead130a069f825a6df243028ae1e8e7337d48936676d19 WHIRLPOOL 8c269d5242cb73cdeb83d6c304f9669fe3a7fbffa3faa67e765b5418c1ac8da8d1f3a2c20f9aea47b63734f813057aa99715c038de382f1ef3405e1cbf0a1b68
DIST texlive-module-dvips-2013.tar.xz 114352 SHA256 cb3f058a3cfd139624d507f5b6cfdf8fd256978351d83148fa049e62f00f934e SHA512 816bb97b17548149435c5ce546cc84d11731be2c42a632e8146c8091367661be0b03dd939f244aca0d85d2d9706055dd82ca2bad66859043a8c7855b609b4991 WHIRLPOOL f5eabf48ba66113856db2baee6a5617bab35ffa09a4cca42b6c7fdb62b1adc14ae93fb53f8f45ce414bfa38d0630870f05b102e1450bc3b16e12a299a9b1de07
DIST texlive-module-dvips.doc-2011.tar.xz 483680 SHA256 15c98b215eb5bee39a4982f3e1d9ef67578f5381c6bb54bc3252bab68f02ec88 SHA512 725fcdc16687d8b67456da2e69a7d23b228339913497cfb0038b7d75e1add36665e4bdf437593772a3cc4488c34866e22ab139946f4dcb502ace63d3052ef72b WHIRLPOOL 0927805b8d53979f07e4478331642f06d6ecb7311326f24bc49ba2504a4e41306bbcd410f2d48a003f7dcbdd3d534d20e5ba8c2279345215ecc3c3541258c1c9
DIST texlive-module-dvips.doc-2012.tar.xz 484056 SHA256 247a738b46cd7283179de5bbd8e4ecf330fb145a886580b5ebd5547cee530e9c SHA512 05e0719edd98169982daa4fbf8b943b71b8bf8b4ae4f84ae70015bbff4e7ba2d55c7a4ed4a8ccf081193669ecceeb21dd05476d104d3742be0842b1bba84a4a5 WHIRLPOOL 3af98dc454152c1c0a6abfda19c43a29a8701a4dab3d155b530c2a0e0c0f81db7911de31b491c08b0cca4b8a06172a58796f54a2ea2184ab6371fede7b627edd
DIST texlive-module-dvips.doc-2013.tar.xz 484492 SHA256 76dfb96428aee66f6cac7ba1925f245f498e176028f4930c09b7fa7668c3374f SHA512 4886f1156b6984a146e0128b6ba627131dbd3281a9e084ac2852cf3929f1c4f6a302c54ad37734d0b97aae9e45a8193679405e6c33a54a1367fbb793f771c4e8 WHIRLPOOL 8941a5da4b375f9800153550aa32d8376e9519c1fea643a1f8ad24a0a20f81a1957bb0d5cbb8f56186fa12ef70c89ea3bac2af46d4e4d698a22ac78bf41d0943

@ -0,0 +1,71 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-text/dvipsk/dvipsk-5.993_p20130530.ebuild,v 1.1 2013/06/27 14:16:33 aballier Exp $
EAPI=4
#TL_UPSTREAM_PATCHLEVEL="1"
inherit texlive-common eutils
DESCRIPTION="DVI-to-PostScript translator"
HOMEPAGE="http://tug.org/texlive/"
SRC_URI="mirror://gentoo/texlive-${PV#*_p}-source.tar.xz"
#SRC_URI="${SRC_URI} mirror://gentoo/texlive-core-upstream-patches-${TL_UPSTREAM_PATCHLEVEL}.tar.xz"
TL_VERSION=2013
EXTRA_TL_MODULES="dvips"
EXTRA_TL_DOC_MODULES="dvips.doc"
for i in ${EXTRA_TL_MODULES} ; do
SRC_URI="${SRC_URI} mirror://gentoo/texlive-module-${i}-${TL_VERSION}.tar.xz"
done
SRC_URI="${SRC_URI} doc? ( "
for i in ${EXTRA_TL_DOC_MODULES} ; do
SRC_URI="${SRC_URI} mirror://gentoo/texlive-module-${i}-${TL_VERSION}.tar.xz"
done
SRC_URI="${SRC_URI} ) "
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
IUSE="doc source"
DEPEND=">=dev-libs/kpathsea-6.1.0_p20120701"
RDEPEND="
!<app-text/texlive-core-2010
!<dev-texlive/texlive-basic-2009
!app-text/ptex
${DEPEND}"
S=${WORKDIR}/texlive-${PV#*_p}-source/texk/${PN}
#src_prepare() {
# cd "${WORKDIR}/texlive-${PV#*_p}-source/"
# EPATCH_MULTI_MSG="Applying patches from upstream bugfix branch..." EPATCH_SUFFIX="patch" epatch "${WORKDIR}/gentoo_branch2011_patches"
#}
src_configure() {
econf --with-system-kpathsea
}
src_install() {
emake DESTDIR="${D}" prologdir="${EPREFIX}/usr/share/texmf-dist/dvips/base" install
dodir /usr/share # just in case
cp -pR "${WORKDIR}"/texmf-dist "${ED}/usr/share/" || die "failed to install texmf trees"
if use source ; then
cp -pR "${WORKDIR}"/tlpkg "${ED}/usr/share/" || die "failed to install tlpkg files"
fi
dodoc AUTHORS ChangeLog NEWS README TODO
}
pkg_postinst() {
etexmf-update
}
pkg_postrm() {
etexmf-update
}

@ -0,0 +1,13 @@
Required by http://git.ghostscript.com/?p=mupdf.git;a=commit;f=fitz/dev_list.c;h=f85653219a85a9f91cb14471485611ca5f6b25ba
--- llpp-9999/link.c
+++ llpp-9999/link.c
@@ -571,7 +571,7 @@
free (page->slinks);
}
page->freepage (page->u.ptr);
- fz_free_display_list (state.ctx, page->dlist);
+ fz_drop_display_list (state.ctx, page->dlist);
free (page);
}

@ -0,0 +1,19 @@
--- llpp-9999/work/llpp-9999/link.c
+++ llpp-9999/work/llpp-9999/link.c
@@ -30,12 +30,10 @@
#include <caml/memory.h>
#include <caml/unixsupport.h>
-#include <fitz.h>
-#include <mupdf.h>
-#include <mupdf-internal.h>
-#include <muxps.h>
-#include <muxps-internal.h>
-#include <mucbz.h>
+#include <mupdf/cbz.h>
+#include <mupdf/fitz.h>
+#include <mupdf/pdf.h>
+#include <mupdf/xps.h>
#include FT_FREETYPE_H

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-text/llpp/llpp-9999.ebuild,v 1.24 2013/06/16 22:26:39 xmw Exp $
# $Header: /var/cvsroot/gentoo-x86/app-text/llpp/llpp-9999.ebuild,v 1.25 2013/06/26 19:55:51 xmw Exp $
EAPI=5
@ -39,7 +39,9 @@ RESTRICT="!ocamlopt? ( strip )"
src_prepare() {
epatch "${FILESDIR}"/${PN}-11-WM_CLASS.patch \
"${FILESDIR}"/${P}-mupdf_trailer.patch \
"${FILESDIR}"/${P}-fz_new_text_page.patch
"${FILESDIR}"/${P}-fz_new_text_page.patch \
"${FILESDIR}"/${P}-mupdf-split-headers.patch \
"${FILESDIR}"/${P}-fz_drop_display_list.patch
}
src_compile() {

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-db/mariadb/mariadb-5.5.28a.ebuild,v 1.1 2013/01/20 02:19:54 robbat2 Exp $
# $Header: /var/cvsroot/gentoo-x86/dev-db/mariadb/mariadb-5.5.28a.ebuild,v 1.2 2013/06/26 19:42:59 jmbsvicetto Exp $
EAPI="4"
MY_EXTRAS_VER="20130120-0100Z"
@ -24,12 +24,6 @@ RDEPEND="${RDEPEND}"
# Please do not add a naive src_unpack to this ebuild
# If you want to add a single patch, copy the ebuild to an overlay
# and create your own mysql-extras tarball, looking at 000_index.txt
src_prepare() {
sed -i \
-e '/^noinst_PROGRAMS/s/basic-t//g' \
"${S}"/unittest/mytap/t/Makefile.am
mysql-v2_src_prepare
}
# Official test instructions:
# USE='berkdb -cluster embedded extraengine perl ssl community' \

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-db/mariadb/mariadb-5.5.29.ebuild,v 1.1 2013/02/13 00:47:45 robbat2 Exp $
# $Header: /var/cvsroot/gentoo-x86/dev-db/mariadb/mariadb-5.5.29.ebuild,v 1.2 2013/06/26 19:42:59 jmbsvicetto Exp $
EAPI="4"
MY_EXTRAS_VER="20130120-0100Z"
@ -24,12 +24,6 @@ RDEPEND="${RDEPEND}"
# Please do not add a naive src_unpack to this ebuild
# If you want to add a single patch, copy the ebuild to an overlay
# and create your own mysql-extras tarball, looking at 000_index.txt
src_prepare() {
sed -i \
-e '/^noinst_PROGRAMS/s/basic-t//g' \
"${S}"/unittest/mytap/t/Makefile.am
mysql-v2_src_prepare
}
# Official test instructions:
# USE='berkdb -cluster embedded extraengine perl ssl community' \

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-db/mariadb/mariadb-5.5.30.ebuild,v 1.1 2013/03/14 01:02:16 robbat2 Exp $
# $Header: /var/cvsroot/gentoo-x86/dev-db/mariadb/mariadb-5.5.30.ebuild,v 1.2 2013/06/26 19:42:59 jmbsvicetto Exp $
EAPI="4"
MY_EXTRAS_VER="20130120-0100Z"
@ -24,12 +24,6 @@ RDEPEND="${RDEPEND}"
# Please do not add a naive src_unpack to this ebuild
# If you want to add a single patch, copy the ebuild to an overlay
# and create your own mysql-extras tarball, looking at 000_index.txt
src_prepare() {
sed -i \
-e '/^noinst_PROGRAMS/s/basic-t//g' \
"${S}"/unittest/mytap/t/Makefile.am
mysql-v2_src_prepare
}
# Official test instructions:
# USE='berkdb -cluster embedded extraengine perl ssl community' \

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-db/mariadb/mariadb-5.5.31.ebuild,v 1.1 2013/06/02 19:48:51 robbat2 Exp $
# $Header: /var/cvsroot/gentoo-x86/dev-db/mariadb/mariadb-5.5.31.ebuild,v 1.2 2013/06/26 19:42:59 jmbsvicetto Exp $
EAPI="4"
MY_EXTRAS_VER="20130602-1946Z"

@ -5,10 +5,11 @@ DIST mysql-5.1.66.tar.gz 24771341 SHA256 eb85e3fa152949670f5b6f4379bd1d700a5f472
DIST mysql-5.1.67.tar.gz 24781885 SHA256 8a5fa02a6db0fd167974c5fc4401ae05c6982e5331d93554a241a3ee2dbda406 SHA512 f0477ebd322d7e69c379bfacd2f4980cdca35c6903e67c44ac97aad5183033f1b791030d3b43c2946adf0154abbaab77add226f47de507d5f8050e6fa401f0cc WHIRLPOOL fd4e39d52b42c8a29ec06e153a5089aad23a042e0fe87653c5312884b8737ed72eb2ac914493dca3f9a7359b988dc9d1667c8249a88b20093b0660d7005cba4d
DIST mysql-5.1.68.tar.gz 24655564 SHA256 25f02868dded24a46aeda7863008bcd9639c08fb5a31a137e19534629c65b517 SHA512 f5e68205f0f747c55e2a981055392e8403fcaae8b7470d1306f58653ad480b09fdabaa26ad2fb61a391276fe7fc77b3a17e6bfab07da91d19510cde17ee4d55a WHIRLPOOL 33eda1e6ef734a63799d4d1431281c371d5369b9dbfbfee275d3096a292224d240e7f9fb38ddff4dc3972c905ca10835a7ec4768cabf7331fa5d42f0f3d5c200
DIST mysql-5.1.69.tar.gz 23947181 SHA256 17a5a8a468a6e58cb3be6a16241246fdfd6248d8b5229e46fdb5ffcc070de929 SHA512 ff569f090f8fc0a7dc2fb787124da8ce5d153a2965c3f6b33007d452304b080d491f1a2dc19e0ed218c1ce319fa9c245380ef1a23d05d656641fe76dabbbd63f WHIRLPOOL ac7fb02169229b065c1f38cd99f95a5f92eebc71f753a22fa85420f699cbffe3dc5b5495f81446902d272072f677b06e57ebe9bcb58e53cbe510eb4e929d4e5f
DIST mysql-5.1.70.tar.gz 23984241 SHA256 9e03a343cf1b72b07f9c9bf7be24ffc808aa5c1a9daa590aaf2bc6a7a31f60ed SHA512 5d667af9e819bca85ff4d471cbb2792f47129146822a14cc93abb3f80a6fc6453ef06fc3dece091979003906d76002c1e680b3516747d29f5282827ec87a00e3 WHIRLPOOL 58dedd3b72621b339525338db717c399f04293bee5525856f2a275473f9730b3eafffcc3c29425047e4378ca519cb4da217a269269b0b43ad38178ce1e46f21d
DIST mysql-5.5.29.tar.gz 24870769 SHA256 22b50c089038913b3468c7055fc288f7b5d973199ca37c563cd3a3292e812ae5 SHA512 167bc48c0d4e5351af342828d1f14c003b0d62f7388dd15b1b816df708cc4f06cfe8f7c4177af76fb1c1cbaba5adafe9cb884f76bf75d21a067da25896b29210 WHIRLPOOL 06b4e45c5ed6950d45d4a0623f7626af3b2a9d35656a96867b7cdc4bfc0534207c10afd9b3bcca703b826c67cea62e08992b2de99bdd8d661108c16071fb9773
DIST mysql-5.5.30.tar.gz 24499036 SHA256 909fe596e0044082a02d2757b742a33b8a3ff399b589603940494d3d3d975053 SHA512 f494fdf3f8132606ce45c4a1461d3670228e87f98d2a7269edd124c6afe37a22b7e7db5c83c14c0ddc5f68063ac5e7aec7243880dd9ba011010a049ba008bb08 WHIRLPOOL 29526df3d5b86dc7f48956ecb30e013e938d68299c87a3f34e94e42bb0a1dabd44e7d56879a51aac61d41ca728af9d3d78b7e712db6231338a95feb5a256d86b
DIST mysql-5.5.31.tar.gz 24608323 SHA256 9cdd650b47e3ea864ab40d4ab23fa4a9fdfabc7fd018bf5c9cce30722c0abcea SHA512 2384e08cf78891718aaa8b962666f81c06d1762faff3facb1c0d59c476714416f86ff5186a8e443a78cd8654583241bb8e857cd5a9fb483e77cbb58ca9f7eae6 WHIRLPOOL 2ad859ef4119c8e7afc27075d5849b947a0ecbf1d506f0a47af145e32cfe50e6a0b4c157576e290da435591f0d488260d252f3aa8e42dc7d2761dd951b972657
DIST mysql-5.5.32.tar.gz 24625029 SHA256 20930c3d934937f3863073af0a54cb014a4c6469e5460a81e2ff75062755377e SHA512 a286d57878c30d8c7ebe5879f7d67795f603952af2dfcfe16ac9caba510e4488d89c4fd9d33caa28dbb26076256f339cbc67bbd597cd386beb3cff63433c3e6b WHIRLPOOL 3329ef8d229f0a136231aacab2fd4ef4696c6eae7fb76e5a3ac37889fe6fe80a48517ce32aa85e5dbc2dba1d887d25438f5f3a7819b8ea426844b30cb9925f99
DIST mysql-5.5.32.tar.gz 24589274 SHA256 babb19a1e58f6b285ff75e876f550a798d37fb72b5a548ffb411e8a4a51f6890 SHA512 78e9f0f47b3732e83e1261e8c021002288c0555b3aed7a51359511b038084eb9c7314a3960aa225eab46868fc4700f0f7a6301d1a0068c0f9ba038d41a5b7488 WHIRLPOOL fcf7291524fd8709eccdcef3deb32d132e9db0182aeb39c70b59f7086f49e09526d1bb055b3771915eb19271d7f2b86c0d0f65101dbd7a9d998fe95605cabdd3
DIST mysql-extras-20070105.tar.bz2 50005 SHA256 17697bf70acffd0eeefd976b5ef06dd36080273bf7e805b51a31d72f5f2c5172 SHA512 65e8fd1f9cc71083dbcfaffc331171e0d7deedbd784e416a4b629139f71cc102a84fa62c2d9e48310a18571ef7f06153911ee75c5d7bb6ba88807c287e7cbf34 WHIRLPOOL 3f858fbed6f57ffac863c29bef09a658e3d9f57cf4c6b5c62537973ae44f217344a8592ad311b14b1e7e8d475434b3c69339a8d2873c498ba712ff6f5e128cec
DIST mysql-extras-20090228-2228Z.tar.bz2 254048 SHA256 03a986a5c5ae57f1436553565239613e978ae11e12834fcb275ec6457b12b6fb SHA512 b347c0894d45cff2c10e26c12d7586c335811b607cd760b48e51743e74c55ace820d2d50fac2ce72543c14b9b4d15afce336bd956ea8a820df4a651f23e3b79f WHIRLPOOL 4d89a44791ec7e95baa3822bb62a3638c86d24bcfc777b9ff5a8d26020e7401159a3c03ebda9907fcbf02589b80726f2daa5bf2498d8e6e6e33540edf9b1d551
DIST mysql-extras-20120401-2131Z.tar.bz2 1835097 SHA256 95e531799ed267c566da8b0759da78d0351d6004c7c8a45018054e287a989495 SHA512 0625e1f06e04c7841256955950dd7766a5f03d4ade2aee3c13335f08acff374933ed1fd7ddea214eaaa3531d7373ef094734f5c00530555347f058f5ec4d9d36 WHIRLPOOL f2c6e9387b38b609d3bfea83c6983c456d30a9dcf95c256a44402d4c63fa22543d55d6afa9b8dbf4238dcadf32fac3daec5031d50c8a4acf7a074d04fbede213
@ -17,5 +18,6 @@ DIST mysql-extras-20130120-0100Z.tar.bz2 1899297 SHA256 56db6daa26070cb10b220cb0
DIST mysql-extras-20130120-2303Z.tar.bz2 1899548 SHA256 b8d0cf2a9016324796c3c054cd90b7dc4efb9016bdc793dfbaafaf124a072efe SHA512 748bb6577028332e9ca51cbccefd8859dc5cee65d0824da1ba3fee5387dc89b68b8789dd9db81e00ad8307c4de5ea3d84dca97a1cf65a9d988af3fb3246328c9 WHIRLPOOL 5f0931de21a14de5ad57898a8fdd34b5ff9666958f20c7bd8e4277e58fd00c3aa3ad9d15694410e2fd784064f960f264500015e146cdf3f346ea67f7f053e67c
DIST mysql-extras-20130128-0054Z.tar.bz2 1900342 SHA256 31d6c5ba55b6640569956bb4558e9e8f63f1947e1b51d4f4537a18f5f5a88893 SHA512 dd35934c145eb7faa237f630f1d4b671a35f5fa0b6a83e60ce647c8a19acf0c974e7b86d92086151f5c11c365529214c659ed1f0b3174277d90e5b4fbe60a362 WHIRLPOOL b15be083feb3896e85d4a1f31cbcea71384a17d0c5fd413e1d95ce416603cd710c754c3f4b705846cedcb8e2de9d77e614c62fd4882b4ec1684e4343d6194e80
DIST mysql-extras-20130602-1946Z.tar.bz2 1478373 SHA256 843465190319464fdb035f4ddcf8a84ad3161780e3a81c1269c8f498b1524aab SHA512 95fc28f84618e11eeb2de22c12796eca5f8eff7b69ccc44d329d8f81aba4b015c834bad965a909f4e1e90a7f6012db98092ca21f31388ff5ab88268c8c1b60f3 WHIRLPOOL c04b1554663934969ab6b7773c96a5bd2388971dbea1eef138620014ef1e023904b5df326ff3e36538920be7bc50a2962e8f7a33435e42c1b5bdf5787ed2eb3a
DIST mysql-extras-20130626-0127Z.tar.bz2 1476503 SHA256 a3c791b7b95fe170c4071feed11699146fc8f9de6a9f2ffa67214c2e50644b4f SHA512 4ee19cb5960ba24f2db16e7c5b647d1b7bb9fadbc73bbd8125bbac7e926c569a9a585a4d1d92b851ea6653d9c15eeb00f1592880f104520dc040e5af19943ac7 WHIRLPOOL 739f5762fa24b0feb40848ddb83f2ed95fb650933920b3d9e55c5e90f907d4ac74dfb00e4b9189cda8f9af4317478f3132daf789d7c91196827f645dd3e37d61
DIST pbxt-1.0.11-6-pre-ga.tar.gz 3156307 SHA256 71ff3d86e9e5691f3efe541bf31f55a7ec2a88af27df6ad853b65902e00e6d12 SHA512 fa238303f06e0a9adfb10bd5a2e1d2e4850d2c17a350af3874cbff099d6e47b7c555d750c584d06a3ca87c1eb1e9301a9619d8d9a4cffb7fd0169b2b3a63c80c WHIRLPOOL 05cdd39f6f5dafff2def0062a00a24eff6cf6d8754f622b133365cef47cd6b828df5500ac407359d0793a75dd239ec1e49a13d2400a01ddf8b4cef7466e86962
DIST percona-xtradb-1.0.6-10.tar.gz 1676716 SHA256 e3aa818f13cf669412e59ad194eae8eada7a857bf7a4260e4bb41cab4d7ae39c SHA512 72e4b656b22a0420e6f5935dc28060e5c50fbeb48c6d1ae430579d9ccef8042fdd4dde128cc977b903de6221f7021e8c87ea29fe6a8a8c74edb84bf54ab889f3 WHIRLPOOL a916879be315498da27c60992efa4d19e91305b81242925e161547f3fb97a820256e1d07863e9e007ef843af54cd087ce5ac47d5ed1b70862da6cd5a9d81eccf

@ -0,0 +1,265 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/mysql-5.1.70.ebuild,v 1.1 2013/06/27 01:59:07 robbat2 Exp $
EAPI="4"
MY_EXTRAS_VER="20130626-0127Z"
# PBXT
PBXT_VERSION='1.0.11-6-pre-ga'
# XtraDB
PERCONA_VER='5.1.45-10' XTRADB_VER='1.0.6-10'
# Build type
BUILD="autotools"
inherit toolchain-funcs mysql-v2
# only to make repoman happy. it is really set in the eclass
IUSE="$IUSE"
# REMEMBER: also update eclass/mysql*.eclass before committing!
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd ~amd64-linux ~ppc-macos ~x64-macos ~x86-solaris"
# When MY_EXTRAS is bumped, the index should be revised to exclude these.
# This is often broken still
EPATCH_EXCLUDE=''
# Most of these are in the eclass
DEPEND="|| ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )
>=sys-devel/libtool-2.2.10"
RDEPEND="${RDEPEND}"
# Please do not add a naive src_unpack to this ebuild
# If you want to add a single patch, copy the ebuild to an overlay
# and create your own mysql-extras tarball, looking at 000_index.txt
src_prepare() {
sed -i \
-e '/^noinst_PROGRAMS/s/basic-t//g' \
"${S}"/unittest/mytap/t/Makefile.am
mysql-v2_src_prepare
}
# Official test instructions:
# USE='berkdb -cluster embedded extraengine perl ssl community' \
# FEATURES='test userpriv -usersandbox' \
# ebuild mysql-X.X.XX.ebuild \
# digest clean package
src_test() {
# Bug #213475 - MySQL _will_ object strenously if your machine is named
# localhost. Also causes weird failures.
[[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
emake check || die "make check failed"
if ! use "minimal" ; then
if [[ $UID -eq 0 ]]; then
die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
fi
has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
cd "${S}"
einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
local retstatus_unit
local retstatus_ns
local retstatus_ps
local t
addpredict /this-dir-does-not-exist/t9.MYI
# Ensure that parallel runs don't die
export MTR_BUILD_THREAD="$((${RANDOM} % 100))"
# archive_gis really sucks a lot, but it's only relevant for the
# USE=extraengines case
case ${PV} in
5.0.42)
mysql-v2_disable_test "archive_gis" "Totally broken in 5.0.42"
;;
5.0.4[3-9]|5.0.[56]*|5.0.70|5.0.87)
[ "$(tc-endian)" == "big" ] && \
mysql-v2_disable_test \
"archive_gis" \
"Broken in 5.0.43-70 and 5.0.87 on big-endian boxes only"
;;
esac
# This was a slight testcase breakage when the read_only security issue
# was fixed.
case ${PV} in
5.0.54|5.0.51*)
mysql-v2_disable_test \
"read_only" \
"Broken in 5.0.51-54, output in wrong order"
;;
esac
# Ditto to read_only
[ "${PV}" == "5.0.51a" ] && \
mysql-v2_disable_test \
"view" \
"Broken in 5.0.51, output in wrong order"
# x86-specific, OOM issue with some subselects on low memory servers
[ "${PV}" == "5.0.54" ] && \
[ "${ARCH/x86}" != "${ARCH}" ] && \
mysql-v2_disable_test \
"subselect" \
"Testcase needs tuning on x86 for oom condition"
# Broke with the YaSSL security issue that didn't affect Gentoo.
[ "${PV}" == "5.0.56" ] && \
for t in openssl_1 rpl_openssl rpl_ssl ssl \
ssl_8k_key ssl_compress ssl_connect ; do \
mysql-v2_disable_test \
"$t" \
"OpenSSL tests broken on 5.0.56"
done
# New test was broken in first time
# Upstream bug 41066
# http://bugs.mysql.com/bug.php?id=41066
[ "${PV}" == "5.0.72" ] && \
mysql-v2_disable_test \
"status2" \
"Broken in 5.0.72, new test is broken, upstream bug #41066"
# The entire 5.0 series has pre-generated SSL certificates, they have
# mostly expired now. ${S}/mysql-tests/std-data/*.pem
# The certs really SHOULD be generated for the tests, so that they are
# not expiring like this. We cannot do so ourselves as the tests look
# closely as the cert path data, and we do not have the CA key to regen
# ourselves. Alternatively, upstream should generate them with at least
# 50-year validity.
#
# Known expiry points:
# 4.1.*, 5.0.0-5.0.22, 5.1.7: Expires 2013/09/09
# 5.0.23-5.0.77, 5.1.7-5.1.22?: Expires 2009/01/27
# 5.0.78-5.0.90, 5.1.??-5.1.42: Expires 2010/01/28
#
# mysql-test/std_data/untrusted-cacert.pem is MEANT to be
# expired/invalid.
case ${PV} in
5.0.*|5.1.*|5.4.*|5.5.*)
for t in openssl_1 rpl_openssl rpl.rpl_ssl rpl.rpl_ssl1 ssl ssl_8k_key \
ssl_compress ssl_connect rpl.rpl_heartbeat_ssl ; do \
mysql-v2_disable_test \
"$t" \
"These OpenSSL tests break due to expired certificates"
done
;;
esac
# These are also failing in MySQL 5.1 for now, and are believed to be
# false positives:
#
# main.mysql_comment, main.mysql_upgrade, main.information_schema,
# funcs_1.is_columns_mysql funcs_1.is_tables_mysql funcs_1.is_triggers:
# fails due to USE=-latin1 / utf8 default
#
# main.mysql_client_test:
# segfaults at random under Portage only, suspect resource limits.
#
# main.not_partition:
# Failure reason unknown at this time, must resolve before package.mask
# removal FIXME
case ${PV} in
5.1.*|5.4.*|5.5.*)
for t in main.mysql_client_test main.mysql_comments \
main.mysql_upgrade \
main.information_schema \
main.not_partition funcs_1.is_columns_mysql \
funcs_1.is_tables_mysql funcs_1.is_triggers; do
mysql-v2_disable_test "$t" "False positives in Gentoo"
done
;;
esac
# New failures in 5.1.50/5.1.51, reported by jmbsvicetto.
# These tests are picking up a 'connect-timeout' config from somewhere,
# which is not valid, and since it does not have 'loose-' in front of
# it, it's causing a failure
case ${PV} in
5.1.5*|5.4.*|5.5.*|6*)
for t in rpl.rpl_mysql_upgrade main.log_tables_upgrade ; do
mysql-v2_disable_test "$t" \
"False positives in Gentoo: connect-timeout"
done
;;
esac
use profiling && use community \
|| mysql-v2_disable_test main.profiling \
"Profiling test needs profiling support"
if [ "${PN}" == "mariadb" ]; then
for t in \
parts.part_supported_sql_func_ndb \
parts.partition_auto_increment_ndb ; do
mysql-v2_disable_test $t "ndb not supported in mariadb"
done
fi
# This fail with XtraDB in place of normal InnoDB
# TODO: test if they are broken with the rest of the Percona patches
if xtradb_patch_available && use xtradb ; then
for t in main.innodb innodb.innodb_bug51378 \
main.information_schema_db main.mysqlshow \
main.innodb-autoinc main.innodb_bug21704 \
main.innodb_bug44369 main.innodb_bug46000 \
main.index_merge_innodb \
innodb.innodb innodb.innodb_misc1 innodb.innodb_bug52663 \
innodb.innodb-autoinc innodb.innodb-autoinc-44030 \
innodb.innodb_bug21704 innodb.innodb_bug44369 \
innodb.innodb_bug46000 innodb.innodb_bug48024 \
innodb.innodb_bug49164 innodb.innodb_bug51920 \
innodb.innodb_bug54044 \
; do
mysql-v2_disable_test $t "tests broken in xtradb"
done
fi
if ! use extraengine ; then
# bug 332565
for t in main.range ; do
mysql-v2_disable_test $t "Test $t requires USE=extraengine"
done
# bug 401673
for t in federated.federated_plugin ; do
mysql-v2_disable_test $t "Test $t requires USE=extraengine (Need federated engine)"
done
fi
# create directories because mysqladmin might make out of order
mkdir -p "${S}"/mysql-test/var-{ps,ns}{,/log}
# We run the test protocols seperately
emake test-unit
retstatus_unit=$?
[[ $retstatus_unit -eq 0 ]] || eerror "test-unit failed"
emake test-ns force="--force --vardir=${S}/mysql-test/var-ns"
retstatus_ns=$?
[[ $retstatus_ns -eq 0 ]] || eerror "test-ns failed"
has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
emake test-ps force="--force --vardir=${S}/mysql-test/var-ps"
retstatus_ps=$?
[[ $retstatus_ps -eq 0 ]] || eerror "test-ps failed"
has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
# TODO:
# When upstream enables the pr and nr testsuites, we need those as well.
# Cleanup is important for these testcases.
pkill -9 -f "${S}/ndb" 2>/dev/null
pkill -9 -f "${S}/sql" 2>/dev/null
failures=""
[[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit"
[[ $retstatus_ns -eq 0 ]] || failures="${failures} test-ns"
[[ $retstatus_ps -eq 0 ]] || failures="${failures} test-ps"
has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
[[ -z "$failures" ]] || die "Test failures: $failures"
einfo "Tests successfully completed"
else
einfo "Skipping server tests due to minimal build."
fi
}

@ -0,0 +1,98 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-java/gcj-jdk/gcj-jdk-4.7.3.ebuild,v 1.1 2013/06/27 10:52:04 tomwij Exp $
EAPI="5"
inherit java-vm-2 multilib
DESCRIPTION="Java wrappers around GCJ"
HOMEPAGE="http://www.gentoo.org/"
SRC_URI=""
LICENSE="GPL-2"
KEYWORDS="~amd64 ~arm ~ia64 ~ppc ~ppc64 ~x86 ~x86-linux"
SLOT="0"
IUSE="X"
ECJ_GCJ_SLOT="3.6"
RDEPEND="
~sys-devel/gcc-${PV}[gcj]
X? ( ~sys-devel/gcc-${PV}[gtk] )
dev-java/ecj-gcj:${ECJ_GCJ_SLOT}"
DEPEND="${RDEPEND}"
S="${WORKDIR}"
src_install() {
# jre lib paths ...
local libarch="$(get_system_arch)"
local gcc_version=${PV}
local gccbin=$(gcc-config -B ${gcc_version})
gccbin=${gccbin#"${EPREFIX}"}
local gcclib=$(gcc-config -L ${gcc_version} | cut -d':' -f1)
gcclib=${gcclib#"${EPREFIX}"}
local gcjhome="/usr/$(get_libdir)/${P}"
local gccchost="${CHOST}"
local gcjlibdir=$(echo "${EPREFIX}"/usr/$(get_libdir)/gcj-${gcc_version}-*)
gcjlibdir=${gcjlibdir#"${EPREFIX}"}
# links
dodir ${gcjhome}/bin
dodir ${gcjhome}/jre/bin
dosym ${gccbin}/gij ${gcjhome}/bin/java
dosym ${gccbin}/gij ${gcjhome}/jre/bin/java
dosym ${gccbin}/gjar ${gcjhome}/bin/jar
dosym ${gccbin}/gjdoc ${gcjhome}/bin/javadoc
dosym ${gccbin}/grmic ${gcjhome}/bin/rmic
dosym ${gccbin}/gjavah ${gcjhome}/bin/javah
dosym ${gccbin}/jcf-dump ${gcjhome}/bin/javap
dosym ${gccbin}/gappletviewer ${gcjhome}/bin/appletviewer
dosym ${gccbin}/gjarsigner ${gcjhome}/bin/jarsigner
dosym ${gccbin}/grmiregistry ${gcjhome}/bin/rmiregistry
dosym ${gccbin}/grmiregistry ${gcjhome}/jre/bin/rmiregistry
dosym ${gccbin}/gkeytool ${gcjhome}/bin/keytool
dosym ${gccbin}/gkeytool ${gcjhome}/jre/bin/keytool
dosym ${gccbin}/gnative2ascii ${gcjhome}/bin/native2ascii
dosym ${gccbin}/gorbd ${gcjhome}/bin/orbd
dosym ${gccbin}/gorbd ${gcjhome}/jre/bin/orbd
dosym ${gccbin}/grmid ${gcjhome}/bin/rmid
dosym ${gccbin}/grmid ${gcjhome}/jre/bin/rmid
dosym ${gccbin}/gserialver ${gcjhome}/bin/serialver
dosym ${gccbin}/gtnameserv ${gcjhome}/bin/tnameserv
dosym ${gccbin}/gtnameserv ${gcjhome}/jre/bin/tnameserv
dodir ${gcjhome}/jre/lib/${libarch}/client
dodir ${gcjhome}/jre/lib/${libarch}/server
dosym ${gcjlibdir}/libjvm.so ${gcjhome}/jre/lib/${libarch}/client/libjvm.so
dosym ${gcjlibdir}/libjvm.so ${gcjhome}/jre/lib/${libarch}/server/libjvm.so
use X && dosym ${gcjlibdir}/libjawt.so ${gcjhome}/jre/lib/${libarch}/libjawt.so
dosym /usr/share/gcc-data/${gccchost}/${gcc_version}/java/libgcj-${gcc_version/_/-}.jar \
${gcjhome}/jre/lib/rt.jar
dodir ${gcjhome}/lib
dosym /usr/share/gcc-data/${gccchost}/${gcc_version}/java/libgcj-tools-${gcc_version/_/-}.jar \
${gcjhome}/lib/tools.jar
dosym ${gcclib}/include ${gcjhome}
dosym /usr/bin/ecj-gcj-${ECJ_GCJ_SLOT} ${gcjhome}/bin/javac
set_java_env
}
pkg_postinst() {
# Do not set as system VM (see below)
# java-vm-2_pkg_postinst
ewarn "gcj does not currently provide all the 1.5 APIs."
ewarn "See http://builder.classpath.org/japi/libgcj-jdk15.html"
ewarn "Check for existing bugs relating to missing APIs and file"
ewarn "new ones at http://gcc.gnu.org/bugzilla/"
ewarn
ewarn "Due to this and limited manpower, we currently cannot support"
ewarn "using gcj-jdk as a system VM. Its main purpose is to bootstrap"
ewarn "IcedTea without prior binary VM installation. To do that, execute:"
ewarn
ewarn "emerge -o icedtea && emerge icedtea"
}

@ -29,9 +29,17 @@ DIST fpc-2.6.0.i386-linux.tar 44052480 SHA256 aefdd270b0032f9720495afe66000656b2
DIST fpc-2.6.0.powerpc-linux.tar 42199040 SHA256 6591475ef84693dd659cee96519b6e3ab63c30df9634b38d4efb4d2fd7896b4b SHA512 fbc9c252f4e8aeda495b0aa6921ba01242c43ff243825e55a25cc8579fd25a913ea7546f7833ae7e5684d2b60401fe55ff501385f06703490aa50cb259702ed7 WHIRLPOOL 15055086af362a394340ac8e94a6925809f4a5d3c532da36174ecfe141e81398162cbeaf39627ee3fc673604fba2283ff241582cff11ea004c7a8878f9fca1f2
DIST fpc-2.6.0.powerpc64-linux.tar 47319040 SHA256 3cc96210748d1528510e1b992be0694164ce650ce87847d13e9789a80c646992 SHA512 cfa1a23ead9591782fc62b671bec22285908d603bdfc241814073d4ed8f0485804a74c947541a84e222dffb4f03c947aa0ea189b7a4f64982c24d2e4fd1b514b WHIRLPOOL d61e20dd82135e60805d21d397d83affc570669adc34e84efde6e6abfea9c4e801e327f8adc9754873923b91927aeac192c21fad6b66a810bb1e074633e9e86f
DIST fpc-2.6.0.x86_64-linux.tar 46295040 SHA256 9da2464c53536293493ff6434ca44097fb76ef164c92675d19c7a731cb893b4d SHA512 0121ea5ec9d339dc989b59aec92cd5c28047d86b1df84a3145f3076ba654414d260d725f524d9659facf1f01f0c63dd09b72e5655ede7b3019a623088595ecf4 WHIRLPOOL cb210e521e4a05ac5d6f2faff795f5e1e9d48a02f66faeb235fe8d93cdafe6d7fc6b1a640f4a52d8467f01847fc659fe407f5d395ec0c22102299a38fef342a3
DIST fpc-2.6.2-doc-html.tar.gz 4716648 SHA256 2f30db4ad0687cfeb990bff1933aea6c644c8c49460051bafb1645863fd14005 SHA512 abefed1ac92e49d3ef18599c6d0e44c6963bda214a599f2d9c1df64c88f3bd43fc31baf1b7a032b626f4caedca225b55f99a06f1828b2da143cd07d8cd242999 WHIRLPOOL 4f4b13eb5e55aaf271be9ee93ec7ec425169940cd85d65b796c63e0b09b111ec381ae9274dcd8b671e9ff0b81f6b2abebbc99628e6791aa1682feb11d9aadf89
DIST fpc-2.6.2-fpctoc.htx.bz2 124078 SHA256 de9b948c4d3d3f41f7a4c1eb1d0a022d6a0cd2cd3860d738dc8c0183c3207e78 SHA512 98f53ec7a2ddd6403696c5b0feb8c05797b1c267593adce0e3a50132238c0b5abd2f00886f0e68f73b449e0376ef7ebbf666ba3eb9362cffbb1f0fffd6886591 WHIRLPOOL 3dc2d0d633962635a9fa74e5c6f984d658ae5a7c5254b1ff0317d94820525262d3f741dec05a8af35844e2471cfa4939bed98a7fa3fb492cb9075fb6ebbbdf50
DIST fpc-2.6.2.arm-linux.tar 32501760 SHA256 c961ea868ac2c7ea9a724a8ed5f5d4c3965e0ada61e97735e75252a50067e68e SHA512 c7f5a5b1938608cf3195549a3272c0932c08ee6601ffc516bab2cd7efd52145fbd6e03ad6664d1c876de02e89de63674cdc064dc23d228b73a621a5cd1e23220 WHIRLPOOL b0c8eacdac44615891a1fed574098a95e8616caaad4472c933b44e054d6f2237c79f66cc7e6a8f17d1d263d762ba723b94f41652b0ec0aaa0abaf9ae828dbeec
DIST fpc-2.6.2.i386-linux.tar 45905920 SHA256 d625a3dfdb248d1975a580ee01c43db3bfe05610248b2196bafddbb74579eac9 SHA512 741b01821cbc4eb1e2602bd69ccce58fac48640e06868ba29896a24376f77afe07a27ebd26a7936cc4bb813685b7151e7d64806ebe1bfce8988254a921015280 WHIRLPOOL 88ab9381c1f84f511770602f00148418e71daf6d107fbd6f341b61981809987b710f70761e0e840b40811b487389072ba53f3493f1fae7844afafd674c5b000a
DIST fpc-2.6.2.powerpc-linux.tar 44462080 SHA256 c2e7847c0a6d41820e3eb2da50122ac8fe5eade02157551f5857933d5a4e13c6 SHA512 a0894e56143115e35a00da48eb7cb11d90907b4474065b5092d2084cf5733c8d0ece74ec90f654dcf8b92e0cf016a7f5c6f48c8d02a2f85950f37a609583966a WHIRLPOOL db7b91f267d1321a49743ce682b4ed4f42699cb4b85bb15a3efbd1447e00e70fac1157ff21756bdf547528a6055221cf2296941efdb8bbdee6db6905730fcdc2
DIST fpc-2.6.2.powerpc64-linux.tar 49336320 SHA256 b4870ad23405324dd3549f03fe6d8662b9dff17eafe681046b28d63be542989e SHA512 e5a8e75302b6281ac14a1b299ee208ffa3f447e87ed3e74113f82b0e99175ebc71a4431bcef26a0fb99ca8566748c743dc69f8d7bc756889f17a7b1e1cfd267b WHIRLPOOL b4725180d5de66ccb64408552a3449a88c7a6ba47213e81411dcef4a1fc14f756d4e73ec6f10082d7572183229fd1da3f7e802b3681cfa2f1b3280ee7c914bcc
DIST fpc-2.6.2.x86_64-linux.tar 48332800 SHA256 e05aed29318c250ce3c494c3938c905c7853620da8cbc4d66ba584160690e558 SHA512 3ac22bff975197b3ecc40bd76bb66093f71253290d6eb095e1bf014cb1cdf0354cf05212516bca008d9b525f906c173c1bf2067eda9015cb3db64a42b576a512 WHIRLPOOL b52d8ba4b97c83bba051a771d1b952839440828bfabd18004ca9b03ba3f1f3763b73396940c965aeeb4944ef05f7f968658629214c0ab777b9b3841286d7d40a
DIST fpcbuild-2.2.0.tar.gz 35801603 SHA256 55c6fe8df0a09b15c1bc5cbf6c7df12ee955f86933fdf624f26fda59636d7a5f SHA512 bbc14ea79a9e16885170e47834f6c9ee27d646c483d27a99f844f7c06d80d2fa703a8f4816f97e1bd36a6f74704779109de32d6143427eb4c314cf8293f64d4a WHIRLPOOL e55e5547a6821e4817c0faf72e2c8f98a5afc62cbd3ba26ec69d2fecb33a8f3d9ef9a811c20fc9065e1b363b03aab2125d66319008d181cfb50fa7e6986a0e1d
DIST fpcbuild-2.2.2.tar.gz 39186745 SHA256 0d73b119e029382052fc6615034c4b5ee3ec66fa6cc45648f1f07cfb2c1058f1 SHA512 7869e9e50236a47503f4eaedaf5229cd7fcd13991404a314cc9b6ac297325b3016144637de3e731c89804e1dbf505a82dc6ad68e34926befaaec7eed304a9fbf WHIRLPOOL da1c218ea6e2b9e2235945d60d448ba508ec9274369a210e71910a5c180d9a5d601943c261f37b4f40f780c93ce873e476a79688913d2de3fd00334fe6ace75a
DIST fpcbuild-2.2.4.tar.gz 39849184 SHA256 77a54f09e39f07ed723071784a86d9ac8ca08fb5aa6fe41c8e9970bea395b4cf SHA512 91085c7f0e5f991726cc4a8bd8bf54e2384eb7fa0a1d96f4a329691a668c9fd977fec31e265f5cb8a904e37d61158282e11a5485657f8c6fb59d8105217b5b92 WHIRLPOOL 9f487f9ef198e20e863ee4f69092b10416c21017b81fc2a02452c1d2c7b688413c02fa507a0ccdeb3263c3b201674ff8f0a056926c623d19e11e3031eb69af28
DIST fpcbuild-2.4.0.tar.gz 41769847 SHA256 b3abbeaa0f2c3427fd447759e715cbc19b920f2ccad2b40ae5ab47e9d4124fd4 SHA512 e167426460ff68d4ead5a5ed849c1e9bd3b46c45fdf826bf47a7dade448a77b31a2486a9976ffb8c32a5c2d0d7267de019a3815fb225d8aa1bdb8afa6636a1e1 WHIRLPOOL 8fd915afcddb4596be20b1aa8e585eeaef5ad26d0864cd8955d2b5a082bce8a6b0e5bc5f262005bea1d592ec478e642feec27f201ef0cc37b7dd76a471a7c9a9
DIST fpcbuild-2.4.4.tar.gz 48018719 SHA256 ecdbc150eecc33f5734e62f1a3507421db8eba6d9074c0c5519a8fc8ffe46924 SHA512 abdb4d10ea7626ab9ec6c9489e78cf0fe561ca44aed44450cb97a34219ae3d1ddc03de103b87ce32e24149416f10452c8775dd09a13a0ec41f76568865c36e00 WHIRLPOOL 284453ba80d48ace767da4d57833860093e4ac08ac501e8848fda5f4ab2e1af858a5d08b559caf54799d3e24ad9b301fa7882e1f34f242018fa5ed1287b5b29a
DIST fpcbuild-2.6.0.tar.gz 50751193 SHA256 d788854faa373e59835d4e353133f9965993cce79c62d82e5c31837a9117beef SHA512 5139bde3490cbe4e25fb5031299412c372a29149a083180fe3828856c2fb371347f4201ec98ae4cf8b2d4c77101de843b63e27ceee644018901e156718d994cd WHIRLPOOL 3c0c9403983cfdbc97cc4b840aefbf6595c8f28a1c4759945ada7db436f939db3dfe6aa1380ef0e8cabb1051899adcc4a5c4321ec8bd64431fdfa28c0a47be87
DIST fpcbuild-2.6.2.tar.gz 55198144 SHA256 75ad700ccc772b07304c286b0aae95f48a504b15fe890a36361d17dc8e92d83c SHA512 ecc28e8c63fd6bdd6a1b02b0aca4b7ac861bd4c0e815146ab34181fff63f3f60102c227e17317efdc30d6e97b6003b708ed9853f1d21f9e5faabcc89c85a91fe WHIRLPOOL 8614adf51cb71072dc1a4ed9b79acb1943b58decfcadbefd260dfbf20b07f9cba1b5c91c3b57ea78cf89ceb4de102e7cc4d0d93c54e7101bbfa3151b80c0af26

@ -0,0 +1,161 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-lang/fpc/fpc-2.6.0-r1.ebuild,v 1.1 2013/06/26 22:47:51 hasufell Exp $
EAPI=5
HOMEPAGE="http://www.freepascal.org/"
DESCRIPTION="Free Pascal Compiler"
SRC_URI="mirror://sourceforge/freepascal/fpcbuild-${PV}.tar.gz
amd64? ( mirror://sourceforge/freepascal/${P}.x86_64-linux.tar )
arm? ( mirror://sourceforge/freepascal/${P}.arm-linux.tar )
ppc? ( mirror://sourceforge/freepascal/${P}.powerpc-linux.tar )
ppc64? ( mirror://sourceforge/freepascal/${P}.powerpc64-linux.tar )
sparc? ( mirror://sourceforge/freepascal/${PN}-2.2.4.sparc-linux.tar )
x86? ( mirror://sourceforge/freepascal/${P}.i386-linux.tar )
doc? ( mirror://sourceforge/freepascal/Documentation/${PV}/doc-html.tar.gz -> ${P}-doc-html.tar.gz
http://dev.gentoo.org/~radhermit/distfiles/${P}-fpctoc.htx.bz2 )"
SLOT="0"
LICENSE="GPL-2 LGPL-2.1-with-linking-exception"
KEYWORDS="~amd64 ~arm ~ppc ~sparc ~x86"
IUSE="doc ide source"
RDEPEND="ide? ( !dev-lang/fpc-ide )"
RESTRICT="strip" #269221
S=${WORKDIR}/fpcbuild-${PV}/fpcsrc
src_unpack() {
case ${ARCH} in
amd64) FPC_ARCH="x86_64" PV_BIN=${PV} ;;
arm) FPC_ARCH="arm" PV_BIN=${PV} ;;
ppc) FPC_ARCH="powerpc" PV_BIN=${PV} ;;
ppc64) FPC_ARCH="powerpc64" PV_BIN=${PV} ;;
sparc) FPC_ARCH="sparc" PV_BIN=2.2.4 ;;
x86) FPC_ARCH="i386" PV_BIN=${PV} ;;
*) die "This ebuild doesn't support ${ARCH}." ;;
esac
unpack ${A}
tar -xf ${P}.${FPC_ARCH}-linux/binary.${FPC_ARCH}-linux.tar || die "Unpacking binary.${FPC_ARCH}-linux.tar failed!"
tar -xzf base.${FPC_ARCH}-linux.tar.gz || die "Unpacking base.${FPC_ARCH}-linux.tar.gz failed!"
}
src_prepare() {
find "${WORKDIR}" -name Makefile -exec sed -i -e 's/ -Xs / /g' {} + || die
# let the pkg manager compress man files
sed -i '/find man.* gzip /d' "${WORKDIR}"/fpcbuild-${PV}/install/man/Makefile || die
}
set_pp() {
case ${ARCH} in
amd64) FPC_ARCH="x64" ;;
arm) FPC_ARCH="arm" ;;
ppc) FPC_ARCH="ppc" ;;
ppc64) FPC_ARCH="ppc64" ;;
sparc) FPC_ARCH="sparc" ;;
x86) FPC_ARCH="386" ;;
*) die "This ebuild doesn't support ${ARCH}." ;;
esac
case ${1} in
bootstrap) pp="${WORKDIR}"/lib/fpc/${PV_BIN}/ppc${FPC_ARCH} ;;
new) pp="${S}"/compiler/ppc${FPC_ARCH} ;;
*) die "set_pp: unknown argument: ${1}" ;;
esac
}
src_compile() {
local pp
# Using the bootstrap compiler.
set_pp bootstrap
emake -j1 PP="${pp}" compiler_cycle
# Save new compiler from cleaning...
cp "${S}"/compiler/ppc${FPC_ARCH} "${S}"/ppc${FPC_ARCH}.new || die
# ...rebuild with current version...
emake -j1 PP="${S}"/ppc${FPC_ARCH}.new compiler_cycle
# ..and clean up afterwards
rm "${S}"/ppc${FPC_ARCH}.new || die
# Using the new compiler.
set_pp new
emake -j1 PP="${pp}" rtl_clean
emake -j1 PP="${pp}" rtl packages_all utils
if use ide ; then
cd "${S}"/ide || die
emake -j1 PP="${pp}"
fi
}
src_install() {
local pp
set_pp new
set -- PP="${pp}" FPCMAKE="${S}/utils/fpcm/fpcmake" \
INSTALL_PREFIX="${D}"/usr \
INSTALL_DOCDIR="${D}"/usr/share/doc/${PF} \
INSTALL_MANDIR="${D}"/usr/share/man \
INSTALL_SOURCEDIR="${D}"/usr/lib/fpc/${PV}/source
emake -j1 "$@" compiler_install rtl_install packages_install utils_install
dosym ../lib/fpc/${PV}/ppc${FPC_ARCH} /usr/bin/ppc${FPC_ARCH}
cd "${S}"/../install/doc || die
emake -j1 "$@" installdoc
cd "${S}"/../install/man || die
emake -j1 "$@" installman
if use doc ; then
cd "${S}"/../../doc || die
dodoc -r *
newdoc "${WORKDIR}"/${P}-fpctoc.htx fpctoc.htx
docompress -x /usr/share/doc/${PF}/fpctoc.htx
fi
if use ide ; then
cd "${S}"/ide
emake -j1 "$@" install
fi
if use source ; then
cd "${S}" || die
shift
emake -j1 PP="${D}"/usr/bin/ppc${FPC_ARCH} "$@" sourceinstall
find "${D}"/usr/lib/fpc/${PV}/source -name '*.o' -exec rm {} \;
fi
"${D}"/usr/lib/fpc/${PV}/samplecfg "${D}"/usr/lib/fpc/${PV} "${D}"/etc || die
sed -i "s:${D}::g" "${D}"/etc/fpc.cfg || die
if use ide ; then
sed -e "s:${D}::g" \
-i "${D}"/etc/fppkg.cfg \
-i "${D}"/etc/fppkg/* \
-i "${D}"/usr/lib/fpc/${PV}/ide/text/fp*.cfg \
|| die
fi
rm -r "${D}"/usr/lib/fpc/lexyacc || die
}
pkg_postinst() {
if [[ -z ${REPLACING_VERSIONS} ]] && use ide; then
einfo "To read the documentation in the fpc IDE, enable the doc USE flag"
einfo "and add /usr/share/doc/${PF}/fpctoc.htx to the Help Files list."
fi
}

@ -0,0 +1,161 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-lang/fpc/fpc-2.6.2.ebuild,v 1.1 2013/06/26 22:20:08 radhermit Exp $
EAPI=5
HOMEPAGE="http://www.freepascal.org/"
DESCRIPTION="Free Pascal Compiler"
SRC_URI="mirror://sourceforge/freepascal/fpcbuild-${PV}.tar.gz
amd64? ( mirror://sourceforge/freepascal/${P}.x86_64-linux.tar )
arm? ( mirror://sourceforge/freepascal/${P}.arm-linux.tar )
ppc? ( mirror://sourceforge/freepascal/${P}.powerpc-linux.tar )
ppc64? ( mirror://sourceforge/freepascal/${P}.powerpc64-linux.tar )
sparc? ( mirror://sourceforge/freepascal/${PN}-2.2.4.sparc-linux.tar )
x86? ( mirror://sourceforge/freepascal/${P}.i386-linux.tar )
doc? ( mirror://sourceforge/freepascal/Documentation/${PV}/doc-html.tar.gz -> ${P}-doc-html.tar.gz
http://dev.gentoo.org/~radhermit/distfiles/${P}-fpctoc.htx.bz2 )"
SLOT="0"
LICENSE="GPL-2 LGPL-2.1-with-linking-exception"
KEYWORDS="~amd64 ~arm ~ppc ~sparc ~x86"
IUSE="doc ide source"
RDEPEND="ide? ( !dev-lang/fpc-ide )"
RESTRICT="strip" #269221
S=${WORKDIR}/fpcbuild-${PV}/fpcsrc
src_unpack() {
case ${ARCH} in
amd64) FPC_ARCH="x86_64" PV_BIN=${PV} ;;
arm) FPC_ARCH="arm" PV_BIN=${PV} ;;
ppc) FPC_ARCH="powerpc" PV_BIN=${PV} ;;
ppc64) FPC_ARCH="powerpc64" PV_BIN=${PV} ;;
sparc) FPC_ARCH="sparc" PV_BIN=2.2.4 ;;
x86) FPC_ARCH="i386" PV_BIN=${PV} ;;
*) die "This ebuild doesn't support ${ARCH}." ;;
esac
unpack ${A}
tar -xf ${P}.${FPC_ARCH}-linux/binary.${FPC_ARCH}-linux.tar || die "Unpacking binary.${FPC_ARCH}-linux.tar failed!"
tar -xzf base.${FPC_ARCH}-linux.tar.gz || die "Unpacking base.${FPC_ARCH}-linux.tar.gz failed!"
}
src_prepare() {
find "${WORKDIR}" -name Makefile -exec sed -i -e 's/ -Xs / /g' {} + || die
# let the pkg manager compress man files
sed -i '/find man.* gzip /d' "${WORKDIR}"/fpcbuild-${PV}/install/man/Makefile || die
}
set_pp() {
case ${ARCH} in
amd64) FPC_ARCH="x64" ;;
arm) FPC_ARCH="arm" ;;
ppc) FPC_ARCH="ppc" ;;
ppc64) FPC_ARCH="ppc64" ;;
sparc) FPC_ARCH="sparc" ;;
x86) FPC_ARCH="386" ;;
*) die "This ebuild doesn't support ${ARCH}." ;;
esac
case ${1} in
bootstrap) pp="${WORKDIR}"/lib/fpc/${PV_BIN}/ppc${FPC_ARCH} ;;
new) pp="${S}"/compiler/ppc${FPC_ARCH} ;;
*) die "set_pp: unknown argument: ${1}" ;;
esac
}
src_compile() {
local pp
# Using the bootstrap compiler.
set_pp bootstrap
emake -j1 PP="${pp}" compiler_cycle
# Save new compiler from cleaning...
cp "${S}"/compiler/ppc${FPC_ARCH} "${S}"/ppc${FPC_ARCH}.new || die
# ...rebuild with current version...
emake -j1 PP="${S}"/ppc${FPC_ARCH}.new compiler_cycle
# ..and clean up afterwards
rm "${S}"/ppc${FPC_ARCH}.new || die
# Using the new compiler.
set_pp new
emake -j1 PP="${pp}" rtl_clean
emake -j1 PP="${pp}" rtl packages_all utils
if use ide ; then
cd "${S}"/ide || die
emake -j1 PP="${pp}"
fi
}
src_install() {
local pp
set_pp new
set -- PP="${pp}" FPCMAKE="${S}/utils/fpcm/fpcmake" \
INSTALL_PREFIX="${D}"/usr \
INSTALL_DOCDIR="${D}"/usr/share/doc/${PF} \
INSTALL_MANDIR="${D}"/usr/share/man \
INSTALL_SOURCEDIR="${D}"/usr/lib/fpc/${PV}/source
emake -j1 "$@" compiler_install rtl_install packages_install utils_install
dosym ../lib/fpc/${PV}/ppc${FPC_ARCH} /usr/bin/ppc${FPC_ARCH}
cd "${S}"/../install/doc || die
emake -j1 "$@" installdoc
cd "${S}"/../install/man || die
emake -j1 "$@" installman
if use doc ; then
cd "${S}"/../../doc || die
dodoc -r *
newdoc "${WORKDIR}"/${P}-fpctoc.htx fpctoc.htx
docompress -x /usr/share/doc/${PF}/fpctoc.htx
fi
if use ide ; then
cd "${S}"/ide
emake -j1 "$@" install
fi
if use source ; then
cd "${S}" || die
shift
emake -j1 PP="${D}"/usr/bin/ppc${FPC_ARCH} "$@" sourceinstall
find "${D}"/usr/lib/fpc/${PV}/source -name '*.o' -exec rm {} \;
fi
"${D}"/usr/lib/fpc/${PV}/samplecfg "${D}"/usr/lib/fpc/${PV} "${D}"/etc || die
sed -i "s:${D}::g" "${D}"/etc/fpc.cfg || die
if use ide ; then
sed -e "s:${D}::g" \
-i "${D}"/etc/fppkg.cfg \
-i "${D}"/etc/fppkg/* \
-i "${D}"/usr/lib/fpc/${PV}/ide/text/fp*.cfg \
|| die
fi
rm -r "${D}"/usr/lib/fpc/lexyacc || die
}
pkg_postinst() {
if [[ -z ${REPLACING_VERSIONS} ]] && use ide; then
einfo "To read the documentation in the fpc IDE, enable the doc USE flag"
einfo "and add /usr/share/doc/${PF}/fpctoc.htx to the Help Files list."
fi
}

@ -1,3 +1,4 @@
DIST lazarus-0.9.26-0.tgz 12641854 SHA256 d4c2dc8e8c797049d45d0c01aff51ea94fcae489efab7d4529afb6aeca8066dd SHA512 6c2b1610e40bc55ecd69f56ebfa97304abb024d12fe38ae52a4f39937e6734aa800102c21fa460be060f867d0371c69fdcc972e30051f592b94c21d54f1f0c6e WHIRLPOOL 725fbf9612736a9a619f0fbc8f8c7508975bd41b7a8d16cbcbea7fdffbf712f65d4617e5bdccc7f6094d57c80511922a50bbe40b9ee26c30213591a453ca5301
DIST lazarus-0.9.28.2-src.tar.bz2 12933724 SHA256 5711372c6724d19624be6cb8f6c397d789f3ac6fd7f70f825817ee47bd0e4dfd SHA512 bde0ac39237d60311f0295eacf27b330fe8b0eef2b5a687a02d8a1aca9a2ad6d279aa3c2ea6ac1d67f0aca383eb17cd85f249a98d876745fe830c79db6c69a21 WHIRLPOOL 39f7ae728f05e8216ed426044d7cf67ff0c0549bce6745b1949522bd9b820f7f15f5a4876b8f3954c498abd2f0f7247a0752a2e04e1e0c2f3f1aef498f004d03
DIST lazarus-1.0.10-0.tar.gz 47688266 SHA256 61fd508c832a9c6a27e624be42257493999fe7a3b2f2ab30b9eccd4a2b4d3758 SHA512 e55100531a57de3daf931cb501ca58f57a35f1d17fe9ace1a3c6cbe995b17ecb300cf46636a6609349e81f29ecc7356dcba4c2b3ae01d23650650553650b7677 WHIRLPOOL 3c6efef7e6ddc89bc6ad7255a5d5f302c6e0825dd799b5fb73f75ec2819577825b109f73bc2e860302e0a8ffafd2fee4954455f51a5df7a5b588e5c4574eb4d3
DIST lazarus-1.0.4-1.tar.gz 46146420 SHA256 e3a52fe5a1053d12fa2c6a4c89faf5487c3184ad584324b0c640db87b5b85744 SHA512 26d17f175f71f593543f63de7dddaf5a4dc674df17657e242968280618c21e623acb446b18d49643ca872b53f3f1b81b9a09fabaced2a6f7419935121ac4f1fa WHIRLPOOL 0aa61a385ab812b4dd1b0abc7a57c95519bfc27a9c56b375af8484de299d7f6e439e5fa5504da2b7571b0def5526e960f35b6bdf2ec9efc118d534ca290c5f8c

@ -0,0 +1,73 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-lang/lazarus/lazarus-1.0.10.ebuild,v 1.1 2013/06/26 20:14:11 hasufell Exp $
EAPI=2
inherit eutils
RESTRICT="strip" #269221
FPCVER="2.6.0"
SLOT="0" # Note: Slotting Lazarus needs slotting fpc, see DEPEND.
LICENSE="GPL-2 LGPL-2.1-with-linking-exception"
KEYWORDS="~amd64 ~ppc ~x86"
DESCRIPTION="Lazarus IDE is a feature rich visual programming environment emulating Delphi."
HOMEPAGE="http://www.lazarus.freepascal.org/"
IUSE=""
SRC_URI="http://downloads.sourceforge.net/project/${PN}/Lazarus%20Zip%20_%20GZip/Lazarus%20${PV}/lazarus-1.0.10-0.tar.gz"
DEPEND=">=dev-lang/fpc-${FPCVER}[source]
net-misc/rsync
x11-libs/gtk+:2"
RDEPEND="${DEPEND}
!=gnome-base/librsvg-2.16.1"
DEPEND="${DEPEND}
>=sys-devel/binutils-2.19.1-r1"
S=${WORKDIR}/${PN}
src_prepare() {
epatch "${FILESDIR}"/${PN}-0.9.26-fpcsrc.patch
# Use default configuration (minus stripping) unless specifically requested otherwise
if ! test ${PPC_CONFIG_PATH+set} ; then
local FPCVER=$(fpc -iV)
export PPC_CONFIG_PATH="${WORKDIR}"
sed -e 's/^FPBIN=/#&/' /usr/lib/fpc/${FPCVER}/samplecfg |
sh -s /usr/lib/fpc/${FPCVER} "${PPC_CONFIG_PATH}" || die
#sed -i -e '/^-Xs/d' "${PPC_CONFIG_PATH}"/fpc.cfg || die
fi
}
src_compile() {
LCL_PLATFORM=gtk2 emake -j1 || die "make failed!"
}
src_install() {
diropts -m0755
dodir /usr/share
# Using rsync to avoid unnecessary copies and cleaning...
# Note: *.o and *.ppu are needed
rsync -a \
--exclude="CVS" --exclude=".cvsignore" \
--exclude="*.ppw" --exclude="*.ppl" \
--exclude="*.ow" --exclude="*.a"\
--exclude="*.rst" --exclude=".#*" \
--exclude="*.~*" --exclude="*.bak" \
--exclude="*.orig" --exclude="*.rej" \
--exclude=".xvpics" --exclude="*.compiled" \
--exclude="killme*" --exclude=".gdb_hist*" \
--exclude="debian" --exclude="COPYING*" \
--exclude="*.app" \
"${S}" "${D}"usr/share \
|| die "Unable to copy files!"
dosym ../share/lazarus/startlazarus /usr/bin/startlazarus
dosym ../share/lazarus/startlazarus /usr/bin/lazarus
dosym ../share/lazarus/lazbuild /usr/bin/lazbuild
dosym ../lazarus/images/ide_icon48x48.png /usr/share/pixmaps/lazarus.png
make_desktop_entry startlazarus "Lazarus IDE" "lazarus" || die "Failed making desktop entry!"
}

@ -7,4 +7,6 @@ DIST mercury-extras-11.07.2-gentoo-patchset-3.tar.gz 5320 SHA256 c6d0e12325e4bff
DIST mercury-extras-11.07.2.tar.gz 774067 SHA256 424cd1e642a49f4c463e20851ba185ce60186c7c46aed96c7f32f55e41ae482b SHA512 162358a22f020f61310c29aa61c480fee0a02aff2749a89956493bed43aafe89e92427578697eb1e8e43e73acde1d19f1b9bc85705ff448e5fa8cdaf92b749c5 WHIRLPOOL 24b7093a2ed72441aafd3a1ffa84c5b9458d5fddaedb1eb46dcb66e52cc21dc0dd5ded14067c0b0be040ae5de0a14ebf5341b5c87720390b5892a872f32e9d11
DIST mercury-extras-11.07.tar.gz 776589 SHA256 25eaf999666ceb4217cfe0f9fbcb38b892c57fb36efaa16099a471287a7a9019 SHA512 ea2c3231cbb32dc91f36d1d09a5bdac65b468bff64f79aab46baa0e7e9460f75fa5239c96b5b2a616aebb499954b62d8ac7acea93fa971df1e7d81955ca0c5ea WHIRLPOOL 9617163e15b44bf373d5e9204dd8882c4921ed56a38ec41aabd7a81eda1aebedade70e7cfa0eeb21d46349e64fc9ed565cb1eb12dd49c98b8d5dfacdb49fd229
DIST mercury-extras-13.05-gentoo-patchset-0.tar.gz 6333 SHA256 36d286a20f70e21262ac8d19004400df0a356ef7a85763027ef36f16d7de17cc SHA512 78c1391607e1a8a76c091deef112e9c4e0004fb63b9fe461c3100f2dd6ca03efe069036b081b4de8b4399052a1b10f0ef02188cc2def3d47f6aceb1b61c168c3 WHIRLPOOL 72b16b5948b2fb8048496f094e0c2343af0723f33ebbd024a7e8c0785fc949b2226f3ef78fba16a65903b1675f1280f6a3d35dab1d276203b845f140ccd3e4a7
DIST mercury-extras-13.05.1-gentoo-patchset-0.tar.gz 3423 SHA256 b15b87c86313e9a038f6ab55c9b47bc9f8eaca51aedf578a9d9e6ab1dc785d9b SHA512 51ade5a5c99fdd0417afb8c0f78c6a5c77d2161091894b62d570ad8d614f2f614e07bb07cbdf5212fd2ca8b6d67778717856a7939e506c56b1597ec05d18c6c4 WHIRLPOOL 7ed609dcde3ac5a89ddebc99365f4e13f50eddb8d6685e40fdf227842b5edfbcaf0bf6a8621696d1484970666fb303e828c5a0d4877e98fb6df6cca147b73a70
DIST mercury-srcdist-13.05.1.tar.gz 54558577 SHA256 a90de00fc5905a8421675b04dc3c9d5eda54bedaf8b2ebcefae4de551fbcfd2c SHA512 784069af3ba470e9618e5b7917873e8ad7f4e9dc27eb54afa74eb6d6e659dcfab7007ae93163937412f9eb1b997a327d4378dcd868810c08880d4fa4542dfade WHIRLPOOL ec7281a6e01523b296dcfce595189cb96ad693c9b36ab60cbc6b61672333f5c8d7d9def10cc3c5bba876fddf0eefea3e9c22c1b98ee577d1b6d6aab6d1267915
DIST mercury-srcdist-13.05.tar.gz 54533409 SHA256 71f1f97484eaecf2c2f91f6731e23afc5cee966e149b61a7525b2bd9a2712d55 SHA512 d76fd3a0c487b2c65168b19ec6a5ea6b792c96692e029afe0589f93132422fc39e0aec856ae02e676cc30dc83780f9c4d4e0ea5f71681442279b900146b58c47 WHIRLPOOL b2cc0f1b074d980701c6d364f30f8bb2dd2556cbc23dca5a982b7c16b71c6834d7c81ea76bfcea25e369f32d606698b77eea168e3b25d4850f924dfa4f6929f4

@ -0,0 +1,194 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-lang/mercury-extras/mercury-extras-13.05.1.ebuild,v 1.1 2013/06/27 13:22:10 keri Exp $
EAPI=2
inherit eutils multilib
PATCHSET_VER="0"
MY_P=mercury-srcdist-${PV}
DESCRIPTION="Additional libraries and tools that are not part of the Mercury standard library"
HOMEPAGE="http://www.mercurylang.org/index.html"
SRC_URI="http://dl.mercurylang.org/release/${MY_P}.tar.gz
mirror://gentoo/${P}-gentoo-patchset-${PATCHSET_VER}.tar.gz"
LICENSE="GPL-2 LGPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="X cairo examples glut iodbc ncurses odbc opengl ssl tcl tk xml"
RDEPEND="~dev-lang/mercury-${PV}
cairo? ( >=x11-libs/cairo-1.10.0 )
glut? ( media-libs/freeglut )
odbc? ( dev-db/unixODBC )
iodbc? ( !odbc? ( dev-db/libiodbc ) )
ncurses? ( sys-libs/ncurses )
opengl? ( virtual/opengl )
tcl? ( tk? (
dev-lang/tcl
dev-lang/tk
x11-libs/libX11
x11-libs/libXmu ) )"
DEPEND="${RDEPEND}"
S="${WORKDIR}"/${MY_P}/extras
src_prepare() {
cd "${WORKDIR}"
EPATCH_FORCE=yes
EPATCH_SUFFIX=patch
epatch "${WORKDIR}"/${PV}
if use odbc; then
epatch "${WORKDIR}"/${PV}-odbc/${P}-odbc.patch
elif use iodbc; then
epatch "${WORKDIR}"/${PV}-odbc/${P}-iodbc.patch
fi
cd "${S}"
sed -i -e "s:references:references solver_types/library:" \
-e "s:windows_installer_generator::" \
Mmakefile || die "sed default packages failed"
if use cairo; then
sed -i -e "s:lex[ \t]*\\\\:graphics/mercury_cairo lex \\\\:" Mmakefile \
|| die "sed cairo failed"
fi
if use glut; then
sed -i -e "s:lex[ \t]*\\\\:graphics/mercury_glut lex \\\\:" Mmakefile \
|| die "sed glut failed"
fi
if use opengl; then
sed -i -e "s:lex[ \t]*\\\\:graphics/mercury_opengl lex \\\\:" Mmakefile \
|| die "sed opengl failed"
fi
if use tcl && use tk; then
sed -i -e "s:lex[ \t]*\\\\:graphics/mercury_tcltk lex \\\\:" Mmakefile \
|| die "sed tcltk failed"
fi
if use odbc || use iodbc; then
sed -i -e "s:moose:moose odbc:" Mmakefile \
|| die "sed odbc failed"
fi
if use ncurses; then
sed -i -e "s:complex_numbers:complex_numbers curs curses:" Mmakefile \
|| die "sed ncurses failed"
fi
if ! use xml; then
sed -i -e "s:xml::" Mmakefile \
|| die "sed xml failed"
fi
sed -i -e "s:@libdir@:$(get_libdir):" \
dynamic_linking/Mmakefile \
|| die "sed libdir failed"
# disable broken packages
sed -i -e "s:references::" Mmakefile \
|| die "sed broken packages failed"
}
src_compile() {
# Mercury dependency generation must be run single-threaded
mmake \
-j1 depend || die "mmake depend failed"
# Compiling Mercury submodules is not thread-safe
mmake -j1 \
EXTRA_MLFLAGS=--no-strip \
EXTRA_LDFLAGS="${LDFLAGS}" \
EXTRA_LD_LIBFLAGS="${LDFLAGS}" \
|| die "mmake failed"
}
src_install() {
# Compiling Mercury submodules is not thread-safe
mmake -j1 \
EXTRA_LD_LIBFLAGS="${LDFLAGS}" \
INSTALL_PREFIX="${D}"/usr \
install || die "mmake install failed"
find "${D}"/usr/$(get_libdir)/mercury -type l | xargs rm
cd "${S}"
if use examples; then
insinto /usr/share/doc/${PF}/samples/base64
doins base64/*.m || die
insinto /usr/share/doc/${PF}/samples/complex_numbers
doins complex_numbers/samples/* || die
insinto /usr/share/doc/${PF}/samples/dynamic_linking
doins dynamic_linking/hello.m || die
insinto /usr/share/doc/${PF}/samples/error
doins error/* || die
insinto /usr/share/doc/${PF}/samples/fixed
doins fixed/*.m || die
insinto /usr/share/doc/${PF}/samples/gator
doins -r gator/* || die
insinto /usr/share/doc/${PF}/samples/lex
doins lex/samples/* || die
insinto /usr/share/doc/${PF}/samples/log4m
doins log4m/*.m || die
insinto /usr/share/doc/${PF}/samples/monte
doins monte/*.m || die
insinto /usr/share/doc/${PF}/samples/moose
doins moose/samples/* || die
insinto /usr/share/doc/${PF}/samples/net
doins net/*.m || die
if use ncurses; then
insinto /usr/share/doc/${PF}/samples/curs
doins curs/samples/* || die
insinto /usr/share/doc/${PF}/samples/curses
doins curses/sample/* || die
fi
if use X; then
insinto /usr/share/doc/${PF}/samples/graphics
doins graphics/easyx/samples/*.m || die
fi
if use glut && use opengl; then
insinto /usr/share/doc/${PF}/samples/graphics
doins graphics/samples/calc/* || die
doins graphics/samples/gears/* || die
doins graphics/samples/maze/* || die
doins graphics/samples/pent/* || die
fi
if use opengl && use tcl && use tk; then
insinto /usr/share/doc/${PF}/samples/graphics
doins graphics/samples/pent/*.m || die
fi
if use ssl; then
insinto /usr/share/doc/${PF}/samples/mopenssl
doins mopenssl/*.m || die
fi
rm -rf $(find "${D}"/usr/share/doc/${PF}/samples -name CVS)
fi
dodoc README || die
}

@ -3,10 +3,12 @@ DIST mercury-11.07-gentoo-patchset-0.tar.gz 6889 SHA256 2fce2c95b6cb8b5819fb576d
DIST mercury-11.07.1-gentoo-patchset-4.tar.gz 7336 SHA256 477cde26b06650b96accdc32da4bb7edb382b8ad8a2ed3908a985d895070ad4a SHA512 1ae54d05cac374ac02f7368b19ba98567d7c513d471fc98e27f0d794137ff920d42acf7105e6652e6610b4ffec74c3f5b282e81668735a626f8d762d8192d1c4 WHIRLPOOL 529f6e4675b0437dffa83f6cdc5daf4d8c7e9a59e81dc0f6c54cc35be7255fca0ddb6afca4257bc960ded245b50b80cbeaf80c9d2b589fc92564845884f218c5
DIST mercury-11.07.2-gentoo-patchset-0.tar.gz 7265 SHA256 d400e40ae62c5cb8e777c2409d70eee7f71f231733a95fd6549f82c6c2933500 SHA512 110e0aacd1ef274d9c7154b359267ec0277e680fe2bb9ec4942dfc167c4f02dfef85fbd205120875e485f1b186432157814891ea9f1d0d55f0cdf236b0a80257 WHIRLPOOL 9002362cc04943558399dc4350a9368d12ce6d9717afe42e7c150ad55c8b2fe326697bdea6e457c1b3611d448ecdf7b171219e23a123aec2d0e70f14ab443afa
DIST mercury-13.05-gentoo-patchset-0.tar.gz 5947 SHA256 8af2076b571215e403079fab840bf4a769ff67ec1ebfdf7b92bf203a503acb99 SHA512 0662126b9802fe9cd6156b204dc28b4e02a7d55fc5f88e97717c7aeb764014ed537822c5a2d2a5520a6b78c092d2fe25b603f05e1e6d19821b7b2905aad53d0c WHIRLPOOL 56a10ac2503fe87099f29294d44a58902192c18a95d438908fbb31969050289ecd8461fc3188368309d1693bd89e1380c140e58d165d02bf5d8f10e4ccbf30e5
DIST mercury-13.05.1-gentoo-patchset-0.tar.gz 6013 SHA256 d9cfe7017f234d361f51e0dad1a0f6cdcbf82bf841c312660ffd76d6cdada71a SHA512 8f0a8cd4bf814c8d6903843b4e264da4708cf352439116766a63d5d68ef1043543d53b5729f38e5fef0272c006913b3e6c839c37f1e3486fc6f8d382b280aaee WHIRLPOOL a89cf3170498af1f3ffbd5d56db216932f9c96109b4f2c1c267b51e3f81f1f9e0fe7e755a8d86e8a0cc7eb6c4487918ea2ae9738377a7dd4d369f328b3f7d208
DIST mercury-compiler-11.01.tar.gz 25122699 SHA256 2d12dc9bfaed46b1b30689b0592177bc871b21cf8852c8326c86371258bb18b0 SHA512 628eb95cc647a3334ed6cc9cdb19256dece544cac34600db2a495815215b494db74b1f196e3c48ba1cbb37b51404158d5a583caa20fd3e53488111927615b666 WHIRLPOOL 6720586514dfa954e8e777986d7b62fd2fb10ce1a309034bdc4e40431762c834cba98e93b129e69ba5a78451cd0f776fe916bce2b15996d1621cab59215481a6
DIST mercury-compiler-11.07.1.tar.gz 25308185 SHA256 f3f1d4f0fb34567a69aaa9fb6f4ecff52b97a66ab6c8a868c4e284eb61d3dc11 SHA512 c102a1f2c2ed4384919685e3e11ba3b7da0152f6fe8899c2124e9bbb056ab81a5e2fc1dbb07934ca011ed96e7c6af168308c64eb4901db7d247fffd2ff226c4f WHIRLPOOL 6df5a68a9c0adc6d5ae490bd909951d8330db2c4e0bb704ab9be0fe8cdf7177093cd0943256fcbea8d666793d3d53c20b8c703deca43121114d89f1a508f32d5
DIST mercury-compiler-11.07.2.tar.gz 25311504 SHA256 8afee5732d6d52343fbba8d6b9dd3f87b819673743a408a564eede17956ea659 SHA512 144f496cdfbdb88e15a18b3c295d326ebb1054055c42cb1a5fd634b79797c8dbd46ef5d1731f4c4cb1add02795e9b7d1d72e0426c39e672e208f10068e65df8b WHIRLPOOL a443bad02d714737aa2e1875205915db78bc776cf75f01f98e99efab992a5a542c86772615e9a4066b1143977e354441f07a033ef81a2d8f464226004f5de198
DIST mercury-compiler-11.07.tar.gz 25298643 SHA256 77940d03834a3967e4505c4a92253c19aaea0fed4650ee94e772078abd6be6a2 SHA512 671bebb67ceca8af0844c2ba0d9db538564d3b324a913141be29c7632adb7a343b93fe771533173d5460ac34d5a69fd18b3ef7f55b26c0d0ee70b7cc2e35f10d WHIRLPOOL 992f5f52292066b775b264401f25b5e8ef246ced9b79c0ec06701f715e22e068ad81a17dea49f62bd72bc9cc0539b2ef7beb9be1401391209e2ab1e3876d0bfc
DIST mercury-srcdist-13.05.1.tar.gz 54558577 SHA256 a90de00fc5905a8421675b04dc3c9d5eda54bedaf8b2ebcefae4de551fbcfd2c SHA512 784069af3ba470e9618e5b7917873e8ad7f4e9dc27eb54afa74eb6d6e659dcfab7007ae93163937412f9eb1b997a327d4378dcd868810c08880d4fa4542dfade WHIRLPOOL ec7281a6e01523b296dcfce595189cb96ad693c9b36ab60cbc6b61672333f5c8d7d9def10cc3c5bba876fddf0eefea3e9c22c1b98ee577d1b6d6aab6d1267915
DIST mercury-srcdist-13.05.tar.gz 54533409 SHA256 71f1f97484eaecf2c2f91f6731e23afc5cee966e149b61a7525b2bd9a2712d55 SHA512 d76fd3a0c487b2c65168b19ec6a5ea6b792c96692e029afe0589f93132422fc39e0aec856ae02e676cc30dc83780f9c4d4e0ea5f71681442279b900146b58c47 WHIRLPOOL b2cc0f1b074d980701c6d364f30f8bb2dd2556cbc23dca5a982b7c16b71c6834d7c81ea76bfcea25e369f32d606698b77eea168e3b25d4850f924dfa4f6929f4
DIST mercury-tests-11.01.tar.gz 1351134 SHA256 862b70a589eb2d36c9fd82dbd2e0490dc4556f6edff604a54dfd6fc0ad6cccad SHA512 7cd0c2a5f3ef2b05ea32ea8867f788c583a9da96b6e3b4ed9c2ec5705fc7384c0811da782ed50b6d7f60963680036e116684b5bcc3f5f72cf6f0b319480ad997 WHIRLPOOL 298a898b970da20f64530cf736b5f901cc61ef028117f2434135b9efc77223e120a71e97373d494cdb89b422ef9bbf02ef51db4be3c383ffd6facaabb2018c6a
DIST mercury-tests-11.07.1.tar.gz 1648437 SHA256 01558a6ddd28d2f832d88da8bbf38fec542d091fc53b5adf92fac5e2564c2057 SHA512 1b8f3749091e6a3cd8d3f07ca7ff87c20d9c90761c6dbf35253f68f4cb4ccb42310d66ebc98742508a4e1f6fb4d6497e7e34f10b2601ffec73694702f1b363b5 WHIRLPOOL 66cd530de280d34a037cc191818abb6f11bf4ea8f6f3143629883ff2d885350bdd8841215b6076d5b6ea2102d6ef913a9324d997fd287af12eed0cbe708692b2

@ -0,0 +1,197 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-lang/mercury/mercury-13.05.1.ebuild,v 1.1 2013/06/27 13:19:07 keri Exp $
EAPI=2
inherit autotools elisp-common eutils flag-o-matic java-pkg-opt-2 multilib
PATCHSET_VER="0"
MY_P=${PN}-srcdist-${PV}
DESCRIPTION="Mercury is a modern general-purpose logic/functional programming language"
HOMEPAGE="http://www.mercurylang.org/index.html"
SRC_URI="http://dl.mercurylang.org/release/${MY_P}.tar.gz
mirror://gentoo/${P}-gentoo-patchset-${PATCHSET_VER}.tar.gz"
LICENSE="GPL-2 LGPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="debug emacs erlang examples java minimal readline threads"
DEPEND="!dev-libs/mpatrol
!dev-util/mono-debugger
readline? ( sys-libs/readline )
erlang? ( dev-lang/erlang )
java? ( >=virtual/jdk-1.5 )"
RDEPEND="${DEPEND}
emacs? ( virtual/emacs )"
S="${WORKDIR}"/${MY_P}
SITEFILE=50${PN}-gentoo.el
src_prepare() {
cd "${WORKDIR}"
EPATCH_FORCE=yes
EPATCH_SUFFIX=patch
epatch "${WORKDIR}"/${PV}
sed -i -e "s/@libdir@/$(get_libdir)/" \
"${S}"/scripts/Mmake.vars.in \
|| die "sed libdir failed"
cd "${S}"
eautoconf
}
src_configure() {
strip-flags
local myconf
myconf="--libdir=/usr/$(get_libdir) \
--disable-deep-profiler \
--disable-dotnet-grades \
--without-hwloc \
$(use_enable erlang erlang-grade) \
$(use_enable java java-grade) \
$(use_enable debug debug-grades) \
$(use_enable threads par-grades) \
$(use_enable !minimal most-grades) \
$(use_with readline)"
econf ${myconf}
}
src_compile() {
# Build Mercury using base llds grade
emake \
PARALLEL=${MAKEOPTS} \
MMAKEFLAGS="EXTRA_MLFLAGS=--no-strip \
EXTRA_LDFLAGS='${LDFLAGS}' \
EXTRA_LD_LIBFLAGS='${LDFLAGS}'" \
|| die "emake failed"
# We can now patch .m Mercury compiler files since we
# have just built mercury_compiler.
EPATCH_FORCE=yes
EPATCH_SUFFIX=patch
epatch "${WORKDIR}"/${PV}-mmc
sed -i -e "s/@libdir@/$(get_libdir)/" \
"${S}"/compiler/file_util.m \
"${S}"/compiler/make.program_target.m \
|| die "sed libdir failed"
# Rebuild Mercury compiler using the just built mercury_compiler
emake \
PARALLEL=${MAKEOPTS} \
MMAKEFLAGS="EXTRA_MLFLAGS=--no-strip \
EXTRA_LDFLAGS='${LDFLAGS}' \
EXTRA_LD_LIBFLAGS='${LDFLAGS}'" \
MERCURY_COMPILER="${S}"/compiler/mercury_compile \
compiler || die "emake compiler failed"
# The default Mercury grade may not be the same as the grade used to
# compile the llds base grade. Since src_test() is run before
# src_install() we compile the default grade now
emake \
PARALLEL=${MAKEOPTS} \
MMAKEFLAGS="EXTRA_MLFLAGS=--no-strip \
EXTRA_LDFLAGS='${LDFLAGS}' \
EXTRA_LD_LIBFLAGS='${LDFLAGS}'" \
MERCURY_COMPILER="${S}"/compiler/mercury_compile \
default_grade || die "emake default_grade failed"
}
src_test() {
TEST_GRADE=`scripts/ml --print-grade`
if [ -d "${S}"/install_grade_dir.${TEST_GRADE} ] ; then
TWS="${S}"/install_grade_dir.${TEST_GRADE}
cp runtime/mer_rt.init "${TWS}"/runtime/
cp mdbcomp/mer_mdbcomp.init "${TWS}"/mdbcomp/
cp browser/mer_browser.init "${TWS}"/browser/
else
TWS="${S}"
fi
cd "${S}"/tests
sed -e "s:@WORKSPACE@:${TWS}:" < WS_FLAGS.ws > WS_FLAGS \
|| die "sed WORKSPACE failed"
# Mercury tests must be run in C locale since Mercury output is
# compared to hard-coded warnings/errors
LC_ALL="C" \
PATH="${TWS}"/scripts:"${TWS}"/util:"${S}"/slice:"${PATH}" \
TERM="" \
WORKSPACE="${TWS}" \
WORKSPACE_FLAGS=yes \
MERCURY_COMPILER="${TWS}"/compiler/mercury_compile \
MMAKE_DIR="${TWS}"/scripts \
MERCURY_SUPPRESS_STACK_TRACE=yes \
GRADE=${TEST_GRADE} \
MERCURY_ALL_LOCAL_C_INCL_DIRS=" -I${TWS}/boehm_gc/include \
-I${TWS}/runtime \
-I${TWS}/library" \
mmake || die "mmake test failed"
}
src_install() {
emake \
PARALLEL=${MAKEOPTS} \
MMAKEFLAGS="EXTRA_LDFLAGS='${LDFLAGS}' \
EXTRA_LD_LIBFLAGS='${LDFLAGS}'" \
MERCURY_COMPILER="${S}"/compiler/mercury_compile \
INSTALL_PREFIX="${D}"/usr \
INSTALL_MAN_DIR="${D}"/usr/share/man \
INSTALL_INFO_DIR="${D}"/usr/share/info \
INSTALL_HTML_DIR="${D}"/usr/share/doc/${PF}/html \
INSTALL_ELISP_DIR="${D}/${SITELISP}"/${PN} \
install || die "emake install failed"
if use emacs; then
elisp-site-file-install "${FILESDIR}/${SITEFILE}" \
|| die "elisp-site-file-install failed"
fi
dodoc \
BUGS HISTORY LIMITATIONS NEWS README README.Linux \
README.Linux-Alpha README.Linux-m68k README.Linux-PPC \
RELEASE_NOTES TODO VERSION WORK_IN_PROGRESS || die
if use erlang; then
dodoc README.Erlang || die
fi
if use java; then
dodoc README.Java || die
fi
if use examples; then
insinto /usr/share/doc/${PF}/samples
doins samples/{*.m,README,Mmakefile} || die
doins -r samples/c_interface \
samples/diff \
samples/muz \
samples/rot13 \
samples/solutions \
samples/solver_types || die
if use java; then
doins -r samples/java_interface || die
fi
rm -rf $(find "${D}"/usr/share/doc/${PF}/samples \
-name CVS -o -name .cvsignore)
fi
}
pkg_postinst() {
use emacs && elisp-site-regen
}
pkg_postrm() {
use emacs && elisp-site-regen
}

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-libs/MicroJSON/MicroJSON-0.3.1.ebuild,v 1.1 2013/05/20 14:34:36 tomwij Exp $
# $Header: /var/cvsroot/gentoo-x86/dev-libs/MicroJSON/MicroJSON-0.3.1.ebuild,v 1.3 2013/06/27 13:49:29 pinkbyte Exp $
EAPI="5"
@ -11,7 +11,7 @@ HOMEPAGE="http://grigory.info/${PN}.About.html"
SRC_URI="http://grigory.info/distfiles/${P}.tar.bz2"
LICENSE="GPL-3"
KEYWORDS="~amd64 ~x86"
KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
SLOT="0"
RDEPEND=">=dev-libs/UTF8Strings-1.12.0"

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-libs/UTF8Strings/UTF8Strings-1.14.0.ebuild,v 1.1 2013/05/21 16:37:23 tomwij Exp $
# $Header: /var/cvsroot/gentoo-x86/dev-libs/UTF8Strings/UTF8Strings-1.14.0.ebuild,v 1.2 2013/06/27 13:48:47 pinkbyte Exp $
EAPI="5"
@ -11,5 +11,5 @@ HOMEPAGE="http://grigory.info/${PN}.About.html"
SRC_URI="http://grigory.info/distfiles/${P}.tar.bz2"
LICENSE="GPL-3"
KEYWORDS="~amd64 ~x86"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
SLOT="0"

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-perl/Class-Inspector/Class-Inspector-1.280.0.ebuild,v 1.2 2013/01/13 13:47:38 maekke Exp $
# $Header: /var/cvsroot/gentoo-x86/dev-perl/Class-Inspector/Class-Inspector-1.280.0.ebuild,v 1.4 2013/06/27 11:35:48 pinkbyte Exp $
EAPI=4
@ -11,7 +11,7 @@ inherit perl-module
DESCRIPTION="Provides information about Classes"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~x86-solaris"
KEYWORDS="~alpha amd64 arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~x86-solaris"
IUSE=""
SRC_TEST="do"

@ -1,19 +0,0 @@
Avoid un-needed objects.inv files drom d'loading for docs build
diff -ur Flask-0.9.orig/docs/conf.py Flask-0.9/docs/conf.py
--- docs/conf.py 2012-07-01 19:10:19.000000000 +0800
+++ docs/conf.py 2013-06-09 00:21:57.757485401 +0800
@@ -243,14 +243,6 @@
# The depth of the table of contents in toc.ncx.
#epub_tocdepth = 3
-intersphinx_mapping = {
- 'http://docs.python.org/dev': None,
- 'http://werkzeug.pocoo.org/docs/': None,
- 'http://www.sqlalchemy.org/docs/': None,
- 'http://wtforms.simplecodes.com/docs/0.5/': None,
- 'http://discorporate.us/projects/Blinker/docs/1.1/': None
-}
-
pygments_style = 'flask_theme_support.FlaskyStyle'
# fall back if theme is not there

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/flask/flask-0.10.1.ebuild,v 1.1 2013/06/16 22:52:40 radhermit Exp $
# $Header: /var/cvsroot/gentoo-x86/dev-python/flask/flask-0.10.1.ebuild,v 1.2 2013/06/27 01:56:37 floppym Exp $
EAPI="5"
PYTHON_COMPAT=( python{2_6,2_7,3_3} )
@ -20,7 +20,7 @@ IUSE="examples test"
RDEPEND="dev-python/blinker[${PYTHON_USEDEP}]
>=dev-python/itsdangerous-0.21[${PYTHON_USEDEP}]
>=dev-python/jinja-2.4[$(python_gen_usedep python{2_6,2_7} 'pypy*')]
>=dev-python/jinja-2.4[${PYTHON_USEDEP}]
dev-python/setuptools[${PYTHON_USEDEP}]
>=dev-python/werkzeug-0.7[${PYTHON_USEDEP}]"
DEPEND="${RDEPEND}"

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/flask/flask-9999.ebuild,v 1.5 2013/06/16 22:52:40 radhermit Exp $
# $Header: /var/cvsroot/gentoo-x86/dev-python/flask/flask-9999.ebuild,v 1.6 2013/06/27 02:24:57 floppym Exp $
EAPI="5"
PYTHON_COMPAT=( python{2_6,2_7,3_3} )
@ -25,7 +25,7 @@ IUSE="examples test"
RDEPEND="dev-python/blinker[${PYTHON_USEDEP}]
>=dev-python/itsdangerous-0.21[${PYTHON_USEDEP}]
>=dev-python/jinja-2.4[$(python_gen_usedep python{2_6,2_7} 'pypy*')]
>=dev-python/jinja-2.4[${PYTHON_USEDEP}]
dev-python/setuptools[${PYTHON_USEDEP}]
>=dev-python/werkzeug-0.7[${PYTHON_USEDEP}]"
DEPEND="${RDEPEND}"

@ -0,0 +1 @@
DIST google-api-python-client-1.1.tar.gz 71178 SHA256 bc88cae1c40446f22d58923fc5a8dbac77da29d6efbe4ae2276cc2f30f724617 SHA512 750c482e90f83d0b2d53f7d655db9a476686158b5e380cab7a5e92af1b521b26871dcda08a2ee946cd09035f65ca50ad8dcffa8f766d3671fceae009fbdb831e WHIRLPOOL 62d2ebb7f51f58c76b45f748fe79b031cda5f11fd6088d8ea947e7ab9b9b754688e004773f99169cc65fdd2789002faa486bed7717fc07dea0b25994cbede0da

@ -0,0 +1,25 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/google-api-python-client/google-api-python-client-1.1.ebuild,v 1.1 2013/06/27 03:12:32 robbat2 Exp $
EAPI=5
PYTHON_COMPAT=( python{2_6,2_7} pypy{1_9,2_0} )
inherit distutils-r1
DESCRIPTION="Google API Client for Python"
HOMEPAGE="http://code.google.com/p/google-api-python-client/"
SRC_URI="https://google-api-python-client.googlecode.com/files/${P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
DEPEND="dev-python/python-gflags
>=dev-python/httplib2-0.8
dev-python/simplejson
dev-python/setuptools[${PYTHON_USEDEP}]"
RDEPEND="${DEPEND}"

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer>
<email>robbat2@gentoo.org</email>
<name>Robin H. Johnson</name>
</maintainer>
</pkgmetadata>

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/itsdangerous/itsdangerous-0.21.ebuild,v 1.1 2013/06/14 03:17:21 rafaelmartins Exp $
# $Header: /var/cvsroot/gentoo-x86/dev-python/itsdangerous/itsdangerous-0.21.ebuild,v 1.2 2013/06/27 02:13:22 floppym Exp $
EAPI="5"
PYTHON_COMPAT=( python{2_6,2_7,3_3} pypy{1_9,2_0} )
@ -17,4 +17,4 @@ KEYWORDS="~amd64 ~x86"
IUSE=""
RDEPEND=""
DEPEND="${RDEPEND}"
DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"

@ -2,8 +2,6 @@ DIST python-ldap-2.3.13.tar.gz 112397 SHA256 417ae3f6e2f680461611dc60c95ac9fcb3c
DIST python-ldap-2.3.9.tar.gz 108209 SHA256 62f75b21c5ee744408c9d8b59878328b3bdf47899d30e8abf0c09b3ffb893ed4 SHA512 7470c476c44b0a8ae1498fddac5f0c6ba64bd305742df578ad204f21348dbcec61624b9da15d32c14c9120a2104137d37727e9df5ebf74e380ab607c496bbbe7 WHIRLPOOL dd7502911349e3ab31ef9f7e67616aee0fff1aae2e2527f2597ec79a65190768397b1fd688eaa5b32502f944f8d3f162333d8b5d97d9b47cee8754d1fabfb735
DIST python-ldap-2.4.10.tar.gz 134153 SHA256 67cc7801bf24c29386ab99966ceb68d6a60fa9e0566cc95a4fbb2c4695a8ce54 SHA512 9f59c87acec4cc8f958c7dbea0ca82aa30f46ef7ff44c5cc424bbc37ccb7a15bf669262ad96e209cdbe4da21e33f46aa85fea736ae76363adb98de915ecac380 WHIRLPOOL c28772aad5d2cfdefc8a6dc9dfe5a29259bdd219038e6e71d2ff35580254e6cb434e5ba485be5eddbc74490012d0046d45ff1d16e222e079b6efabb6f4bcca85
DIST python-ldap-2.4.12.tar.gz 135395 SHA256 8587f8007c603b09ea6aa72fd63f1619b8a0d7f97e81ce955a44e8f84c7c9088 SHA512 9cd5f35d374e1cdd6b01473e978a90478416dec46c566f3a347c44839b54f8a2aa255504acbc88a73e1ad0ac836445546830f28764542b10a6255f890052598e WHIRLPOOL 90bfe55e3ba91cf3bca7e4bf6812d5944a3a311b0652306a836bc2d26bc37882f481775ae713ea540165bcad73e6fe3d5c4634b2b4800e6f3289aea8f72b7681
DIST python-ldap-2.4.3.tar.gz 125989 SHA256 88fb00ed5811e3df49d0f28317a48be2ae7e46252e473923005c7eb292d25e9d SHA512 30addd6e0985a0962cb254643411c666430f0fb6353a33bf7cdfaabd0e86076871da1ac3269c4dd7373cbe5dd3a658652307895ec61ab9891593004b4d6edadd WHIRLPOOL ba1c65152d1dd6e8e64de1326b59a970829cb338e9f6b2c7f44345e96f7fed28ef5e515c75512f82d56431f2e79d63a22b6abe530ef61b3324f74aa39b91638b
DIST python-ldap-2.4.9.tar.gz 133453 SHA256 247c29f30faf016f0d1dbe702a5026a4633dfa9b8b90c7ef46de68a58424ee8b SHA512 ad32baed734e232d77994cdf01c6d263409b66a7cae5ff6cea3b1852c1999617e32643f06119d39b299b7c5f54f8a2a03c55a5a7dcc31cad6f4cdcdcba63ec26 WHIRLPOOL b011a5303437df6422047b525718c7b4bcf19c6a83cb956dcdc86bb333108f24cd1fa9b228b5349a9c389c68551bf39891e5f6427cad86036c08ff818ff2173e
DIST python-ldap-2.4.13.tar.gz 135550 SHA256 96853b9bbdacb341d6a3d60fdc89f8cb8acef47970ce8492ee3cbe975b9c7dbf SHA512 c77c487b48fa63b9bb9926fca0082834f6a2c6c7e9be89849e59b45a9e7c18146e4a7a982fe0a0504659ba680c39823eea29f349842a9f8df36acf8f10bab975 WHIRLPOOL 0c70cff4f7c41b514befb517fbe89e39bc426bd0fa0b7164781c82d14a99213d6da5d89bba371cdfd5c373d4152cee2f19c19f3e4e65d3aff8e79bcbb41320ae
DIST python-ldap-docs-html-2.3.13.tar.gz 118531 SHA256 8ea9eee3135db006489268733e49ab1e80906ca2bc9e7960f19e548506ce08a4 SHA512 d4edca6b627b4c9449f1ddbda41ae793664924a41b05046b005909002a23cf8e830ab7178cc1173a373f6675e1e97af0e24232baf837ec9fa859888c8c4568f6 WHIRLPOOL f9117dc1bab2368b2976f97437bd03fba3870c5503492e73f1ef9cba4407cf777dbd91dea54f835d8ea4d01e592bb21c59ea7a52b9b8fb4d688915d37163e55e
DIST python-ldap-docs-html-2.3.9.tar.gz 116913 SHA256 de8b4d91e1a35702d993f7d744fcc5a3e7cbf5be543d2d127791cda9df361124 SHA512 fe3259fbbc2620d88912e12d3d7c36776a9f2bc62bdfb704b1ff9671240badaf95bf28e5b93fcf738964f321c02c81f45deb6bb1f49d6d035a0b9990ee9d9279 WHIRLPOOL d85ebb31948c1b5baf7fd49340f1b9239a74c446ebf997e5800c5df7e4db0053ed5df356ea8697adf247b2b5fc34bf5fc92d3903b6f78408eec90b038761e092
DIST python-ldap-docs-html-2.4.3.tar.gz 58672 SHA256 2f3a916453bc38d8644635a325eaed2944b265b3146710109e75cd6a3c518e26 SHA512 15c97fb90ee98d56d3b92bb225425bc964b208842a63bf916e76f25442b41958f6340c258cbde7a11eee2f22180b2fe1d8968b39c06e937ad9c477a2a1715cf3 WHIRLPOOL c26760e44af76b2354f15aa6d2d3efc3cc056fe4ac4dd5741efa66f6c52884758d85f2ade24ebd10781cc74742e2e89decd66b743ab0ed79a636bcd6ce35d20c

@ -2,6 +2,11 @@
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<herd>python</herd>
<maintainer>
<email>xmw@gentoo.org</email>
<name>Michael Weber</name>
<description>Upstream of the python3 port</description>
</maintainer>
<upstream>
<remote-id type="pypi">python-ldap</remote-id>
</upstream>

@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/python-ldap/python-ldap-2.3.13.ebuild,v 1.14 2012/11/14 08:17:33 xarthisius Exp $
# $Header: /var/cvsroot/gentoo-x86/dev-python/python-ldap/python-ldap-2.3.13.ebuild,v 1.15 2013/06/27 14:29:10 xmw Exp $
EAPI="3"
PYTHON_DEPEND="2"
@ -34,10 +34,10 @@ PYTHON_MODNAME="dsml.py ldapurl.py ldif.py ldap"
src_prepare() {
local rpath=
# sloppy logic, maybe better check if compiler links with GNU-ld
[[ ${CHOST} != *-darwin* ]] && rpath="-Wl,-rpath=${EPREFIX}/usr/$(get_libdir)/sasl2"
[[ ${CHOST} != *-darwin* ]] && rpath="-Wl,-rpath=\"${EPREFIX}\"/usr/$(get_libdir)/sasl2"
# Note: we can't add /usr/lib and /usr/lib/sasl2 to library_dirs due to a bug in py2.4
sed -e "s:^library_dirs =.*:library_dirs =:" \
-e "s:^include_dirs =.*:include_dirs = ${EPREFIX}/usr/include ${EPREFIX}/usr/include/sasl:" \
-e "s:^include_dirs =.*:include_dirs = \"${EPREFIX}\"/usr/include \"${EPREFIX}\"/usr/include/sasl:" \
-e "s:\(extra_compile_args =\).*:\1\nextra_link_args = ${rpath}:" \
-i setup.cfg || die "error fixing setup.cfg"

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/python-ldap/python-ldap-2.4.10-r1.ebuild,v 1.3 2013/04/06 00:50:31 naota Exp $
# $Header: /var/cvsroot/gentoo-x86/dev-python/python-ldap/python-ldap-2.4.10-r1.ebuild,v 1.4 2013/06/27 14:29:10 xmw Exp $
EAPI=5
@ -29,7 +29,7 @@ DEPEND="${RDEPEND}
python_prepare_all() {
sed -e "s:^library_dirs =.*:library_dirs = /usr/$(get_libdir) /usr/$(get_libdir)/sasl2:" \
-e "s:^include_dirs =.*:include_dirs = ${EPREFIX}/usr/include ${EPREFIX}/usr/include/sasl:" \
-e "s:^include_dirs =.*:include_dirs = \"${EPREFIX}\"/usr/include \"${EPREFIX}\"/usr/include/sasl:" \
-i setup.cfg || die "error fixing setup.cfg"
local mylibs="ldap"

@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/python-ldap/python-ldap-2.4.10.ebuild,v 1.9 2012/12/27 09:24:39 armin76 Exp $
# $Header: /var/cvsroot/gentoo-x86/dev-python/python-ldap/python-ldap-2.4.10.ebuild,v 1.10 2013/06/27 14:29:10 xmw Exp $
EAPI=4
@ -33,10 +33,10 @@ PYTHON_MODNAME="dsml.py ldapurl.py ldif.py ldap"
src_prepare() {
local rpath=
# sloppy logic, maybe better check if compiler links with GNU-ld
[[ ${CHOST} != *-darwin* ]] && rpath="-Wl,-rpath=${EPREFIX}/usr/$(get_libdir)/sasl2"
[[ ${CHOST} != *-darwin* ]] && rpath="-Wl,-rpath=\"${EPREFIX}\"/usr/$(get_libdir)/sasl2"
# Note: we can't add /usr/lib and /usr/lib/sasl2 to library_dirs due to a bug in py2.4
sed -e "s:^library_dirs =.*:library_dirs =:" \
-e "s:^include_dirs =.*:include_dirs = ${EPREFIX}/usr/include ${EPREFIX}/usr/include/sasl:" \
-e "s:^include_dirs =.*:include_dirs = \"${EPREFIX}\"/usr/include \"${EPREFIX}\"/usr/include/sasl:" \
-e "s:\(extra_compile_args =\).*:\1\nextra_link_args = ${rpath}:" \
-i setup.cfg || die "error fixing setup.cfg"

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/python-ldap/python-ldap-2.4.12.ebuild,v 1.1 2013/06/03 06:18:37 patrick Exp $
# $Header: /var/cvsroot/gentoo-x86/dev-python/python-ldap/python-ldap-2.4.12.ebuild,v 1.2 2013/06/27 14:29:10 xmw Exp $
EAPI=5
@ -29,7 +29,7 @@ DEPEND="${RDEPEND}
python_prepare_all() {
sed -e "s:^library_dirs =.*:library_dirs = /usr/$(get_libdir) /usr/$(get_libdir)/sasl2:" \
-e "s:^include_dirs =.*:include_dirs = ${EPREFIX}/usr/include ${EPREFIX}/usr/include/sasl:" \
-e "s:^include_dirs =.*:include_dirs = \"${EPREFIX}\"/usr/include \"${EPREFIX}\"/usr/include/sasl:" \
-i setup.cfg || die "error fixing setup.cfg"
local mylibs="ldap"

@ -0,0 +1,74 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/python-ldap/python-ldap-2.4.13.ebuild,v 1.2 2013/06/27 14:29:10 xmw Exp $
EAPI=5
# pypy: bug #458558 (wrong linker options due to not respecting CC)
PYTHON_COMPAT=( python{2_5,2_6,2_7} )
inherit distutils-r1 multilib
DESCRIPTION="Various LDAP-related Python modules"
HOMEPAGE="http://www.python-ldap.org http://pypi.python.org/pypi/python-ldap"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="PSF-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~x86-solaris"
IUSE="doc examples sasl ssl"
# If you need support for openldap-2.3.x, please use python-ldap-2.3.9.
# python team: Please do not remove python-ldap-2.3.9 from the tree.
RDEPEND=">=net-nds/openldap-2.4
dev-python/pyasn1[${PYTHON_USEDEP}]
sasl? ( dev-libs/cyrus-sasl )"
DEPEND="${RDEPEND}
dev-python/setuptools[${PYTHON_USEDEP}]
doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )"
python_prepare_all() {
sed -e "s:^library_dirs =.*:library_dirs = /usr/$(get_libdir) /usr/$(get_libdir)/sasl2:" \
-e "s:^include_dirs =.*:include_dirs = \"${EPREFIX}\"/usr/include \"${EPREFIX}\"/usr/include/sasl:" \
-i setup.cfg || die "error fixing setup.cfg"
local mylibs="ldap"
if use sasl; then
use ssl && mylibs="ldap_r"
mylibs="${mylibs} sasl2"
else
sed -e 's/HAVE_SASL//g' -i setup.cfg || die
fi
use ssl && mylibs="${mylibs} ssl crypto"
use elibc_glibc && mylibs="${mylibs} resolv"
sed -e "s:^libs = .*:libs = lber ${mylibs}:" \
-i setup.cfg || die "error setting up libs in setup.cfg"
distutils-r1_python_prepare_all
}
python_compile_all() {
if use doc; then
cd Doc || die
sphinx-build -b html -d _build/doctrees . _build/html || die
fi
}
python_test() {
# XXX: the tests supposedly can start local slapd
# but it requires some manual config, it seems.
"${PYTHON}" Tests/t_ldapurl.py || die "Tests fail with ${EPYTHON}"
}
python_install_all() {
use doc && local HTML_DOCS=( Doc/_build/html/. )
distutils-r1_python_install_all
if use examples; then
dodoc -r Demo
docompress -x /usr/share/doc/${FP}/Demo
fi
}

@ -1,68 +0,0 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/python-ldap/python-ldap-2.4.3.ebuild,v 1.6 2012/11/14 08:17:33 xarthisius Exp $
EAPI="3"
PYTHON_DEPEND="2"
SUPPORT_PYTHON_ABIS="1"
RESTRICT_PYTHON_ABIS="3.* *-jython"
inherit distutils multilib
DOC_P="${PN}-docs-html-${PV}"
DESCRIPTION="Various LDAP-related Python modules"
HOMEPAGE="http://www.python-ldap.org/ http://pypi.python.org/pypi/python-ldap"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz
doc? ( http://www.python-ldap.org/doc/${DOC_P}.tar.gz )"
LICENSE="PSF-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-solaris"
IUSE="doc examples sasl ssl"
# If you need support for openldap-2.3.x, please use python-ldap-2.3.9.
# python team: Please do not remove python-ldap-2.3.9 from the tree.
RDEPEND=">=net-nds/openldap-2.4
sasl? ( dev-libs/cyrus-sasl )"
DEPEND="${DEPEND}
dev-python/setuptools"
DOCS="CHANGES README"
PYTHON_MODNAME="dsml.py ldapurl.py ldif.py ldap"
src_prepare() {
local rpath=
# sloppy logic, maybe better check if compiler links with GNU-ld
[[ ${CHOST} != *-darwin* ]] && rpath="-Wl,-rpath=${EPREFIX}/usr/$(get_libdir)/sasl2"
# Note: we can't add /usr/lib and /usr/lib/sasl2 to library_dirs due to a bug in py2.4
sed -e "s:^library_dirs =.*:library_dirs =:" \
-e "s:^include_dirs =.*:include_dirs = ${EPREFIX}/usr/include ${EPREFIX}/usr/include/sasl:" \
-e "s:\(extra_compile_args =\).*:\1\nextra_link_args = ${rpath}:" \
-i setup.cfg || die "error fixing setup.cfg"
local mylibs="ldap"
if use sasl; then
use ssl && mylibs="ldap_r"
mylibs="${mylibs} sasl2"
fi
use ssl && mylibs="${mylibs} ssl crypto"
sed -e "s:^libs = .*:libs = lber resolv ${mylibs}:" \
-e "s:^compile.*:compile = 0:" \
-e "s:^optimize.*:optimize = 0:" \
-i setup.cfg || die "error setting up libs in setup.cfg"
}
src_install() {
distutils_src_install
if use doc; then
dohtml -r "${WORKDIR}/${DOC_P}"/* || die "dohtml failed"
fi
if use examples; then
insinto /usr/share/doc/${PF}
doins -r Demo || die "doins failed"
fi
}

@ -1,79 +0,0 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/python-ldap/python-ldap-2.4.9.ebuild,v 1.3 2012/11/14 08:17:33 xarthisius Exp $
EAPI=4
SUPPORT_PYTHON_ABIS="1"
RESTRICT_PYTHON_ABIS="3.* *-jython"
inherit distutils multilib
DESCRIPTION="Various LDAP-related Python modules"
HOMEPAGE="http://www.python-ldap.org http://pypi.python.org/pypi/python-ldap"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="PSF-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-solaris"
IUSE="doc examples sasl ssl"
# If you need support for openldap-2.3.x, please use python-ldap-2.3.9.
# python team: Please do not remove python-ldap-2.3.9 from the tree.
RDEPEND=">=net-nds/openldap-2.4
dev-python/pyasn1
sasl? ( dev-libs/cyrus-sasl )"
DEPEND="${RDEPEND}
dev-python/setuptools
doc? ( dev-python/sphinx )"
DOCS="CHANGES README"
PYTHON_MODNAME="dsml.py ldapurl.py ldif.py ldap"
src_prepare() {
local rpath=
# sloppy logic, maybe better check if compiler links with GNU-ld
[[ ${CHOST} != *-darwin* ]] && rpath="-Wl,-rpath=${EPREFIX}/usr/$(get_libdir)/sasl2"
# Note: we can't add /usr/lib and /usr/lib/sasl2 to library_dirs due to a bug in py2.4
sed -e "s:^library_dirs =.*:library_dirs =:" \
-e "s:^include_dirs =.*:include_dirs = ${EPREFIX}/usr/include ${EPREFIX}/usr/include/sasl:" \
-e "s:\(extra_compile_args =\).*:\1\nextra_link_args = ${rpath}:" \
-i setup.cfg || die "error fixing setup.cfg"
local mylibs="ldap"
if use sasl; then
use ssl && mylibs="ldap_r"
mylibs="${mylibs} sasl2"
else
sed -e 's/HAVE_SASL//g' -i setup.cfg || die
fi
use ssl && mylibs="${mylibs} ssl crypto"
sed -e "s:^libs = .*:libs = lber resolv ${mylibs}:" \
-e "s:^compile.*:compile = 0:" \
-e "s:^optimize.*:optimize = 0:" \
-i setup.cfg || die "error setting up libs in setup.cfg"
}
src_compile() {
distutils_src_compile
if use doc; then
pushd Doc &> /dev/null
PYTHONPATH="$(ls -d ../build-$(PYTHON -f --ABI)/lib*)" \
sphinx-build -b html -d _build/doctrees . _build/html
popd Doc &> /dev/null
fi
}
src_install() {
distutils_src_install
if use examples; then
insinto /usr/share/doc/${PF}
doins -r Demo
fi
if use doc; then
dohtml -r Doc/_build/html/
fi
}

@ -0,0 +1,74 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/python-ldap/python-ldap-9999.ebuild,v 1.1 2013/06/27 14:29:10 xmw Exp $
EAPI=5
# pypy: bug #458558 (wrong linker options due to not respecting CC)
PYTHON_COMPAT=( python{2_5,2_6,2_7,3_1,3_2} )
inherit distutils-r1 git-2 multilib
DESCRIPTION="Various LDAP-related Python modules"
HOMEPAGE="http://www.python-ldap.org http://pypi.python.org/pypi/python-ldap"
EGIT_REPO_URI="https://github.com/xmw/python-ldap.git"
LICENSE="PSF-2"
SLOT="0"
KEYWORDS=""
IUSE="doc examples sasl ssl"
# If you need support for openldap-2.3.x, please use python-ldap-2.3.9.
# python team: Please do not remove python-ldap-2.3.9 from the tree.
RDEPEND=">=net-nds/openldap-2.4
dev-python/pyasn1[${PYTHON_USEDEP}]
sasl? ( dev-libs/cyrus-sasl )"
DEPEND="${RDEPEND}
dev-python/setuptools[${PYTHON_USEDEP}]
doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )"
python_prepare_all() {
sed -e "s:^library_dirs =.*:library_dirs = /usr/$(get_libdir) /usr/$(get_libdir)/sasl2:" \
-e "s:^include_dirs =.*:include_dirs = \"${EPREFIX}\"/usr/include \"${EPREFIX}\"/usr/include/sasl:" \
-i setup.cfg || die "error fixing setup.cfg"
local mylibs="ldap"
if use sasl; then
use ssl && mylibs="ldap_r"
mylibs="${mylibs} sasl2"
else
sed -e 's/HAVE_SASL//g' -i setup.cfg || die
fi
use ssl && mylibs="${mylibs} ssl crypto"
use elibc_glibc && mylibs="${mylibs} resolv"
sed -e "s:^libs = .*:libs = lber ${mylibs}:" \
-i setup.cfg || die "error setting up libs in setup.cfg"
distutils-r1_python_prepare_all
}
python_compile_all() {
if use doc; then
cd Doc || die
sphinx-build -b html -d _build/doctrees . _build/html || die
fi
}
python_test() {
# XXX: the tests supposedly can start local slapd
# but it requires some manual config, it seems.
"${PYTHON}" Tests/t_ldapurl.py || die "Tests fail with ${EPYTHON}"
}
python_install_all() {
use doc && local HTML_DOCS=( Doc/_build/html/. )
distutils-r1_python_install_all
if use examples; then
dodoc -r Demo
docompress -x /usr/share/doc/${FP}/Demo
fi
}

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/pywebkitgtk/pywebkitgtk-1.1.8-r1.ebuild,v 1.5 2013/06/23 16:18:39 floppym Exp $
# $Header: /var/cvsroot/gentoo-x86/dev-python/pywebkitgtk/pywebkitgtk-1.1.8-r1.ebuild,v 1.6 2013/06/26 23:05:58 floppym Exp $
EAPI=5
PYTHON_COMPAT=( python{2_6,2_7} )
@ -18,7 +18,7 @@ IUSE="test"
RDEPEND="dev-python/pygobject:2[${PYTHON_USEDEP}]
dev-python/pygtk:2[${PYTHON_USEDEP}]
dev-libs/libxslt[${PYTHON_USEDEP}]
dev-libs/libxslt
>=net-libs/webkit-gtk-1.1.15:2"
DEPEND="${RDEPEND}
virtual/pkgconfig"

@ -0,0 +1 @@
DIST simplecv-1.3.tar.gz 42860284 SHA256 3510727fa5e219c811cf89bce21ecf29647bdd4ef48a0a78aa29b10b9f583947 SHA512 47fa3c0bb41057ae17323aeb68711ef4716c4fe6607162218477af9070a1b1a03a7300f38b2c2a5c54ff69b916267504aeeac7c3108d6a45045a1469a93005b8 WHIRLPOOL 0206dfc06627b78e96aa7487b6c3450cde043e1527044e413b6111831aa48b32dd043fbebbb33c61ffb1aab7683187bf76db4f0a641cdcd0c3dbd6c8d36e1b18

@ -0,0 +1,111 @@
From 164d39c1be66eb35b02fb7c30f65b5929c9e407d Mon Sep 17 00:00:00 2001
From: Vijay Mahantesh SM <vijay@vijay.(none)>
Date: Sat, 8 Dec 2012 01:55:24 +0530
Subject: [PATCH] new support for opencv 2.4.3 added
---
SimpleCV/ImageClass.py | 52 ++++++++++++++++++++++++++++++++------------------
1 file changed, 33 insertions(+), 19 deletions(-)
diff --git a/SimpleCV/ImageClass.py b/SimpleCV/ImageClass.py
index a545b50..6fab39a 100644
--- a/SimpleCV/ImageClass.py
+++ b/SimpleCV/ImageClass.py
@@ -7610,11 +7610,12 @@ class Image:
new_version = 0
#For OpenCV versions till 2.4.0, cv2.__versions__ are of the form "$Rev: 4557 $"
if not ver.startswith('$Rev:'):
- if int(ver.replace('.','0'))>=20400 :
- new_version = 1
- if int(ver.replace('.','0'))>=20402 :
- new_version = 2
-
+ if int(ver.replace('.','0'))>=20400:
+ new_version = 1
+ if int(ver.replace('.','0'))>=20402:
+ new_version = 2
+ if int(ver.replace('.','0'))>=20403:
+ new_version = 3
except:
logger.warning("Can't run Keypoints without OpenCV >= 2.3.0")
return
@@ -7622,11 +7623,11 @@ class Image:
if( forceReset ):
self._mKeyPoints = None
self._mKPDescriptors = None
-
- if( self._mKeyPoints is None or self._mKPFlavor != flavor ):
+
+ if( not(self._mKeyPoints) or self._mKPFlavor != flavor ):
if ( new_version == 0):
if( flavor == "SURF" ):
- surfer = cv2.SURF(thresh,_extended=highQuality,_upright=1)
+ surfer = cv2.SURF(thresh,_extended=highQuality,_upright=1)
self._mKeyPoints,self._mKPDescriptors = surfer.detect(self.getGrayNumpy(),None,False)
if( len(self._mKPDescriptors) == 0 ):
return None, None
@@ -7659,10 +7660,9 @@ class Image:
self._mKPDescriptors = None
self._mKPFlavor = "STAR"
del starer
-
-
- elif( new_version == 2 and flavor in ["SURF", "FAST"] ):
- if( flavor == "SURF" ):
+
+ elif( new_version >= 2 and flavor in ["SURF", "FAST"] ):
+ if( flavor == "SURF" and new_version==2):
surfer = cv2.SURF(hessianThreshold=thresh,extended=highQuality,upright=1)
#mask = self.getGrayNumpy()
#mask.fill(255)
@@ -7678,6 +7678,20 @@ class Image:
self._mKPFlavor = "SURF"
del surfer
+ if( flavor == "SURF" and new_version==3):
+ surfer = cv2.SURF(hessianThreshold=thresh,extended=highQuality,upright=1)
+ self._mKeyPoints,self._mKPDescriptors = surfer.detectAndCompute(self.getGrayNumpy(),None,useProvidedKeypoints = False)
+ if( len(self._mKPDescriptors) == 0 ):
+ return None, None
+
+ if( highQuality == 1 ):
+ self._mKPDescriptors = self._mKPDescriptors.reshape((-1,128))
+ else:
+ self._mKPDescriptors = self._mKPDescriptors.reshape((-1,64))
+
+ self._mKPFlavor = "SURF"
+ del surfer
+
elif( flavor == "FAST" ):
faster = cv2.FastFeatureDetector(threshold=int(thresh),nonmaxSuppression=True)
self._mKeyPoints = faster.detect(self.getGrayNumpy())
@@ -7693,19 +7707,19 @@ class Image:
if( len(self._mKPDescriptors) == 0 ):
return None, None
self._mKPFlavor = flavor
- del FeatureDetector
+ del FeatureDetector
elif( new_version >= 1 and flavor in ["FAST", "STAR", "MSER", "Dense"] ):
FeatureDetector = cv2.FeatureDetector_create(flavor)
self._mKeyPoints = FeatureDetector.detect(self.getGrayNumpy())
self._mKPDescriptors = None
self._mKPFlavor = flavor
- del FeatureDetector
-
- else:
- logger.warning("ImageClass.Keypoints: I don't know the method you want to use")
- return None, None
-
+ del FeatureDetector
+
+ else:
+ logger.warning("ImageClass.Keypoints: I don't know the method you want to use")
+ return None, None
+
return self._mKeyPoints,self._mKPDescriptors
def _getFLANNMatches(self,sd,td):
--
1.8.1.5

@ -0,0 +1,57 @@
From d8abe3346d7aa2b192d384476d5f2c89ca9c70e9 Mon Sep 17 00:00:00 2001
From: Justin Bronder <jsbronder@gmail.com>
Date: Fri, 14 Jun 2013 20:35:11 -0400
Subject: [PATCH] remove failing test
According to the docs, the UserWarning that is raised should not be an
issue. Ignore the failure during testings.
---
SimpleCV/tests/tests.py | 32 --------------------------------
1 file changed, 32 deletions(-)
diff --git a/SimpleCV/tests/tests.py b/SimpleCV/tests/tests.py
index 94f4fc7..ce442e3 100644
--- a/SimpleCV/tests/tests.py
+++ b/SimpleCV/tests/tests.py
@@ -1731,38 +1731,6 @@ def test_movement_feature():
pass
-def test_keypoint_extraction():
- try:
- import cv2
- except:
- pass
- return
-
- img1 = Image("../sampleimages/KeypointTemplate2.png")
- img2 = Image("../sampleimages/KeypointTemplate2.png")
- img3 = Image("../sampleimages/KeypointTemplate2.png")
-
- kp1 = img1.findKeypoints()
- kp2 = img2.findKeypoints(highQuality=True)
- kp3 = img3.findKeypoints(flavor="STAR")
- kp1.draw()
- kp2.draw()
- kp3.draw()
- #TODO: Fix FAST binding
- #~ kp4 = img.findKeypoints(flavor="FAST",min_quality=10)
- if( len(kp1)==190 and
- len(kp2)==190 and
- len(kp3)==37
- #~ and len(kp4)==521
- ):
- pass
- else:
- assert False
- results = [img1,img2,img3]
- name_stem = "test_keypoint_extraction"
- perform_diff(results,name_stem,tolerance=3.0)
-
-
def test_keypoint_match():
try:
import cv2
--
1.8.1.5

@ -0,0 +1,301 @@
From 77a76251ac911367e94c3b035e1ec243d2846e38 Mon Sep 17 00:00:00 2001
From: Justin Bronder <jsbronder@gmail.com>
Date: Fri, 14 Jun 2013 20:06:49 -0400
Subject: [PATCH] remove failing tests
---
SimpleCV/tests/tests.py | 250 ------------------------------------------------
1 file changed, 250 deletions(-)
diff --git a/SimpleCV/tests/tests.py b/SimpleCV/tests/tests.py
index 94f4fc7..d8e79d8 100644
--- a/SimpleCV/tests/tests.py
+++ b/SimpleCV/tests/tests.py
@@ -1649,39 +1649,6 @@ def test_blob_isa_methods():
else:
assert False
-def test_findKeypoints():
- try:
- import cv2
- except:
- pass
- return
- img = Image(testimage2)
- kp = img.findKeypoints()
- for k in kp:
- k.getObject()
- k.descriptor()
- k.quality()
- k.octave()
- k.flavor()
- k.angle()
- k.coordinates()
- k.draw()
- k.distanceFrom()
- k.meanColor()
- k.area()
- k.perimeter()
- k.width()
- k.height()
- k.radius()
- k.crop()
-
- kp.draw()
- results = [img]
- name_stem = "test_findKeypoints"
- #~ perform_diff(results,name_stem)
-
- pass
-
def test_movement_feature():
current1 = Image("../sampleimages/flow_simple1.png")
prev = Image("../sampleimages/flow_simple2.png")
@@ -1731,96 +1698,6 @@ def test_movement_feature():
pass
-def test_keypoint_extraction():
- try:
- import cv2
- except:
- pass
- return
-
- img1 = Image("../sampleimages/KeypointTemplate2.png")
- img2 = Image("../sampleimages/KeypointTemplate2.png")
- img3 = Image("../sampleimages/KeypointTemplate2.png")
-
- kp1 = img1.findKeypoints()
- kp2 = img2.findKeypoints(highQuality=True)
- kp3 = img3.findKeypoints(flavor="STAR")
- kp1.draw()
- kp2.draw()
- kp3.draw()
- #TODO: Fix FAST binding
- #~ kp4 = img.findKeypoints(flavor="FAST",min_quality=10)
- if( len(kp1)==190 and
- len(kp2)==190 and
- len(kp3)==37
- #~ and len(kp4)==521
- ):
- pass
- else:
- assert False
- results = [img1,img2,img3]
- name_stem = "test_keypoint_extraction"
- perform_diff(results,name_stem,tolerance=3.0)
-
-
-def test_keypoint_match():
- try:
- import cv2
- except:
- pass
- return
-
- template = Image("../sampleimages/KeypointTemplate2.png")
- match0 = Image("../sampleimages/kptest0.png")
- match1 = Image("../sampleimages/kptest1.png")
- match3 = Image("../sampleimages/kptest2.png")
- match2 = Image("../sampleimages/aerospace.jpg")# should be none
-
- fs0 = match0.findKeypointMatch(template)#test zero
- fs1 = match1.findKeypointMatch(template,quality=300.00,minDist=0.5,minMatch=0.2)
- fs3 = match3.findKeypointMatch(template,quality=300.00,minDist=0.5,minMatch=0.2)
- print "This should fail"
- fs2 = match2.findKeypointMatch(template,quality=500.00,minDist=0.2,minMatch=0.1)
- if( fs0 is not None and fs1 is not None and fs2 is None and fs3 is not None):
- fs0.draw()
- fs1.draw()
- fs3.draw()
- f = fs0[0]
- f.drawRect()
- f.draw()
- f.getHomography()
- f.getMinRect()
- f.meanColor()
- f.crop()
- f.x
- f.y
- f.coordinates()
- else:
- assert False
-
- results = [match0,match1,match2,match3]
- name_stem = "test_find_keypoint_match"
- perform_diff(results,name_stem)
-
-
-def test_draw_keypoint_matches():
- try:
- import cv2
- except:
- pass
- return
- template = Image("../sampleimages/KeypointTemplate2.png")
- match0 = Image("../sampleimages/kptest0.png")
- result = match0.drawKeypointMatches(template,thresh=500.00,minDist=0.15,width=1)
-
- results = [result]
- name_stem = "test_draw_keypoint_matches"
- perform_diff(results,name_stem,tolerance=4.0)
-
-
- pass
-
-
def test_basic_palette():
img = Image(testimageclr)
img._generatePalette(10,False)
@@ -2303,29 +2180,6 @@ def test_blob_spatial_relationships():
if( not center.contains(inside) ):
assert False
-def test_get_aspectratio():
- img = Image("../sampleimages/EdgeTest1.png")
- img2 = Image("../sampleimages/EdgeTest2.png")
- b = img.findBlobs()
- l = img2.findLines()
- c = img2.findCircle(thresh=200)
- c2 = img2.findCorners()
- kp = img2.findKeypoints()
- bb = b.aspectRatios()
- ll = l.aspectRatios()
- cc = c.aspectRatios()
- c22 = c2.aspectRatios()
- kp2 = kp.aspectRatios()
-
- if( len(bb) > 0 and
- len(ll) > 0 and
- len(cc) > 0 and
- len(c22) > 0 and
- len(kp2) > 0 ):
- pass
- else:
- assert False
-
def test_line_crop():
img = Image("../sampleimages/EdgeTest2.png")
l = img.findLines().sortArea()
@@ -2391,74 +2245,6 @@ def test_save_kwargs():
s80 = os.remove(l80)
s70 = os.remove(l70)
-def test_on_edge():
- img1 = "./../sampleimages/EdgeTest1.png"
- img2 = "./../sampleimages/EdgeTest2.png"
- imgA = Image(img1)
- imgB = Image(img2)
- imgC = Image(img2)
- imgD = Image(img2)
- imgE = Image(img2)
-
- blobs = imgA.findBlobs()
- circs = imgB.findCircle(thresh=200)
- corners = imgC.findCorners()
- kp = imgD.findKeypoints()
- lines = imgE.findLines()
-
- rim = blobs.onImageEdge()
- inside = blobs.notOnImageEdge()
- rim.draw(color=Color.RED)
- inside.draw(color=Color.BLUE)
-
- rim = circs.onImageEdge()
- inside = circs.notOnImageEdge()
- rim.draw(color=Color.RED)
- inside.draw(color=Color.BLUE)
-
- #rim = corners.onImageEdge()
- inside = corners.notOnImageEdge()
- #rim.draw(color=Color.RED)
- inside.draw(color=Color.BLUE)
-
- #rim = kp.onImageEdge()
- inside = kp.notOnImageEdge()
- #rim.draw(color=Color.RED)
- inside.draw(color=Color.BLUE)
-
- rim = lines.onImageEdge()
- inside = lines.notOnImageEdge()
- rim.draw(color=Color.RED)
- inside.draw(color=Color.BLUE)
-
- results = [imgA,imgB,imgC,imgD,imgE]
- name_stem = "test_onEdge_Features"
- #~ perform_diff(results,name_stem,tolerance=8.0)
-
-def test_feature_angles():
- img = Image("../sampleimages/rotation2.png")
- img2 = Image("../sampleimages/rotation.jpg")
- img3 = Image("../sampleimages/rotation.jpg")
- b = img.findBlobs()
- l = img2.findLines()
- k = img3.findKeypoints()
-
- for bs in b:
- tl = bs.topLeftCorner()
- img.drawText(str(bs.angle()),tl[0],tl[1],color=Color.RED)
-
- for ls in l:
- tl = ls.topLeftCorner()
- img2.drawText(str(ls.angle()),tl[0],tl[1],color=Color.GREEN)
-
- for ks in k:
- tl = ks.topLeftCorner()
- img3.drawText(str(ks.angle()),tl[0],tl[1],color=Color.BLUE)
-
- results = [img,img2,img3]
- name_stem = "test_feature_angles"
- perform_diff(results,name_stem,tolerance=9.0)
-
def test_feature_angles_rotate():
img = Image("../sampleimages/rotation2.png")
b = img.findBlobs()
@@ -2740,42 +2526,6 @@ def test_getSkintoneMask():
name_stem = 'test_skintone'
perform_diff(masks,name_stem,tolerance=17)
-def test_findKeypoints_all():
- try:
- import cv2
- except:
- pass
- return
- img = Image(testimage2)
- methods = ["ORB", "SIFT", "SURF","FAST", "STAR", "MSER", "Dense"]
- for i in methods :
- print i
- kp = img.findKeypoints(flavor = i)
- if kp!=None :
- for k in kp:
- k.getObject()
- k.descriptor()
- k.quality()
- k.octave()
- k.flavor()
- k.angle()
- k.coordinates()
- k.draw()
- k.distanceFrom()
- k.meanColor()
- k.area()
- k.perimeter()
- k.width()
- k.height()
- k.radius()
- k.crop()
- kp.draw()
- results = [img]
- name_stem = "test_findKeypoints"
- #~ perform_diff(results,name_stem,tolerance=8)
- pass
-
-
def test_upload_flickr():
try:
import flickrapi
--
1.8.1.5

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer>
<email>jsbronder@gentoo.org</email>
</maintainer>
<use>
<flag name="shell">Enable the iPython SimpleCV shell</flag>
</use>
</pkgmetadata>

@ -0,0 +1,49 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/simplecv/simplecv-1.3.ebuild,v 1.1 2013/06/26 22:50:48 jsbronder Exp $
EAPI=5
PYTHON_COMPAT=( python2_7 )
inherit distutils-r1 vcs-snapshot
MY_PN=SimpleCV
DESCRIPTION="Python interface to several powerful open source computer vision libraries."
HOMEPAGE="http://simplecv.org/"
SRC_URI="https://github.com/sightmachine/${MY_PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="shell test"
DEPEND="
test? ( dev-python/nose[${PYTHON_USEDEP}] )"
RDEPEND="
>=media-libs/opencv-2.2
dev-python/numpy[${PYTHON_USEDEP}]
sci-libs/scipy[${PYTHON_USEDEP}]
dev-python/imaging[${PYTHON_USEDEP}]
dev-python/pygame[${PYTHON_USEDEP}]
shell? ( dev-python/ipython[${PYTHON_USEDEP}] )"
# 1. FeatureDetector being called with the wrong number of arguments
# 2. Remove test that according to docs shouldn't be an issue
PATCHES=(
"${FILESDIR}"/new-support-for-opencv-2.4.3-added.patch
"${FILESDIR}"/remove-failing-test.patch
)
src_test() {
cd "${S}/SimpleCV/tests"
nosetests tests.py || die "tests failed"
}
src_install() {
distutils-r1_src_install
if ! use shell; then
rm -rf "${D}"/usr/bin
fi
}

@ -1,9 +1,9 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/werkzeug/werkzeug-0.9.1.ebuild,v 1.1 2013/06/16 22:20:52 radhermit Exp $
# $Header: /var/cvsroot/gentoo-x86/dev-python/werkzeug/werkzeug-0.9.1.ebuild,v 1.2 2013/06/27 00:48:32 floppym Exp $
EAPI="5"
PYTHON_COMPAT=( python{2_6,2_7,3_3} )
PYTHON_COMPAT=( python{2_6,2_7,3_3} pypy{1_9,2_0} )
inherit distutils-r1
@ -17,11 +17,11 @@ SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~arm ~ppc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
IUSE="test"
IUSE=""
RDEPEND="dev-python/simplejson[${PYTHON_USEDEP}]"
DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
test? ( dev-python/lxml[${PYTHON_USEDEP}] )"
DEPEND="${RDEPEND}
dev-python/setuptools[${PYTHON_USEDEP}]"
S="${WORKDIR}/${MY_P}"

@ -1 +1,2 @@
DIST flog-2.5.3.gem 20480 SHA256 6e78f6de2bf2d216c3639585427c3ea0d3c4a84509a2a4bc934a23ee004ad788 SHA512 cff1c7cb95c02bd498644de0879bbab04f00ac606e5a920a7ebee89870909d2c93878ab354bdd2dc22635521cc8c0631489d33c780e44d2fec9aa0b4cc0992cd WHIRLPOOL 2d537d7a04b2db5df138e685fee65d554e0ec9c8cbe0647ecf97a1c8825187fd170d0294085f9f2b9cfa21f43a0f76818e9a2c451202ddf54cbc9da13618a926
DIST flog-3.2.3.gem 22528 SHA256 eb215725d5700eff3e658cc96eb0972452f8a9265bae59d0391a5da44a82f457 SHA512 96d25ab52797362612d65eb318551864a34938ffd7ca2b5b3459be457a2d7bdec81c5f8a4cac2815cfa753bdc598ba13805f3997ca004934a703d5d2908cf4b2 WHIRLPOOL dd22f3eef2c6044dcfdad4ed354659133fc3af14a23b0efaea33fa8f93fa6e8fe06729c6ea0cce16092ed7243c48c8c07ca4420ca128fd173089e09eab77f0b3

@ -0,0 +1,28 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-ruby/flog/flog-3.2.3.ebuild,v 1.1 2013/06/27 06:33:52 graaff Exp $
EAPI=5
USE_RUBY="ruby18 ruby19 jruby"
RUBY_FAKEGEM_RECIPE_DOC="rdoc"
RUBY_FAKEGEM_EXTRADOC="History.txt README.txt"
inherit ruby-fakegem
DESCRIPTION="Flog reports the most tortured code in an easy to read pain report."
HOMEPAGE="http://ruby.sadi.st/"
LICENSE="MIT"
KEYWORDS="~x86 ~amd64"
SLOT="0"
IUSE=""
ruby_add_bdepend "test? ( dev-ruby/minitest )"
ruby_add_rdepend "=dev-ruby/ruby_parser-3* >dev-ruby/ruby_parser-3.1.0
=dev-ruby/sexp_processor-4*"
each_ruby_test() {
${RUBY} -Ilib test/test_flog.rb || die
}

@ -1 +1,2 @@
DIST texlive-20120701-source.tar.xz 131904044 SHA256 9666617d5dac3e82578e696835cc9f251ee0a56d162d86dff08659ac5dcb6c81 SHA512 0e8653aa21094e079900d17256f0768ac5514690a3725d96923d5fdc7633484d611441df1af8c674b38b9ce6a8845a9004976cd00635742dfc6837aa433caf5f WHIRLPOOL 9d570a1bd58cca8baed399ab53eb767c7c3db607c00363ce563e14dfccdd235703c538e6a651aa7f2934adf21f8477775f1547f9e7f3d957b89af644c89bcb57
DIST texlive-20130530-source.tar.xz 179963948 SHA256 a905832e4c04dd1cb16db4bb7baacb78fbc19682bd33ac2697a3a85ce78d79d4 SHA512 4aa85273a675af2453f09777b7cb348c18add77410d72f562c6586f6814d4e7c34b6f3690e3453020654fb0a265339fcabf590d9155367d52846224499af334c WHIRLPOOL 3affaf25d3936505d971599092964b0f0e97d107d22dbac6a85ad547e1d2726a6a09c5075fecb0c6ff8c88bc1bd09d78f95902f76eb76c608f8a7bc42dd6bc33

@ -0,0 +1,37 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-tex/bibtexu/bibtexu-3.71_p20130530.ebuild,v 1.1 2013/06/27 13:15:19 aballier Exp $
EAPI=5
DESCRIPTION="8-bit Implementation of BibTeX 0.99 with a Very Large Capacity"
HOMEPAGE="http://tug.org/texlive/"
SRC_URI="mirror://gentoo/texlive-${PV#*_p}-source.tar.xz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
IUSE=""
RDEPEND=">=dev-libs/kpathsea-6.1.0_p20120701
>=dev-libs/icu-4.4
!<app-text/texlive-core-2013"
DEPEND="${RDEPEND}
virtual/pkgconfig"
S=${WORKDIR}/texlive-${PV#*_p}-source/texk/bibtex-x
src_configure() {
econf \
--with-system-kpathsea \
--with-system-icu
}
src_install() {
emake \
DESTDIR="${D}" \
csfdir="${EPREFIX}/usr/share/texmf-dist/bibtexu/csf/base" \
btdocdir="${EPREFIX}/usr/share/doc/${PF}" \
install
dodoc 00readme.txt ChangeLog csfile.txt HISTORY
}

@ -7,3 +7,4 @@ DIST debhelper_9.20130518.tar.gz 472829 SHA256 9e8e99a90fb628f67d9b148ff99cda113
DIST debhelper_9.20130604.tar.gz 473080 SHA256 27c3b7f8dcafea0d4e0f6311970ad26b76be24122b312ed42b2db0a9b9c0be0d SHA512 6f82aef7113cd30f2a69c5b74516283e516c2e855038204796cb7ef99144c63293999af92ecc0aa1930fb915c77a0154739afecadab03ef2de9b109d39e223ce WHIRLPOOL 1ce188041557f48c5e64cb24f11bb6696f1b80fb9f0717fb42ef123aa044ba893a97813eb27410050157816456b5a6c1ca2048299296f7f36cfaf50ea7f6b4ca
DIST debhelper_9.20130605.tar.gz 473168 SHA256 5e9b73e460d088c11b99cf6002eb6f264027255d18a83fbdadda6365e934efd1 SHA512 3c0621cef85b23a1489ef860c1c2971734115344ec732f67a012510d762f136c4aee1357dfe32caf389388ef91dc09bc9d2e9ec04bb93de307aa2a8094e90185 WHIRLPOOL abc3fff33b3d4b3ed9ad99d3a6abb6fce4e4951577ca1966150d62308dd449d08c0aa1c42c599894af158d7489dd2b284dea61b76b87fbc6d2e98032d9281c8e
DIST debhelper_9.20130624.tar.gz 474475 SHA256 93c0e1e399bfb276b61bd8cc0461c2a4552c0f9ebe729f4826badf6a724acacf SHA512 26ac7ea3dd89c8eb4ccc72d4c58a76c80a1b68c1f7bd5231f012bd510ecb860bf151e091f4e963faff7539811555aaebcbb39be2292af3ea8480a21f4c691721 WHIRLPOOL fcb67fc5ae1677c2ece5ed28e8b4d50bcf03259961f2956e544c54aedc7a7bfc829c7fd06b9538ca367ed4ac91039ec83fb53c8a0004f0e1e551561dbc24f038
DIST debhelper_9.20130626.tar.gz 474419 SHA256 c0e9bef6a8e69e8eade382195876b7fd4fff5ab6221769749e2e357908fd9b7d SHA512 a91bf2925a365f7e2990fdfced2949394ec3cda08a9443f5d2a235d9971b1d44109d3edda9b1fcd9c17bf47c08541d782e8b866de3be2118997945623a428538 WHIRLPOOL 834edb345fa56d4cea897b89652c36bb242ebd1d4d68ab28e20b2e979735ec803f9b23e558926ccf80e2f28e53a4e835327273709283ddb8c204e07d0af0c26b

@ -0,0 +1,70 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-util/debhelper/debhelper-9.20130626.ebuild,v 1.1 2013/06/27 12:53:44 jer Exp $
EAPI=5
inherit eutils toolchain-funcs
DESCRIPTION="Collection of programs that can be used to automate common tasks in debian/rules"
HOMEPAGE="http://packages.qa.debian.org/d/debhelper.html http://joeyh.name/code/debhelper/"
SRC_URI="mirror://debian/pool/main/d/${PN}/${P/-/_}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux"
IUSE="test"
DH_LINGUAS=( de es fr )
IUSE+=" ${DH_LINGUAS[@]/#/linguas_}"
NLS_DEPEND=$(
printf "linguas_%s? ( >=app-text/po4a-0.24 )\n" ${DH_LINGUAS[@]}
)
RDEPEND="
>=dev-lang/perl-5.10
app-arch/dpkg
dev-perl/TimeDate
virtual/perl-Getopt-Long
"
DEPEND="${RDEPEND}
${NLS_DEPEND}
test? ( dev-perl/Test-Pod )
"
S=${WORKDIR}/${PN}
src_compile() {
tc-export CC
local LANGS="" USE_NLS=no lingua
for lingua in ${DH_LINGUAS[@]}; do
if use linguas_${lingua}; then
LANGS+=" ${lingua}"
USE_NLS=yes
fi
done
emake USE_NLS="${USE_NLS}" LANGS="${LANGS}" build
}
src_install() {
emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install
dodoc doc/* debian/changelog
docinto examples
dodoc examples/*
local lingua
for manfile in *.1 *.7 ; do
for lingua in ${DH_LINGUAS[@]}; do
case ${manfile} in
*.${lingua}.?)
use linguas_${lingua} \
&& cp ${manfile} "${T}"/${manfile/.${lingua}/} \
&& doman -i18n=${lingua} "${T}"/${manfile/.${lingua}/}
;;
*)
doman ${manfile}
;;
esac
done
done
}

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-vcs/qgit/qgit-2.5.ebuild,v 1.5 2013/03/02 21:08:50 hwoarang Exp $
# $Header: /var/cvsroot/gentoo-x86/dev-vcs/qgit/qgit-2.5.ebuild,v 1.6 2013/06/27 03:29:57 pinkbyte Exp $
EAPI=4
@ -12,7 +12,7 @@ SRC_URI="http://libre.tibirna.org/attachments/download/9/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="2"
KEYWORDS="amd64 ppc ppc64 x86 ~amd64-linux ~x86-linux ~x86-macos"
KEYWORDS="amd64 ~arm ppc ppc64 x86 ~amd64-linux ~x86-linux ~x86-macos"
IUSE=""
DEPEND="dev-qt/qtgui:4"

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/fcaps.eclass,v 1.7 2013/06/02 15:21:04 vapier Exp $
# $Header: /var/cvsroot/gentoo-x86/eclass/fcaps.eclass,v 1.8 2013/06/27 01:18:57 vapier Exp $
# @ECLASS: fcaps.eclass
# @MAINTAINER:
@ -162,9 +162,10 @@ fcaps() {
;;
*"Operation not supported"*)
local fstype=$(stat -f -c %T "${file}")
ewarn "Could not set caps on '${file}' due to missing filesystem support."
ewarn "Make sure you enable XATTR support for '${fstype}' in your kernel."
ewarn "You might also have to enable the relevant FS_SECURITY option."
ewarn "Could not set caps on '${file}' due to missing filesystem support:"
ewarn "* enable XATTR support for '${fstype}' in your kernel (if configurable)"
ewarn "* mount the fs with the user_xattr option (if not the default)"
ewarn "* enable the relevant FS_SECURITY option (if configurable)"
break
;;
*)

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-autotools.eclass,v 1.17 2013/03/16 19:20:34 robbat2 Exp $
# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-autotools.eclass,v 1.18 2013/06/26 19:31:49 jmbsvicetto Exp $
# @ECLASS: mysql-autotools.eclass
# @MAINTAINER:
@ -51,14 +51,14 @@ mysql-autotools_disable_test() {
# ${S}/mysql-tests/suite/ndb_team/t/disabled.def
# ${S}/mysql-tests/suite/binlog/t/disabled.def
# ${S}/mysql-tests/suite/innodb/t/disabled.def
if [ -n "${testsuite}" ]; then
if [[ -n ${testsuite} ]]; then
for mysql_disable_file in \
${S}/mysql-test/suite/${testsuite}/disabled.def \
${S}/mysql-test/suite/${testsuite}/t/disabled.def \
FAILED ; do
[ -f "${mysql_disable_file}" ] && break
[[ -f ${mysql_disable_file} ]] && break
done
if [ "${mysql_disabled_file}" != "FAILED" ]; then
if [[ ${mysql_disabled_file} != "FAILED" ]]; then
echo "${testname} : ${reason}" >> "${mysql_disable_file}"
else
ewarn "Could not find testsuite disabled.def location for ${rawtestname}"
@ -99,7 +99,7 @@ mysql-autotools_configure_minimal() {
# MariaDB requires this flag in order to link to GPLv3 readline v6 or greater
# A note is added to the configure output
if [[ "${PN}" == "mariadb" ]] && mysql_version_is_at_least "5.1.61" ; then
if [[ ${PN} == "mariadb" ]] && mysql_version_is_at_least "5.1.61" ; then
myconf="${myconf} --disable-distribution"
fi
}
@ -134,7 +134,7 @@ mysql-autotools_configure_common() {
fi
fi
if [ -n "${MYSQL_DEFAULT_CHARSET}" -a -n "${MYSQL_DEFAULT_COLLATION}" ]; then
if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then
ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}"
ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}."
ewarn "You MUST file bugs without these variables set."
@ -220,7 +220,7 @@ mysql-autotools_configure_51() {
# Not supporting as examples: example,daemon_example,ftexample
plugins_sta="${plugins_sta} partition"
if [[ "${PN}" != "mariadb" ]] ; then
if [[ ${PN} != "mariadb" ]] ; then
elog "Before using the Federated storage engine, please be sure to read"
elog "http://dev.mysql.com/doc/refman/5.1/en/federated-limitations.html"
plugins_dyn="${plugins_dyn} federated"
@ -237,10 +237,10 @@ mysql-autotools_configure_51() {
# - innobase, innodb_plugin
# Build falcon if available for 6.x series.
for i in innobase falcon ; do
[ -e "${S}"/storage/${i} ] && plugins_sta="${plugins_sta} ${i}"
[[ -e ${S}/storage/${i} ]] && plugins_sta="${plugins_sta} ${i}"
done
for i in innodb_plugin ; do
[ -e "${S}"/storage/${i} ] && plugins_dyn="${plugins_dyn} ${i}"
[[ -e ${S}/storage/${i} ]] && plugins_dyn="${plugins_dyn} ${i}"
done
# like configuration=max-no-ndb
@ -252,12 +252,12 @@ mysql-autotools_configure_51() {
plugins_dis="${plugins_dis} ndbcluster"
fi
if [[ "${PN}" == "mariadb" ]] ; then
if [[ ${PN} == "mariadb" ]] ; then
# In MariaDB, InnoDB is packaged in the xtradb directory, so it's not
# caught above.
# This is not optional, without it several upstream testcases fail.
# Also strongly recommended by upstream.
if [[ "${PV}" < "5.2.0" ]] ; then
if [[ ${PV} < "5.2.0" ]] ; then
myconf="${myconf} --with-maria-tmp-tables"
plugins_sta="${plugins_sta} maria"
else
@ -265,11 +265,11 @@ mysql-autotools_configure_51() {
plugins_sta="${plugins_sta} aria"
fi
[ -e "${S}"/storage/innobase ] || [ -e "${S}"/storage/xtradb ] ||
[[ ( -e ${S}/storage/innobase ) || ( -e ${S}/storage/xtradb ) ]] ||
die "The ${P} package doesn't provide innobase nor xtradb"
for i in innobase xtradb ; do
[ -e "${S}"/storage/${i} ] && plugins_sta="${plugins_sta} ${i}"
[[ -e ${S}/storage/${i} ]] && plugins_sta="${plugins_sta} ${i}"
done
myconf="${myconf} $(use_with libevent)"
@ -300,7 +300,7 @@ mysql-autotools_configure_51() {
fi
fi
if pbxt_available && [[ "${PBXT_NEWSTYLE}" == "1" ]]; then
if pbxt_available && [[ ${PBXT_NEWSTYLE} == "1" ]]; then
use pbxt \
&& plugins_sta="${plugins_sta} pbxt" \
|| plugins_dis="${plugins_dis} pbxt"
@ -311,7 +311,7 @@ mysql-autotools_configure_51() {
plugins_dyn=""
# Google MySQL, bundle what upstream supports
if [[ "${PN}" == "google-mysql" ]]; then
if [[ ${PN} == "google-mysql" ]]; then
for x in innobase innodb_plugin innodb ; do
plugins_sta="${plugins_sta//$x}"
plugins_dyn="${plugins_dyn//$x}"
@ -389,7 +389,7 @@ mysql-autotools_src_prepare() {
# last -fPIC fixup, per bug #305873
i="${S}"/storage/innodb_plugin/plug.in
[ -f "${i}" ] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}"
[[ -f ${i} ]] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}"
# Additional checks, remove bundled zlib
rm -f "${S}/zlib/"*.[ch]
@ -417,21 +417,21 @@ mysql-autotools_src_prepare() {
i="innobase"
o="${WORKDIR}/storage-${i}.mysql-upstream"
# Have we been here already?
[ -d "${o}" ] && rm -f "${i}"
[[ -d ${o} ]] && rm -f "${i}"
# Or maybe we haven't
[ -d "${i}" -a ! -d "${o}" ] && mv "${i}" "${o}"
[[ ( -d ${i} ) && ! ( -d ${o} ) ]] && mv "${i}" "${o}"
cp -ral "${WORKDIR}/${XTRADB_P}" "${i}"
popd >/dev/null
fi
if pbxt_patch_available && [[ "${PBXT_NEWSTYLE}" == "1" ]] && use pbxt ; then
if pbxt_patch_available && [[ ${PBXT_NEWSTYLE} == "1" ]] && use pbxt ; then
einfo "Adding storage engine: PBXT"
pushd "${S}"/storage >/dev/null
i='pbxt'
[ -d "${i}" ] && rm -rf "${i}"
[[ -d ${i} ]] && rm -rf "${i}"
cp -ral "${WORKDIR}/${PBXT_P}" "${i}"
f="${WORKDIR}/mysql-extras/pbxt/fix-low-priority.patch"
[[ -f $f ]] && epatch "$f"
[[ -f $f ]] && epatch "$f"
popd >/dev/null
fi
@ -490,7 +490,7 @@ mysql-autotools_src_configure() {
# implicitly. Upstream might be interested in this, exclude
# -fno-implicit-templates for google-mysql for now.
mysql_version_is_at_least "5.0" \
&& [[ "${PN}" != "google-mysql" ]] \
&& [[ ${PN} != "google-mysql" ]] \
&& CXXFLAGS="${CXXFLAGS} -fno-implicit-templates"
export CXXFLAGS
@ -526,7 +526,7 @@ mysql-autotools_src_configure() {
| xargs -0 -n100 sed -i \
-e 's|^pkglibdir *= *$(libdir)/mysql|pkglibdir = $(libdir)|;s|^pkgincludedir *= *$(includedir)/mysql|pkgincludedir = $(includedir)|'
if [[ $EAPI == 2 ]] && [[ "${PBXT_NEWSTYLE}" != "1" ]]; then
if [[ $EAPI == 2 ]] && [[ ${PBXT_NEWSTYLE} != "1" ]]; then
pbxt_patch_available && use pbxt && pbxt_src_configure
fi
}
@ -538,7 +538,7 @@ mysql-autotools_src_compile() {
emake || die "emake failed"
if [[ "${PBXT_NEWSTYLE}" != "1" ]]; then
if [[ ${PBXT_NEWSTYLE} != "1" ]]; then
pbxt_patch_available && use pbxt && pbxt_src_compile
fi
}
@ -557,7 +557,7 @@ mysql-autotools_src_install() {
testroot="${MY_SHAREDSTATEDIR}" \
|| die "emake install failed"
if [[ "${PBXT_NEWSTYLE}" != "1" ]]; then
if [[ ${PBXT_NEWSTYLE} != "1" ]]; then
pbxt_patch_available && use pbxt && pbxt_src_install
fi
@ -620,7 +620,7 @@ mysql-autotools_src_install() {
# Empty directories ...
diropts "-m0750"
keepdir "${MY_DATADIR#${EPREFIX}}"
if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then
if [[ ${PREVIOUS_DATADIR} != "yes" ]] ; then
chown -R mysql:mysql "${D}/${MY_DATADIR}"
fi
@ -635,7 +635,7 @@ mysql-autotools_src_install() {
# Docs
einfo "Installing docs"
for i in README ChangeLog EXCEPTIONS-CLIENT INSTALL-SOURCE ; do
[[ -f "$i" ]] && dodoc "$i"
[[ -f $i ]] && dodoc "$i"
done
doinfo "${S}"/Docs/mysql.info
@ -648,12 +648,12 @@ mysql-autotools_src_install() {
"${S}"/support-files/magic \
"${S}"/support-files/ndb-config-2-node.ini
do
[[ -f "$script" ]] && dodoc "${script}"
[[ -f $script ]] && dodoc "${script}"
done
docinto "scripts"
for script in "${S}"/scripts/mysql* ; do
[[ -f "$script" ]] && [[ "${script%.sh}" == "${script}" ]] && dodoc "${script}"
[[ ( -f $script ) && ( ${script%.sh} == ${script} ) ]] && dodoc "${script}"
done
fi
@ -661,7 +661,7 @@ mysql-autotools_src_install() {
mysql_lib_symlinks "${ED}"
#Remove mytop if perl is not selected
[[ "${PN}" == "mariadb" ]] && ! use perl \
[[ ${PN} == "mariadb" ]] && ! use perl \
&& mysql_version_is_at_least "5.3" \
&& rm -f "${ED}/usr/bin/mytop"

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-cmake.eclass,v 1.15 2013/03/04 19:10:31 robbat2 Exp $
# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-cmake.eclass,v 1.16 2013/06/26 19:31:49 jmbsvicetto Exp $
# @ECLASS: mysql-cmake.eclass
# @MAINTAINER:
@ -36,29 +36,29 @@ mysql-cmake_disable_test() {
for mysql_disabled_file in \
${S}/mysql-test/disabled.def \
${S}/mysql-test/t/disabled.def ; do
[ -f "${mysql_disabled_file}" ] && break
[[ -f ${mysql_disabled_file} ]] && break
done
#mysql_disabled_file="${S}/mysql-test/t/disabled.def"
#einfo "rawtestname=${rawtestname} testname=${testname} testsuite=${testsuite}"
echo ${testname} : ${reason} >> "${mysql_disabled_file}"
if [ -n "${testsuite}" ] && [ "${testsuite}" != "main" ]; then
if [[ ( -n ${testsuite} ) && ( ${testsuite} != "main" ) ]]; then
for mysql_disabled_file in \
${S}/mysql-test/suite/${testsuite}/disabled.def \
${S}/mysql-test/suite/${testsuite}/t/disabled.def \
FAILED ; do
[ -f "${mysql_disabled_file}" ] && break
[[ -f ${mysql_disabled_file} ]] && break
done
if [ "${mysql_disabled_file}" != "FAILED" ]; then
if [[ ${mysql_disabled_file} != "FAILED" ]]; then
echo "${testname} : ${reason}" >> "${mysql_disabled_file}"
else
for mysql_disabled_dir in \
${S}/mysql-test/suite/${testsuite} \
${S}/mysql-test/suite/${testsuite}/t \
FAILED ; do
[ -d "${mysql_disabled_dir}" ] && break
[[ -d ${mysql_disabled_dir} ]] && break
done
if [ "${mysql_disabled_dir}" != "FAILED" ]; then
if [[ ${mysql_disabled_dir} != "FAILED" ]]; then
echo "${testname} : ${reason}" >> "${mysql_disabled_dir}/disabled.def"
else
ewarn "Could not find testsuite disabled.def location for ${rawtestname}"
@ -72,7 +72,7 @@ mysql-cmake_disable_test() {
# Helper function to configure locale cmake options
configure_cmake_locale() {
if ! use minimal && [ -n "${MYSQL_DEFAULT_CHARSET}" -a -n "${MYSQL_DEFAULT_COLLATION}" ]; then
if ! use minimal && [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then
ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}"
ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}."
ewarn "You MUST file bugs without these variables set."
@ -151,7 +151,7 @@ configure_cmake_standard() {
if use ssl; then
mycmakeargs+=( -DWITH_SSL=system )
else
mycmakeargs+=( -DWITH_SSL=0 )
mycmakeargs+=( -DWITH_SSL=bundled )
fi
if mysql_version_is_at_least "5.5" && use jemalloc; then
@ -179,7 +179,7 @@ configure_cmake_standard() {
mycmakeargs+=( $(cmake-utils_use_with pbxt PBXT_STORAGE_ENGINE) )
fi
if [ "${PN}" == "mariadb" ]; then
if [[ ${PN} == "mariadb" ]]; then
mycmakeargs+=(
$(cmake-utils_use_with oqgraph OQGRAPH_STORAGE_ENGINE)
$(cmake-utils_use_with sphinx SPHINX_STORAGE_ENGINE)
@ -189,7 +189,12 @@ configure_cmake_standard() {
if ! use pam ; then
mycmakeargs+=( -DAUTH_PAM_DISABLED=1 )
fi
fi
if [[ ${PN} == "percona-server" ]]; then
mycmakeargs+=(
$(cmake-utils_use_with pam)
)
fi
}
@ -218,7 +223,7 @@ mysql-cmake_src_prepare() {
# last -fPIC fixup, per bug #305873
i="${S}"/storage/innodb_plugin/plug.in
[ -f "${i}" ] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}"
[[ -f ${i} ]] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}"
rm -f "scripts/mysqlbug"
epatch_user
@ -253,13 +258,13 @@ mysql-cmake_src_configure() {
-DINSTALL_SQLBENCHDIR=share/mysql
-DINSTALL_SUPPORTFILESDIR=${EPREFIX}/usr/share/mysql
-DWITH_COMMENT="Gentoo Linux ${PF}"
-DWITHOUT_UNIT_TESTS=1
$(cmake-utils_use_with test UNIT_TESTS)
)
# Bug 412851
# MariaDB requires this flag to compile with GPLv3 readline linked
# Adds a warning about redistribution to configure
if [[ "${PN}" == "mariadb" ]] ; then
if [[ ${PN} == "mariadb" ]] ; then
mycmakeargs+=( -DNOT_FOR_DISTRIBUTION=1 )
fi
@ -274,12 +279,16 @@ mysql-cmake_src_configure() {
# Bug #114895, bug #110149
filter-flags "-O" "-O[01]"
CXXFLAGS="${CXXFLAGS} -fno-exceptions -fno-strict-aliasing"
CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"
CXXFLAGS="${CXXFLAGS} -felide-constructors -fno-rtti"
# Causes linkage failures. Upstream bug #59607 removes it
if ! mysql_version_is_at_least "5.6" ; then
CXXFLAGS="${CXXFLAGS} -fno-implicit-templates"
fi
# As of 5.7, exceptions are used!
if ! mysql_version_is_at_least "5.7" ; then
CXXFLAGS="${CXXFLAGS} -fno-exceptions"
fi
export CXXFLAGS
# bug #283926, with GCC4.4, this is required to get correct behavior.
@ -316,6 +325,9 @@ mysql-cmake_src_install() {
dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlrepair"
dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqloptimize"
# Create a mariadb_config symlink
[[ ${PN} == "mariadb" ]] && dosym "/usr/bin/mysql_config" "/usr/bin/mariadb_config"
# INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir
rm -Rf "${ED}/usr/data"
@ -341,7 +353,7 @@ mysql-cmake_src_install() {
# Configuration stuff
case ${MYSQL_PV_MAJOR} in
5.[1-4]*) mysql_mycnf_version="5.1" ;;
5.[5-9]|6*|7*) mysql_mycnf_version="5.5" ;;
5.[5-9]|6*|7*|8*|9*|10*) mysql_mycnf_version="5.5" ;;
esac
einfo "Building default my.cnf (${mysql_mycnf_version})"
insinto "${MY_SYSCONFDIR#${EPREFIX}}"
@ -363,7 +375,7 @@ mysql-cmake_src_install() {
einfo "Creating initial directories"
# Empty directories ...
diropts "-m0750"
if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then
if [[ ${PREVIOUS_DATADIR} != "yes" ]] ; then
dodir "${MY_DATADIR#${EPREFIX}}"
keepdir "${MY_DATADIR#${EPREFIX}}"
chown -R mysql:mysql "${D}/${MY_DATADIR}"
@ -386,19 +398,16 @@ mysql-cmake_src_install() {
"${S}"/support-files/magic \
"${S}"/support-files/ndb-config-2-node.ini.sh
do
[[ -f "$script" ]] && dodoc "${script}"
[[ -f $script ]] && dodoc "${script}"
done
docinto "scripts"
for script in "${S}"/scripts/mysql* ; do
[[ -f "$script" ]] && [[ "${script%.sh}" == "${script}" ]] && dodoc "${script}"
[[ ( -f $script ) && ( ${script%.sh} == ${script} ) ]] && dodoc "${script}"
done
fi
mysql_lib_symlinks "${ED}"
#Remove mytop if perl is not selected
[[ "${PN}" == "mariadb" ]] && ! use perl \
[[ ${PN} == "mariadb" ]] && ! use perl \
&& rm -f "${ED}/usr/bin/mytop"
}

@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-v2.eclass,v 1.24 2013/02/13 00:40:57 robbat2 Exp $
# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-v2.eclass,v 1.25 2013/06/26 19:31:49 jmbsvicetto Exp $
# @ECLASS: mysql-v2.eclass
# @MAINTAINER:
@ -11,7 +11,7 @@
# @BLURB: This eclass provides most of the functions for mysql ebuilds
# @DESCRIPTION:
# The mysql-v2.eclass is the base eclass to build the mysql and
# alternative projects (mariadb) ebuilds.
# alternative projects (mariadb and percona) ebuilds.
# This eclass uses the mysql-autotools and mysql-cmake eclasses for the
# specific bits related to the build system.
# It provides the src_unpack, src_prepare, src_configure, src_compile,
@ -44,7 +44,7 @@ MYSQL_EXTRAS=""
# @DESCRIPTION:
# The version of the MYSQL_EXTRAS repo to use to build mysql
# Use "none" to disable it's use
[[ "${MY_EXTRAS_VER}" == "live" ]] && MYSQL_EXTRAS="git-2"
[[ ${MY_EXTRAS_VER} == "live" ]] && MYSQL_EXTRAS="git-2"
inherit eutils flag-o-matic gnuconfig ${MYSQL_EXTRAS} ${BUILD_INHERIT} mysql_fx versionator toolchain-funcs
@ -53,7 +53,7 @@ inherit eutils flag-o-matic gnuconfig ${MYSQL_EXTRAS} ${BUILD_INHERIT} mysql_fx
#
case "${EAPI:-0}" in
3|4|5) ;;
4|5) ;;
*) die "Unsupported EAPI: ${EAPI}" ;;
esac
@ -67,8 +67,8 @@ EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_configure src_compile src_
# and we will run a mysql server during test phase
S="${WORKDIR}/mysql"
[[ "${MY_EXTRAS_VER}" == "latest" ]] && MY_EXTRAS_VER="20090228-0714Z"
if [[ "${MY_EXTRAS_VER}" == "live" ]]; then
[[ ${MY_EXTRAS_VER} == "latest" ]] && MY_EXTRAS_VER="20090228-0714Z"
if [[ ${MY_EXTRAS_VER} == "live" ]]; then
EGIT_PROJECT=mysql-extras
EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/mysql-extras.git"
fi
@ -113,10 +113,10 @@ mysql_version_is_at_least "5.1.50" || die "This eclass should only be used with
# Designation by PERCONA for a MySQL version to apply an XTRADB release
# Work out the default SERVER_URI correctly
if [ -z "${SERVER_URI}" ]; then
[ -z "${MY_PV}" ] && MY_PV="${PV//_/-}"
if [ "${PN}" == "mariadb" ]; then
MARIA_FULL_PV="$(replace_version_separator 3 '-' ${MY_PV})"
if [[ -z ${SERVER_URI} ]]; then
[[ -z ${MY_PV} ]] && MY_PV="${PV//_/-}"
if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]]; then
MARIA_FULL_PV=$(replace_version_separator 3 '-' ${MY_PV})
MARIA_FULL_P="${PN}-${MARIA_FULL_PV}"
SERVER_URI="
http://ftp.osuosl.org/pub/mariadb/${MARIA_FULL_P}/kvm-tarbake-jaunty-x86/${MARIA_FULL_P}.tar.gz
@ -126,6 +126,16 @@ if [ -z "${SERVER_URI}" ]; then
http://mirrors.fe.up.pt/pub/${PN}/${MARIA_FULL_P}/kvm-tarbake-jaunty-x86/${MARIA_FULL_P}.tar.gz
http://ftp-stud.hs-esslingen.de/pub/Mirrors/${PN}/${MARIA_FULL_P}/kvm-tarbake-jaunty-x86/${MARIA_FULL_P}.tar.gz
"
if [[ ${PN} == "mariadb-galera" ]]; then
MY_SOURCEDIR="${PN%%-galera}-${MARIA_FULL_PV}"
fi
elif [[ ${PN} == "percona-server" ]]; then
PERCONA_PN="Percona-Server"
MIRROR_PV=$(get_version_component_range 1-2 ${PV})
MY_PV=$(get_version_component_range 1-3 ${PV})
MY_PATCH=$(get_version_component_range 4 ${PV})
SERVER_URI="http://www.percona.com/redir/downloads/${PERCONA_PN}-${MIRROR_PV}/LATEST/source/${PERCONA_PN}-${MY_PV}-rel30.${MY_PATCH}.tar.gz"
# http://www.percona.com/redir/downloads/Percona-Server-5.5/LATEST/source/Percona-Server-5.5.30-rel30.2.tar.gz
else
URI_DIR="MySQL"
URI_FILE="mysql"
@ -141,19 +151,28 @@ fi
SRC_URI="${SERVER_URI}"
# Gentoo patches to MySQL
[[ ${MY_EXTRAS_VER} != live ]] && [[ ${MY_EXTRAS_VER} != none ]] \
&& SRC_URI="${SRC_URI}
if [[ ${MY_EXTRAS_VER} != "live" && ${MY_EXTRAS_VER} != "none" ]]; then
SRC_URI="${SRC_URI}
mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
http://g3nt8.org/patches/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
http://dev.gentoo.org/~robbat2/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
http://dev.gentoo.org/~jmbsvicetto/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2"
fi
DESCRIPTION="A fast, multi-threaded, multi-user SQL database server."
HOMEPAGE="http://www.mysql.com/"
if [[ "${PN}" == "mariadb" ]]; then
if [[ ${PN} == "mariadb" ]]; then
HOMEPAGE="http://mariadb.org/"
DESCRIPTION="An enhanced, drop-in replacement for MySQL"
fi
if [[ ${PN} == "mariadb-galera" ]]; then
HOMEPAGE="http://mariadb.org/"
DESCRIPTION="An enhanced, drop-in replacement for MySQL with Galera Replication"
fi
if [[ ${PN} == "percona-server" ]]; then
HOMEPAGE="http://www.percona.com/software/percona-server"
DESCRIPTION="An enhanced, drop-in replacement fro MySQL from the Percona team"
fi
LICENSE="GPL-2"
SLOT="0"
@ -172,34 +191,29 @@ IUSE="${IUSE} extraengine"
IUSE="${IUSE} cluster"
IUSE="${IUSE} max-idx-128"
IUSE="${IUSE} berkdb"
IUSE="${IUSE} +community profiling"
[[ ${PN} == "mariadb" ]] \
&& mysql_check_version_range "5.1.38 to 5.3.99" \
&& IUSE="${IUSE} libevent"
[[ ${PN} == "mariadb" ]] \
&& mysql_version_is_at_least "5.2" \
&& IUSE="${IUSE} oqgraph"
[[ ${PN} == "mariadb" ]] \
&& mysql_version_is_at_least "5.2.5" \
&& IUSE="${IUSE} sphinx"
[[ ${PN} == "mariadb" ]] \
&& mysql_version_is_at_least "5.2.10" \
&& IUSE="${IUSE} pam"
if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]]; then
mysql_check_version_range "5.1.38 to 5.3.99" && IUSE="${IUSE} libevent"
mysql_version_is_at_least "5.2" && IUSE="${IUSE} oqgraph"
mysql_version_is_at_least "5.2.5" && IUSE="${IUSE} sphinx"
mysql_version_is_at_least "5.2.10" && IUSE="${IUSE} pam"
fi
if mysql_version_is_at_least "5.5"; then
REQUIRED_USE="tcmalloc? ( !jemalloc ) jemalloc? ( !tcmalloc )"
IUSE="${IUSE} jemalloc tcmalloc"
fi
REQUIRED_USE="${REQUIRED_USE} minimal? ( !cluster !extraengine !embedded ) static? ( !ssl )"
if mysql_version_is_at_least "5.5.7"; then
IUSE="${IUSE} systemtap"
fi
mysql_version_is_at_least "5.5.7" \
&& IUSE="${IUSE} systemtap"
if [[ ${PN} == "percona-server" ]]; then
mysql_version_is_at_least "5.5.10" && IUSE="${IUSE} pam"
fi
REQUIRED_USE="${REQUIRED_USE} minimal? ( !cluster !extraengine !embedded ) static? ( !ssl )"
#
# DEPENDENCIES:
@ -216,42 +230,30 @@ DEPEND="
>=sys-libs/zlib-1.2.3
"
[[ ${PN} == mariadb ]] \
&& mysql_check_version_range "5.1.38 to 5.3.99" \
&& DEPEND="${DEPEND} libevent? ( >=dev-libs/libevent-1.4 )"
if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]] ; then
mysql_check_version_range "5.1.38 to 5.3.99" && DEPEND="${DEPEND} libevent? ( >=dev-libs/libevent-1.4 )"
mysql_version_is_at_least "5.2" && DEPEND="${DEPEND} oqgraph? ( >=dev-libs/boost-1.40.0 )"
mysql_version_is_at_least "5.2.5" && DEPEND="${DEPEND} sphinx? ( app-misc/sphinx )"
mysql_version_is_at_least "5.2.10" && DEPEND="${DEPEND} !minimal? ( pam? ( virtual/pam ) )"
# Bug 441700 MariaDB >=5.3 include custom mytop
mysql_version_is_at_least "5.3" && DEPEND="${DEPEND} perl? ( !dev-db/mytop )"
fi
# Having different flavours at the same time is not a good idea
for i in "mysql" "mariadb" ; do
for i in "mysql" "mariadb" "mariadb-galera" "percona-server"; do
[[ ${i} == ${PN} ]] ||
DEPEND="${DEPEND} !dev-db/${i}"
done
[[ "${PN}" == "mariadb" ]] \
&& mysql_version_is_at_least "5.2" \
&& DEPEND="${DEPEND} oqgraph? ( >=dev-libs/boost-1.40.0 )"
[[ "${PN}" == "mariadb" ]] \
&& mysql_version_is_at_least "5.2.5" \
&& DEPEND="${DEPEND} sphinx? ( app-misc/sphinx )"
[[ "${PN}" == "mariadb" ]] \
&& mysql_version_is_at_least "5.2.10" \
&& DEPEND="${DEPEND} !minimal? ( pam? ( virtual/pam ) )"
# Bug 441700 MariaDB >=5.3 include custom mytop
[[ "${PN}" == "mariadb" ]] \
&& mysql_version_is_at_least "5.3" \
&& DEPEND="${DEPEND} perl? ( !dev-db/mytop )"
mysql_version_is_at_least "5.5.7" \
&& DEPEND="${DEPEND} systemtap? ( >=dev-util/systemtap-1.3 )" \
&& DEPEND="${DEPEND} kernel_linux? ( dev-libs/libaio )"
mysql_version_is_at_least "5.5" \
&& DEPEND="${DEPEND} jemalloc? ( dev-libs/jemalloc )"
if mysql_version_is_at_least "5.5" ; then
DEPEND="${DEPEND} jemalloc? ( dev-libs/jemalloc )"
DEPEND="${DEPEND} tcmalloc? ( dev-util/google-perftools )"
fi
mysql_version_is_at_least "5.5" \
&& DEPEND="${DEPEND} tcmalloc? ( dev-util/google-perftools )"
if mysql_version_is_at_least "5.5.7" ; then
DEPEND="${DEPEND} systemtap? ( >=dev-util/systemtap-1.3 )"
DEPEND="${DEPEND} kernel_linux? ( dev-libs/libaio )"
fi
# prefix: first need to implement something for #196294
RDEPEND="${DEPEND}
@ -259,14 +261,16 @@ RDEPEND="${DEPEND}
selinux? ( sec-policy/selinux-mysql )
"
# Bug 455016 Add dependancies of mytop
[[ "${PN}" == "mariadb" ]] \
&& mysql_version_is_at_least "5.3" \
&& RDEPEND="${RDEPEND} perl? (
virtual/perl-Getopt-Long
dev-perl/TermReadKey
virtual/perl-Term-ANSIColor
virtual/perl-Time-HiRes ) "
if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]] ; then
# Bug 455016 Add dependencies of mytop
if mysql_version_is_at_least "5.3" ; then
RDEPEND="${RDEPEND} perl? (
virtual/perl-Getopt-Long
dev-perl/TermReadKey
virtual/perl-Term-ANSIColor
virtual/perl-Time-HiRes ) "
fi
fi
DEPEND="${DEPEND}
virtual/yacc
@ -278,8 +282,9 @@ DEPEND="${DEPEND} static? ( sys-libs/ncurses[static-libs] )"
DEPEND="${DEPEND} >=dev-util/cmake-2.4.3"
# compile-time-only
mysql_version_is_at_least "5.5.8" \
&& DEPEND="${DEPEND} >=dev-util/cmake-2.6.3"
if mysql_version_is_at_least "5.5.8" ; then
DEPEND="${DEPEND} >=dev-util/cmake-2.6.3"
fi
# dev-perl/DBD-mysql is needed by some scripts installed by MySQL
PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )"
@ -295,13 +300,12 @@ PDEPEND="${PDEPEND} =virtual/mysql-${MYSQL_PV_MAJOR}"
# PBXT_VERSION means that we have a PBXT patch for this PV
# PBXT was only introduced after 5.1.12
pbxt_patch_available() {
[[ ${PN} != "mariadb" ]] \
&& [[ -n "${PBXT_VERSION}" ]]
[[ ${PN} != "mariadb" && ${PN} != "mariadb-galera" && ( -n "${PBXT_VERSION}" ) ]]
return $?
}
pbxt_available() {
pbxt_patch_available || [[ ${PN} == "mariadb" ]]
pbxt_patch_available || [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]]
return $?
}
@ -310,18 +314,16 @@ pbxt_available() {
# XTRADB_VERS means that we have a XTRADB patch for this PV
# XTRADB was only introduced after 5.1.26
xtradb_patch_available() {
[[ ${PN} != "mariadb" ]] \
&& [[ -n "${XTRADB_VER}" && -n "${PERCONA_VER}" ]]
[[ ${PN} != "mariadb" && ${PN} != "mariadb-galera"
&& ( -n "${XTRADB_VER}" ) && ( -n "${PERCONA_VER}" ) ]]
return $?
}
if pbxt_patch_available; then
PBXT_P="pbxt-${PBXT_VERSION}"
PBXT_SRC_URI="http://www.primebase.org/download/${PBXT_P}.tar.gz mirror://sourceforge/pbxt/${PBXT_P}.tar.gz"
SRC_URI="${SRC_URI} pbxt? ( ${PBXT_SRC_URI} )"
fi
# PBXT_NEWSTYLE means pbxt is in storage/ and gets enabled as other plugins
@ -393,8 +395,7 @@ mysql-v2_pkg_setup() {
fi
# Check for USE flag problems in pkg_setup
if ! mysql_version_is_at_least "5.2" \
&& use debug ; then
if ! mysql_version_is_at_least "5.2" && use debug ; then
# Also in package.use.mask
die "Bug #344885: Upstream has broken USE=debug for 5.1 series >=5.1.51"
fi
@ -496,13 +497,13 @@ mysql-v2_pkg_postinst() {
docinto "scripts"
for script in scripts/mysql* ; do
[[ -f "${script}" ]] \
&& [[ "${script%.sh}" == "${script}" ]] \
&& dodoc "${script}"
if [[ -f "${script}" && "${script%.sh}" == "${script}" ]]; then
dodoc "${script}"
fi
done
if [ ${PN} == "mariadb" ] \
&& mysql_version_is_at_least "5.2.10" && use pam ; then
if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]] \
&& mysql_version_is_at_least "5.2.10" && use pam ; then
einfo
elog "This install includes the PAM authentication plugin."
elog "To activate and configure the PAM plugin, please read:"
@ -536,10 +537,6 @@ mysql-v2_pkg_postinst() {
elog " PRIMARY KEY (name)"
elog " ) CHARACTER SET utf8 COLLATE utf8_bin;"
fi
mysql_check_version_range "4.0 to 5.0.99.99" \
&& use berkdb \
&& elog "Berkeley DB support is deprecated and will be removed in future versions!"
}
# @FUNCTION: mysql-v2_getopt
@ -587,7 +584,7 @@ mysql-v2_pkg_config() {
local old_MY_DATADIR_s="${ROOT}/${old_MY_DATADIR}"
old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}"
if [[ -d "${old_MY_DATADIR_s}" ]] && [[ "${old_MY_DATADIR_s}" != / ]]; then
if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then
if [[ -d "${MY_DATADIR_s}" ]]; then
ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist"
ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}"
@ -670,11 +667,11 @@ mysql-v2_pkg_config() {
&& cp "${help_tables}" "${TMPDIR}/fill_help_tables.sql" \
|| touch "${TMPDIR}/fill_help_tables.sql"
help_tables="${TMPDIR}/fill_help_tables.sql"
# Figure out which options we need to disable to do the setup
helpfile="${TMPDIR}/mysqld-help"
${EROOT}/usr/sbin/mysqld --verbose --help >"${helpfile}" 2>/dev/null
for opt in grant-tables host-cache name-resolve networking slave-start bdb \
for opt in grant-tables host-cache name-resolve networking slave-start \
federated innodb ssl log-bin relay-log slow-query-log external-locking \
ndbcluster log-slave-updates \
; do
@ -690,7 +687,7 @@ mysql-v2_pkg_config() {
pushd "${TMPDIR}" &>/dev/null
#cmd="'${EROOT}/usr/share/mysql/scripts/mysql_install_db' '--basedir=${EPREFIX}/usr' ${options}"
cmd=${EROOT}usr/share/mysql/scripts/mysql_install_db
[ -f ${cmd} ] || cmd=${EROOT}usr/bin/mysql_install_db
[[ -f ${cmd} ]] || cmd=${EROOT}usr/bin/mysql_install_db
cmd="'$cmd' '--basedir=${EPREFIX}/usr' ${options}"
einfo "Command: $cmd"
eval $cmd \
@ -716,6 +713,14 @@ mysql-v2_pkg_config() {
einfo "Creating the mysql database and setting proper"
einfo "permissions on it ..."
# Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it
PID_DIR="${EROOT}/var/run/mysqld"
if [[ ! -d "${PID_DIR}" ]]; then
mkdir "${PID_DIR}"
chown mysql:mysql "${PID_DIR}"
chmod 755 "${PID_DIR}"
fi
local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock"
local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid"
local mysqld="${EROOT}/usr/sbin/mysqld \
@ -763,7 +768,7 @@ mysql-v2_pkg_config() {
mysql < "${sqltmp}"
rc=$?
eend $?
[ $rc -ne 0 ] && ewarn "Failed to load zoneinfo!"
[[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!"
# Stop the server and cleanup
einfo "Stopping the server ..."

@ -1,3 +1,3 @@
DIST renpy-6.14.1-source.tar.bz2 9806538 SHA256 18be3630d1956131a1f010732d15292cdcec14a2391210af27dc342fafd8197f SHA512 a1f13a5f860e66054012eab29bbd37715bd9721e2dc30fdd9c8d4d8c58dc672c35b3c813e962ad6878cb741502af5a181dff8a05f359892b6b60d2e15bc5a7bc WHIRLPOOL 54018731e136106f328bf2d028841f09424d8ffd8303821eec995c55918b2c8ac7eb97d9ed24785e95ad3d878b794f5bcf96cc9f783955f8d1ace086a3ca9b61
DIST renpy-6.15.4-source.tar.bz2 10393987 SHA256 1c32fef5fda6f14134ea5e18f4754934644f86bdd968b4600b03b373f2d8e9cb SHA512 d68d5d64b29bf3eb19a38aa9dc540278e0b054dc2629aaa01866fbf2976cc6a5ffb0027706004526112782b25d0a8aae76a6b3958b5bfdac8a62841ba223554a WHIRLPOOL 008e1e3986d97d24256b6438de00be7ae676c893a67d975037c8bbfc5bfbdb886cb70d28bed3dfbec5c6529906b66071cc990fc617c1b579f8d2f9f9afe20ca8
DIST renpy-6.15.5-source.tar.bz2 10433241 SHA256 e174a61d9861144895a8a4334b6c0058c4c18c2405cd8cc7f9418380895c833b SHA512 8d1a1993fd90288a72e64d55d6e0da3f0fcfc513d2cdf63c6f4c3d84404ab7babdfb97db565c6063b057e6331f367c4662a4fc2151e8dc78c126cb19ecdfe893 WHIRLPOOL 71a0c8574f8a3b3c5008c16d20585da5a8e7f8532f66a6839ab1e2309441e70364ae45ac9e5e3088be21ad53c46e21728b1c25e893c392d1c26a200c3ae1406c
DIST renpy-6.15.7-source.tar.bz2 10421736 SHA256 b4280b62f7c8f730a37c7e567b16216b4578fc3640fbcdf5df7c65a73ae52e52 SHA512 d79b1d6b931f281ff208b8ece3889c116ceb05c58fe115e9f7f470788e74e63cfeb3df4f804b4a37a4f1da6ba194c883023808fafc8e8beddf864424958204e6 WHIRLPOOL 202ddb045f440f9abd06f5ac02ebd92a7b0300b14f4755271f1fc4e91bdea21cda19a432f45516f68ba3ad7ead98d7491382ad5c633da277a674f799458795f3

@ -1,95 +1,18 @@
From: Julian Ospald <hasufell@gentoo.org>
Date: Mon Feb 25 21:35:31 UTC 2013
Subject: fix multiple abi support
commit ea0351d8bf6404f5e8db2ff872885a19bf8a3f92
Author: hasufell <hasufell@gentoo.org>
Date: Thu Jun 27 02:01:17 2013 +0200
--- /dev/null
+++ renpy-6.15.2-source/renpy/common.py
@@ -0,0 +1,79 @@
+# (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, sublicense, and/or sell copies of the Software,
+# and to permit persons to whom the Software is furnished to do so,
+# subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+import os
+import sys
+import warnings
+from distutils.sysconfig import get_python_lib
+
+# Functions to be customized by distributors. ################################
+
+# Given the Ren'Py base directory (usually the directory containing
+# this file), this is expected to return the path to the common directory.
+def path_to_common(renpy_base):
+ return renpy_base + "/renpy/common"
+
+# Given a directory holding a Ren'Py game, this is expected to return
+# the path to a directory that will hold save files.
+def path_to_saves(gamedir):
+ import renpy #@UnresolvedImport
+
+ if not renpy.config.save_directory:
+ return gamedir + "/saves"
+
+ # Search the path above Ren'Py for a directory named "Ren'Py Data".
+ # If it exists, then use that for our save directory.
+ path = renpy.config.renpy_base
+
+ while True:
+ if os.path.isdir(path + "/Ren'Py Data"):
+ return path + "/Ren'Py Data/" + renpy.config.save_directory
+
+ newpath = os.path.dirname(path)
+ if path == newpath:
+ break
+ path = newpath
+
+ # Otherwise, put the saves in a platform-specific location.
+ if renpy.android:
+ return gamedir + "/saves"
+
+ elif renpy.macintosh:
+ rv = "~/Library/RenPy/" + renpy.config.save_directory
+ return os.path.expanduser(rv)
+
+ elif renpy.windows:
+ if 'APPDATA' in os.environ:
+ return os.environ['APPDATA'] + "/RenPy/" + renpy.config.save_directory
+ else:
+ rv = "~/RenPy/" + renpy.config.save_directory
+ return os.path.expanduser(rv)
+
+ else:
+ rv = "~/.renpy/" + renpy.config.save_directory
+ return os.path.expanduser(rv)
+
+
+# Returns the path to the Ren'Py base directory (containing common and
+# the launcher, usually.)
+def path_to_renpy_base():
+ renpy_base = os.path.dirname(os.path.realpath(sys.argv[0]))
+ renpy_base = get_python_lib() + "/renpy@SLOT@"
+ renpy_base = os.environ.get('RENPY_BASE', renpy_base)
+ renpy_base = os.path.abspath(renpy_base)
+
+ return renpy_base
--- renpy-6.15.2-source/renpy.py
+++ renpy-6.15.2-source/renpy.py
@@ -25,64 +25,9 @@
fix multiple abi support
diff --git a/renpy.py b/renpy.py
index 4ec5324..d873750 100644
--- a/renpy.py
+++ b/renpy.py
@@ -28,82 +28,9 @@
import os
import sys
import warnings
-
-# Functions to be customized by distributors. ################################
-
-# Given the Ren'Py base directory (usually the directory containing
@ -102,6 +25,26 @@ Subject: fix multiple abi support
-def path_to_saves(gamedir):
- import renpy #@UnresolvedImport
-
- # Android.
- if renpy.android:
- paths = [
- os.path.join(os.environ["ANDROID_OLD_PUBLIC"], "game/saves"),
- os.path.join(os.environ["ANDROID_PRIVATE"], "saves"),
- os.path.join(os.environ["ANDROID_PUBLIC"], "saves"),
- ]
-
- for rv in paths:
- if os.path.isdir(rv):
- break
-
- print "Using savedir", rv
-
- # We return the last path as the default.
-
- return rv
-
-
- # No save directory given.
- if not renpy.config.save_directory:
- return gamedir + "/saves"
-
@ -119,10 +62,7 @@ Subject: fix multiple abi support
- path = newpath
-
- # Otherwise, put the saves in a platform-specific location.
- if renpy.android:
- return gamedir + "/saves"
-
- elif renpy.macintosh:
- if renpy.macintosh:
- rv = "~/Library/RenPy/" + renpy.config.save_directory
- return os.path.expanduser(rv)
-
@ -154,12 +94,12 @@ Subject: fix multiple abi support
# The version of the Mac Launcher and py4renpy that we require.
macos_version = (6, 14, 0)
@@ -97,21 +42,10 @@
@@ -118,20 +45,9 @@ except:
print "Ren'Py requires at least python 2.6."
sys.exit(0)
-android = ("ANDROID_PRIVATE" in os.environ)
-
-# Android requires us to add code to the main module, and to command some
-# renderers.
-if android:
@ -168,7 +108,6 @@ Subject: fix multiple abi support
- __main__.path_to_common = path_to_common
- __main__.path_to_saves = path_to_saves
- os.environ["RENPY_RENDERER"] = "gl"
- os.environ["RENPY_GL_ENVIRON"] = "limited"
-
def main():
@ -177,7 +116,7 @@ Subject: fix multiple abi support
# Add paths.
if os.path.exists(renpy_base + "/module"):
@@ -134,10 +68,6 @@
@@ -154,10 +70,6 @@ def main():
print >>sys.stderr, "correctly, preserving the directory structure."
raise
@ -188,9 +127,101 @@ Subject: fix multiple abi support
renpy.bootstrap.bootstrap(renpy_base)
if __name__ == "__main__":
--- renpy-6.15.2-source/renpy/main.py
+++ renpy-6.15.2-source/renpy/main.py
@@ -27,7 +27,7 @@
diff --git a/renpy/common.py b/renpy/common.py
new file mode 100644
index 0000000..475b7e8
--- /dev/null
+++ b/renpy/common.py
@@ -0,0 +1,84 @@
+# This file is part of Ren'Py. The license below applies to Ren'Py only.
+# Games and other projects that use Ren'Py may use a different license.
+
+# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation files
+# (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, sublicense, and/or sell copies of the Software,
+# and to permit persons to whom the Software is furnished to do so,
+# subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+import os
+import sys
+import warnings
+from distutils.sysconfig import get_python_lib
+
+# Functions to be customized by distributors. ################################
+
+# Given the Ren'Py base directory (usually the directory containing
+# this file), this is expected to return the path to the common directory.
+def path_to_common(renpy_base):
+ return renpy_base + "/renpy/common"
+
+# Given a directory holding a Ren'Py game, this is expected to return
+# the path to a directory that will hold save files.
+def path_to_saves(gamedir):
+ import renpy #@UnresolvedImport
+
+ # No save directory given.
+ if not renpy.config.save_directory:
+ return gamedir + "/saves"
+
+ # Search the path above Ren'Py for a directory named "Ren'Py Data".
+ # If it exists, then use that for our save directory.
+ path = renpy.config.renpy_base
+
+ while True:
+ if os.path.isdir(path + "/Ren'Py Data"):
+ return path + "/Ren'Py Data/" + renpy.config.save_directory
+
+ newpath = os.path.dirname(path)
+ if path == newpath:
+ break
+ path = newpath
+
+ # Otherwise, put the saves in a platform-specific location.
+ if renpy.macintosh:
+ rv = "~/Library/RenPy/" + renpy.config.save_directory
+ return os.path.expanduser(rv)
+
+ elif renpy.windows:
+ if 'APPDATA' in os.environ:
+ return os.environ['APPDATA'] + "/RenPy/" + renpy.config.save_directory
+ else:
+ rv = "~/RenPy/" + renpy.config.save_directory
+ return os.path.expanduser(rv)
+
+ else:
+ rv = "~/.renpy/" + renpy.config.save_directory
+ return os.path.expanduser(rv)
+
+
+# Returns the path to the Ren'Py base directory (containing common and
+# the launcher, usually.)
+def path_to_renpy_base():
+ renpy_base = os.path.dirname(os.path.realpath(sys.argv[0]))
+ renpy_base = get_python_lib() + "/renpy@SLOT@"
+ renpy_base = os.environ.get('RENPY_BASE', renpy_base)
+ renpy_base = os.path.abspath(renpy_base)
+
+ return renpy_base
diff --git a/renpy/main.py b/renpy/main.py
index 908e246..61027ec 100644
--- a/renpy/main.py
+++ b/renpy/main.py
@@ -27,7 +27,7 @@ import time
import zipfile
import subprocess
from cPickle import loads, dumps
@ -199,7 +230,7 @@ Subject: fix multiple abi support
def save_persistent():
@@ -147,7 +147,7 @@
@@ -147,7 +147,7 @@ def main():
renpy.config.searchpath = [ renpy.config.gamedir ]
# Find the common directory.
@ -208,7 +239,7 @@ Subject: fix multiple abi support
if os.path.isdir(commondir):
renpy.config.searchpath.append(commondir)
@@ -206,7 +206,7 @@
@@ -210,7 +210,7 @@ def main():
# Find the save directory.
if renpy.config.savedir is None:

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-engines/renpy/renpy-6.15.5.ebuild,v 1.1 2013/06/05 12:27:29 hasufell Exp $
# $Header: /var/cvsroot/gentoo-x86/games-engines/renpy/renpy-6.15.7.ebuild,v 1.1 2013/06/27 00:07:22 hasufell Exp $
EAPI=5
PYTHON_COMPAT=( python2_6 python2_7 )

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-libs/alsa-lib/alsa-lib-1.0.27-r3.ebuild,v 1.2 2013/05/06 13:50:28 ssuominen Exp $
# $Header: /var/cvsroot/gentoo-x86/media-libs/alsa-lib/alsa-lib-1.0.27-r3.ebuild,v 1.3 2013/06/26 20:09:37 aballier Exp $
EAPI=5
@ -18,7 +18,8 @@ KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd6
IUSE="doc debug alisp python"
RDEPEND="python? ( ${PYTHON_DEPS} )
abi_x86_32? ( !<=app-emulation/emul-linux-x86-soundlibs-20130224 )"
abi_x86_32? ( !<=app-emulation/emul-linux-x86-soundlibs-20130224-r1
!app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)] )"
DEPEND="${RDEPEND}
doc? ( >=app-doc/doxygen-1.2.6 )"

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-libs/alsa-lib/alsa-lib-1.0.27.1.ebuild,v 1.1 2013/05/27 13:42:59 ssuominen Exp $
# $Header: /var/cvsroot/gentoo-x86/media-libs/alsa-lib/alsa-lib-1.0.27.1.ebuild,v 1.2 2013/06/26 20:09:37 aballier Exp $
EAPI=5
@ -19,7 +19,8 @@ KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd6
IUSE="doc debug alisp python"
RDEPEND="python? ( ${PYTHON_DEPS} )
abi_x86_32? ( !<=app-emulation/emul-linux-x86-soundlibs-20130224 )"
abi_x86_32? ( !<=app-emulation/emul-linux-x86-soundlibs-20130224-r1
!app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)] )"
DEPEND="${RDEPEND}
doc? ( >=app-doc/doxygen-1.2.6 )"

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-libs/audiofile/audiofile-0.3.6-r1.ebuild,v 1.1 2013/05/02 12:50:30 mgorny Exp $
# $Header: /var/cvsroot/gentoo-x86/media-libs/audiofile/audiofile-0.3.6-r1.ebuild,v 1.2 2013/06/26 20:31:26 aballier Exp $
EAPI=5
@ -16,7 +16,8 @@ KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd6
IUSE="flac static-libs test"
RDEPEND="flac? ( >=media-libs/flac-1.2.1[${MULTILIB_USEDEP}] )
abi_x86_32? ( !<=app-emulation/emul-linux-x86-soundlibs-20130224 )"
abi_x86_32? ( !<=app-emulation/emul-linux-x86-soundlibs-20130224-r1
!app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)] )"
DEPEND="${RDEPEND}
virtual/pkgconfig
test? ( dev-cpp/gtest[${MULTILIB_USEDEP}] )"

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-libs/flac/flac-1.2.1-r5.ebuild,v 1.3 2013/05/07 11:58:12 mgorny Exp $
# $Header: /var/cvsroot/gentoo-x86/media-libs/flac/flac-1.2.1-r5.ebuild,v 1.4 2013/06/26 20:21:47 aballier Exp $
EAPI=5
@ -19,7 +19,8 @@ KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd6
IUSE="3dnow altivec +cxx debug ogg sse static-libs"
RDEPEND="ogg? ( >=media-libs/libogg-1.1.3[${MULTILIB_USEDEP}] )
abi_x86_32? ( !<=app-emulation/emul-linux-x86-soundlibs-20130224 )"
abi_x86_32? ( !<=app-emulation/emul-linux-x86-soundlibs-20130224-r1
!app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)] )"
DEPEND="${RDEPEND}
abi_x86_32? ( dev-lang/nasm )
!elibc_uclibc? ( sys-devel/gettext )

@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-libs/flac/flac-1.3.0.ebuild,v 1.1 2013/05/29 08:30:22 radhermit Exp $
# $Header: /var/cvsroot/gentoo-x86/media-libs/flac/flac-1.3.0.ebuild,v 1.2 2013/06/26 20:21:47 aballier Exp $
EAPI=5
AUTOTOOLS_AUTORECONF=1
@ -18,7 +18,8 @@ KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd6
IUSE="3dnow altivec +cxx debug ogg sse static-libs"
RDEPEND="ogg? ( >=media-libs/libogg-1.1.3[${MULTILIB_USEDEP}] )
abi_x86_32? ( !<=app-emulation/emul-linux-x86-soundlibs-20130224 )"
abi_x86_32? ( !<=app-emulation/emul-linux-x86-soundlibs-20130224-r1
!app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)] )"
DEPEND="${RDEPEND}
app-arch/xz-utils
abi_x86_32? ( dev-lang/nasm )

@ -1,2 +1 @@
DIST OpenCV-2.4.3.tar.bz2 67240491 SHA256 f8fbe985978d4eae73e8c3b526ed40a37d4761d2029a5b035233f58146f6f59b SHA512 5305e726089f3f43b2bac06b09e2b5f021c63421ba0b36eeb10e43a067a6954569fccb5a66ff8971e83ffb2c3829df222b74e6a33117f85286b3389e5add232e WHIRLPOOL a384e7d09ac31638bb4bc93c2c7c6b2bc88d0344a494d44d53110528a1abb84250b7979c46d3be55891b61b952ed780f10cee41478bdb906357d80bf52f52b57
DIST opencv-2.4.5.tar.gz 81884985 SHA256 d30beecf4b57977fbd1635af54c5ab3fc00113e9e59a9d58081732260fe06292 SHA512 2e0ab19203cc5d3a4d83633ee9762441d0d12128752edecb351b3c4abddc1714baf4b320b161f8b58e771933506bfa5a192d394a3b6b5b63d914923c6a767a08 WHIRLPOOL 117551edab5837a9382a6d84dec7f84fb693485e3cad7c08d38158baa22951381eb4958caaaa910dcef6ee2b78a0a494d732d0cac88cd18f1f6ebc2d30e3ddf0

@ -1,182 +0,0 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-libs/opencv/opencv-2.4.3.ebuild,v 1.8 2013/04/06 10:17:50 dilfridge Exp $
EAPI=4
PYTHON_DEPEND="2:2.6"
inherit base toolchain-funcs cmake-utils python
MY_P=OpenCV-${PV}
DESCRIPTION="A collection of algorithms and sample code for various computer vision problems"
HOMEPAGE="http://opencv.willowgarage.com"
SRC_URI="mirror://sourceforge/${PN}library/${MY_P}.tar.bz2"
LICENSE="BSD"
SLOT="0"
KEYWORDS="amd64 ppc x86 ~amd64-linux"
IUSE="cuda doc eigen examples ffmpeg gstreamer gtk ieee1394 ipp jpeg jpeg2k opencl openexr opengl pch png qt4 testprograms threads tiff v4l xine"
RDEPEND="
app-arch/bzip2
dev-python/numpy
sys-libs/zlib
cuda? ( >=dev-util/nvidia-cuda-toolkit-4.2 )
eigen? ( dev-cpp/eigen:2 )
ffmpeg? ( virtual/ffmpeg )
gstreamer? (
media-libs/gstreamer:0.10
media-libs/gst-plugins-base:0.10
)
gtk? (
dev-libs/glib:2
x11-libs/gtk+:2
)
jpeg? ( virtual/jpeg )
jpeg2k? ( media-libs/jasper )
ieee1394? (
media-libs/libdc1394
sys-libs/libraw1394
)
ipp? ( sci-libs/ipp )
opencl? ( virtual/opencl )
openexr? ( media-libs/openexr )
opengl? ( virtual/glu )
png? ( media-libs/libpng:0 )
qt4? (
dev-qt/qtgui:4
dev-qt/qttest:4
opengl? ( dev-qt/qtopengl:4 )
)
threads? ( dev-cpp/tbb )
tiff? ( media-libs/tiff )
v4l? ( >=media-libs/libv4l-0.8.3 )
xine? ( media-libs/xine-lib )
"
DEPEND="${RDEPEND}
virtual/pkgconfig
"
# REQUIRED_USE="opengl? ( qt )"
PATCHES=(
"${FILESDIR}/${PN}-2.3.1a-libav-0.7.patch"
"${FILESDIR}/${PN}-2.4.3-gcc47.patch"
"${FILESDIR}/${PN}-2.4.2-cflags.patch"
)
S=${WORKDIR}/${MY_P}
pkg_setup() {
python_set_active_version 2
python_pkg_setup
}
src_prepare() {
base_src_prepare
# remove bundled stuff
rm -rf 3rdparty
sed -i \
-e '/add_subdirectory(3rdparty)/ d' \
CMakeLists.txt || die
}
src_configure() {
# please dont sort here, order is the same as in CMakeLists.txt
local mycmakeargs=(
# the optinal dependency libraries
$(cmake-utils_use_with ieee1394 1394)
-DWITH_AVFOUNDATION=OFF
-DWITH_CARBON=OFF
$(cmake-utils_use_with eigen)
$(cmake-utils_use_with ffmpeg)
$(cmake-utils_use_with gstreamer)
$(cmake-utils_use_with gtk)
$(cmake-utils_use_with ipp)
$(cmake-utils_use_with jpeg2k JASPER)
$(cmake-utils_use_with jpeg)
$(cmake-utils_use_with opencl)
# $(cmake-utils_use_with opencl OPENCLAMDFFT)
# $(cmake-utils_use_with opencl OPENCLAMDBLAS)
$(cmake-utils_use_with openexr)
$(cmake-utils_use_with opengl)
-DWITH_OPENNI=OFF # not packaged
$(cmake-utils_use_with png)
-DWITH_PVAPI=OFF # not packaged
$(cmake-utils_use_with qt4 QT)
-DWITH_QUICKTIME=OFF
$(cmake-utils_use_with threads TBB)
$(cmake-utils_use_with tiff)
-DWITH_UNICAP=OFF # not packaged
$(cmake-utils_use_with v4l V4L)
-DWITH_VIDEOINPUT=OFF # windows only
-DWITH_XIMEA=OFF # windows only
$(cmake-utils_use_with xine)
# the build components
-DBUILD_SHARED_LIBS=ON
-DBUILD_ANDROID_EXAMPLES=OFF
$(cmake-utils_use_build doc DOCS)
$(cmake-utils_use_build examples)
-DBUILD_PERF_TESTS=OFF
$(cmake-utils_use_build testprograms TESTS)
# install examples
$(cmake-utils_use examples INSTALL_C_EXAMPLES)
# build options
$(cmake-utils_use_enable pch PRECOMPILED_HEADERS)
-DENABLE_OMIT_FRAME_POINTER=OFF #
-DENABLE_FAST_MATH=OFF #
-DENABLE_SSE=OFF # these options do nothing but
-DENABLE_SSE2=OFF # add params to CFLAGS
-DENABLE_SSE3=OFF
-DENABLE_SSSE3=OFF
-DENABLE_SSE41=OFF
-DENABLE_SSE42=OFF
-DOPENCV_EXTRA_FLAGS_RELEASE="" # black magic
)
if use cuda; then
if [[ "$(gcc-version)" > "4.6" ]]; then
ewarn "CUDA and >=sys-devel/gcc-4.7 do not play well together. Disabling CUDA support."
mycmakeargs+=( "-DWITH_CUDA=OFF" )
mycmakeargs+=( "-DWITH_CUBLAS=OFF" )
mycmakeargs+=( "-DWITH_CUFFT=OFF" )
else
mycmakeargs+=( "-DWITH_CUDA=ON" )
mycmakeargs+=( "-DWITH_CUBLAS=ON" )
mycmakeargs+=( "-DWITH_CUFFT=ON" )
fi
else
mycmakeargs+=( "-DWITH_CUDA=OFF" )
mycmakeargs+=( "-DWITH_CUBLAS=OFF" )
mycmakeargs+=( "-DWITH_CUFFT=OFF" )
fi
if use examples; then
mycmakeargs+=( "-DINSTALL_PYTHON_EXAMPLES=ON" )
else
mycmakeargs+=( "-DINSTALL_PYTHON_EXAMPLES=OFF" )
fi
# things we want to be hard off or not yet figured out
mycmakeargs+=(
"-DOPENCV_BUILD_3RDPARTY_LIBS=OFF"
"-DBUILD_LATEX_DOCS=OFF"
"-DBUILD_PACKAGE=OFF"
"-DENABLE_PROFILING=OFF"
)
# things we want to be hard enabled not worth useflag
mycmakeargs+=(
"-DCMAKE_SKIP_RPATH=ON"
"-DOPENCV_DOC_INSTALL_PATH=${EPREFIX}/usr/share/doc/${PF}"
)
# hardcode cuda paths
mycmakeargs+=(
"-DCUDA_NPP_LIBRARY_ROOT_DIR=/opt/cuda"
)
cmake-utils_src_configure
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save