dev-scheme/racket: add personal and ::gentoo fixes

Package-Manager: Portage-3.0.18, Repoman-3.0.2
Signed-off-by: Maciej Barć <xgqt@riseup.net>
This commit is contained in:
Maciej Barć 2021-05-03 17:02:49 +02:00
parent 502f63d2cc
commit 9301ad2c63
No known key found for this signature in database
GPG Key ID: 031C9FE65BED714A
2 changed files with 77 additions and 61 deletions

View File

@ -1,25 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata> <pkgmetadata>
<maintainer type="person"> <maintainer type="person">
<email>xgqt@protonmail.com</email> <email>xgqt@protonmail.com</email>
<name>Maciej Barć</name> <name>Maciej Barć</name>
</maintainer> </maintainer>
<use> <longdescription lang="en">
<flag name="futures"> Racket's interactive mode encourages experimentation, and quick scripts
Enable racket/future library for fine-grained hardware parallelism easily compose into larger systems. Small scripts and large systems both
</flag> benefit from native-code JIT compilation. When a system gets too big to
<flag name="graphics"> keep in your head, you can add static types.
Enable support for graphics Extend Racket whenever you need to. Mold it to better suit your tasks
</flag> without sacrificing interoperability with existing libraries and without
<flag name="places"> having to modify the tool chain. When less is more, you can remove parts
Enable racket/place library for share-nothing parallelism and message-passing communication. Compared to futures, places are heavyweight, but they have a simpler performance model. of a language or start over and build a new one.
</flag> Whether you're just starting out, want to know more about programming
<flag name="threads"> language applications or models, looking to expand your horizons, or
Enable support for green threads ready to dive into research, Racket can help you become a better
</flag> programmer and system builder.
</use> </longdescription>
<upstream> <use>
<remote-id type="github">racket/racket</remote-id> <flag name="chez">
</upstream> Build Racket on Chez (Racket CS)
</flag>
<flag name="futures">
Enable racket/future library for fine-grained hardware parallelism
</flag>
<flag name="graphics">
Enable support for graphics
</flag>
<flag name="places">
Enable racket/place library for share-nothing parallelism and message-passing communication. Compared to futures, places are heavyweight, but they have a simpler performance model.
</flag>
<flag name="threads">
Enable support for green threads
</flag>
</use>
<upstream>
<remote-id type="github">racket/racket</remote-id>
</upstream>
</pkgmetadata> </pkgmetadata>

View File

