|
Line 0
Link Here
|
| 0 |
- |
1 |
# Copyright 1999-2020 Gentoo Authors |
|
|
2 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
|
| 4 |
EAPI=7 |
| 5 |
|
| 6 |
inherit pax-utils |
| 7 |
|
| 8 |
DESCRIPTION="General purpose, multi-paradigm Lisp-Scheme programming language" |
| 9 |
HOMEPAGE="https://racket-lang.org/" |
| 10 |
SRC_URI="minimal? ( https://download.racket-lang.org/installers/${PV}/${PN}-minimal-${PV}-src-builtpkgs.tgz ) !minimal? ( https://download.racket-lang.org/installers/${PV}/${P}-src-builtpkgs.tgz )" |
| 11 |
LICENSE="GPL-3+ LGPL-3" |
| 12 |
SLOT="0" |
| 13 |
KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86" |
| 14 |
IUSE="doc +futures +jit minimal +places +readline +threads +X +chez" |
| 15 |
REQUIRED_USE="futures? ( jit )" |
| 16 |
|
| 17 |
RDEPEND="dev-db/sqlite:3 |
| 18 |
media-libs/libpng:0 |
| 19 |
x11-libs/cairo[X?] |
| 20 |
x11-libs/pango[X?] |
| 21 |
dev-libs/libffi |
| 22 |
virtual/jpeg:0 |
| 23 |
readline? ( dev-libs/libedit ) |
| 24 |
X? ( x11-libs/gtk+[X?] )" |
| 25 |
RDEPEND="${RDEPEND} !dev-tex/slatex" |
| 26 |
|
| 27 |
DEPEND="${RDEPEND}" |
| 28 |
|
| 29 |
S="${WORKDIR}/${P}/src" |
| 30 |
|
| 31 |
src_prepare() { |
| 32 |
default |
| 33 |
rm -r bc/foreign/libffi || die 'failed to remove bundled libffi' |
| 34 |
} |
| 35 |
|
| 36 |
src_configure() { |
| 37 |
# According to vapier, we should use the bundled libtool |
| 38 |
# such that we don't preclude cross-compile. Thus don't use |
| 39 |
# --enable-lt=/usr/bin/libtool |
| 40 |
econf \ |
| 41 |
--enable-shared \ |
| 42 |
--enable-float \ |
| 43 |
--enable-libffi \ |
| 44 |
--enable-foreign \ |
| 45 |
$(usex chez "--enable-cs --enable-csonly" "--enable-bc --enable-bconly") \ |
| 46 |
--disable-libs \ |
| 47 |
--disable-strip \ |
| 48 |
--docdir="/usr/share/doc/${PF}" \ |
| 49 |
$(use_enable X gracket) \ |
| 50 |
$(use_enable doc docs) \ |
| 51 |
$(use_enable jit) \ |
| 52 |
$(use_enable places) \ |
| 53 |
$(use_enable futures) \ |
| 54 |
$(use_enable threads pthread) |
| 55 |
} |
| 56 |
|
| 57 |
src_compile() { |
| 58 |
if use jit; then |
| 59 |
# When the JIT is enabled, a few binaries need to be pax-marked |
| 60 |
# on hardened systems (bug 613634). The trick is to pax-mark |
| 61 |
# them before they're used later in the build system. The |
| 62 |
# following order for racketcgc and racket3m was determined by |
| 63 |
# digging through the Makefile in src/racket to find out which |
| 64 |
# targets would build those binaries but not use them. |
| 65 |
if ! use chez; then |
| 66 |
pushd bc |
| 67 |
emake cgc-core |
| 68 |
pax-mark m .libs/racketcgc |
| 69 |
pushd gc2 |
| 70 |
emake all |
| 71 |
popd |
| 72 |
pax-mark m .libs/racket3m |
| 73 |
popd |
| 74 |
fi |
| 75 |
fi |
| 76 |
|
| 77 |
default |
| 78 |
} |
| 79 |
|
| 80 |
src_install() { |
| 81 |
default |
| 82 |
|
| 83 |
if use jit; then |
| 84 |
# The final binaries need to be pax-marked, too, if you want to |
| 85 |
# actually use them. The src_compile marking get lost somewhere |
| 86 |
# in the install process. |
| 87 |
for f in mred mzscheme racket; do |
| 88 |
pax-mark m "${D}/usr/bin/${f}" |
| 89 |
done |
| 90 |
|
| 91 |
use X && pax-mark m "${D}/usr/$(get_libdir)/racket/gracket" |
| 92 |
|
| 93 |
pax-mark m "${D}/usr/$(get_libdir)/racket/starter" |
| 94 |
fi |
| 95 |
# raco needs decompressed files for packages doc installation bug 662424 |
| 96 |
if use doc; then |
| 97 |
docompress -x /usr/share/doc/${PF} |
| 98 |
fi |
| 99 |
find "${ED}" \( -name "*.a" -o -name "*.la" \) -delete || die |
| 100 |
} |