@ -12,45 +12,43 @@ SRC_URI="
!minimal? ( https://download.racket-lang.org/installers/${PV}/${P}-src-builtpkgs.tgz ) !minimal? ( https://download.racket-lang.org/installers/${PV}/${P}-src-builtpkgs.tgz )
" "
RESTRICT="mirror" # See https://blog.racket-lang.org/2019/11/completing-racket-s-relicensing-effort.html
LICENSE="GPL-3+ LGPL-3" LICENSE="
|| ( MIT Apache-2.0 )
chez? ( Apache-2.0 )
!chez? ( LGPL-3 )
"
SLOT="0" SLOT="0"
KEYWORDS="~amd64" KEYWORDS="~amd64"
IUSE="X +doc +futures +graphics +jit minimal +places +readline +threads" IUSE="X +chez +doc +futures +jit minimal +places +readline +threads"
REQUIRED_USE=" REQUIRED_USE="futures? ( jit )"
X? ( graphics )
futures? ( jit )
"
RDEPEND=" DEPEND="
!dev-tex/slatex !dev-tex/slatex
dev-db/sqlite:3 dev-db/sqlite:3
dev-libs/libffi dev-libs/libffi
X? ( X? (
dev-util/desktop-file-utils dev-util/desktop-file-utils
media-libs/libpng:0
virtual/jpeg:0
x11-libs/cairo[X]
x11-libs/gtk+:3[X] x11-libs/gtk+:3[X]
x11-libs/pango[X]
x11-misc/shared-mime-info x11-misc/shared-mime-info
) )
graphics? ( readline? ( dev-libs/libedit )
media-libs/libpng:0
virtual/jpeg:0
x11-libs/cairo[X?]
x11-libs/pango[X?]
)
readline? ( dev-libs/libedit )
" "
DEPEND="${RDEPEND}" RDEPEND="${DEPEND}"
S="${WORKDIR}/${P}/src" S="${WORKDIR}/${P}/src"
X_xdg_update() { # BC library is being stripped unconditionally
if use X; then QA_PRESTRIPPED="/usr/lib64/libracket3m-8.0.so"
xdg_desktop_database_update
xdg_icon_cache_update
fi
}
src_prepare() { src_prepare() {
unset PLTUSERHOME
xdg_environment_reset
default default
rm -r ./bc/foreign/libffi || die "failed to remove bundled libffi" rm -r ./bc/foreign/libffi || die "failed to remove bundled libffi"
@ -64,12 +62,12 @@ src_configure() {
local myconf=( local myconf=(
--disable-libs --disable-libs
--disable-strip --disable-strip
--docdir="${EPREFIX}"/usr/share/doc/${PF} --docdir="${EPREFIX}/usr/share/doc/${PF}"
--enable-bc
--enable-float --enable-float
--enable-foreign --enable-foreign
--enable-libffi --enable-libffi
--enable-shared --enable-shared
$(usex chez "--enable-cs --enable-csonly" "--enable-bc --enable-bconly")
$(use_enable X gracket) $(use_enable X gracket)
$(use_enable doc docs) $(use_enable doc docs)
$(use_enable jit) $(use_enable jit)
@ -81,21 +79,23 @@ src_configure() {
} }
src_compile() { src_compile() {
if use jit; then if use jit && ! use chez; then
# When the JIT is enabled, a few binaries need to be pax-marked # When the JIT is enabled, a few binaries need to be pax-marked
# on hardened systems (bug 613634). The trick is to pax-mark # on hardened systems (bug 613634). The trick is to pax-mark
# them before they're used later in the build system. The # them before they're used later in the build system. The
# following order for racketcgc and racket3m was determined by # following order for racketcgc and racket3m was determined by
# digging through the Makefile in src/racket to find out which # digging through the Makefile in src/racket to find out which
# targets would build those binaries but not use them. # targets would build those binaries but not use them.
pushd ./bc pushd ./bc || die
emake cgc-core emake cgc-core
pax-mark m .libs/racketcgc pax-mark m .libs/racketcgc
pushd ./gc2
pushd ./gc2 || die
emake all emake all
popd popd || die
pax-mark m .libs/racket3m pax-mark m .libs/racket3m
popd popd || die
fi fi
default default
@ -104,15 +104,7 @@ src_compile() {
src_install() { src_install() {
default default
# bin -> binbc ; remove this when we use Chez if use jit; then
pushd "${D}/usr/bin"
for b in *bc; do
ln -s "${b}" "${b%bc*}"
done
popd
if use jit
then
# The final binaries need to be pax-marked, too, if you want to # The final binaries need to be pax-marked, too, if you want to
# actually use them. The src_compile marking get lost somewhere # actually use them. The src_compile marking get lost somewhere
# in the install process. # in the install process.
@ -121,6 +113,7 @@ src_install() {
pax-mark m "${D}/usr/bin/${f}" pax-mark m "${D}/usr/bin/${f}"
done done
pax-mark m "${D}/usr/$(get_libdir)/racket/starter"
use X && pax-mark m "${D}/usr/$(get_libdir)/racket/gracket" use X && pax-mark m "${D}/usr/$(get_libdir)/racket/gracket"
fi fi
@ -140,9 +133,15 @@ src_install() {
} }
pkg_postinst() { pkg_postinst() {
X_xdg_update if use X; then
xdg_desktop_database_update
xdg_icon_cache_update
fi
} }
pkg_postrm() { pkg_postrm() {
X_xdg_update if use X; then
xdg_desktop_database_update
xdg_icon_cache_update
fi
} }