You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.7 KiB
63 lines
1.7 KiB
3 years ago
|
# Copyright 2021 Gentoo Authors
|
||
5 years ago
|
# Distributed under the terms of the GNU General Public License v2
|
||
|
|
||
|
EAPI=7
|
||
|
|
||
|
inherit flag-o-matic
|
||
|
|
||
|
DESCRIPTION="A dynamic Lisp dialect and bytecode vm"
|
||
|
HOMEPAGE="https://janet-lang.org https://github.com/janet-lang/janet/"
|
||
|
SRC_URI="https://github.com/janet-lang/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
||
|
|
||
|
LICENSE="MIT"
|
||
|
SLOT="0"
|
||
|
KEYWORDS="~amd64 ~x86"
|
||
|
IUSE="static-libs"
|
||
|
|
||
4 years ago
|
MY_RELEASE="${PV::-2}"
|
||
|
|
||
5 years ago
|
src_configure() {
|
||
4 years ago
|
append-ldflags -Wl,-soname,libjanet.so.1.${MY_RELEASE}
|
||
4 years ago
|
append-cflags -fPIC
|
||
5 years ago
|
}
|
||
|
|
||
|
src_compile() {
|
||
|
# janet_build is the git hash of the commit related to the
|
||
|
# current release - it defines a constant which is then shown
|
||
|
# when starting janet
|
||
3 years ago
|
local janet_build='\"1.15.5\"'
|
||
4 years ago
|
emake LIBDIR="/usr/$(get_libdir)" PREFIX="/usr" JANET_BUILD="${janet_build}"
|
||
|
emake LIBDIR="/usr/$(get_libdir)" PREFIX="/usr" build/janet.pc JANET_BUILD="${janet_build}"
|
||
|
emake LIBDIR="/usr/$(get_libdir)" PREFIX="/usr" docs JANET_BUILD="${janet_build}"
|
||
|
emake LIBDIR="/usr/$(get_libdir)" PREFIX="/usr" build/jpm JANET_BUILD="${janet_build}"
|
||
5 years ago
|
}
|
||
|
|
||
|
src_install() {
|
||
|
dobin "build/janet"
|
||
4 years ago
|
dobin "build/jpm"
|
||
4 years ago
|
insinto "usr/include/janet"
|
||
5 years ago
|
doheader "src/include/janet.h"
|
||
|
doheader "src/conf/janetconf.h"
|
||
|
|
||
|
dolib.so "build/libjanet.so"
|
||
4 years ago
|
dosym libjanet.so /usr/$(get_libdir)/libjanet.so.${MY_RELEASE}
|
||
|
dosym libjanet.so.${MY_RELEASE} /usr/$(get_libdir)/libjanet.so.${PV}
|
||
5 years ago
|
|
||
|
if use static-libs; then
|
||
|
dolib.a "build/libjanet.a"
|
||
|
fi
|
||
|
doman "janet.1"
|
||
|
doman "jpm.1"
|
||
|
|
||
|
insinto /usr/$(get_libdir)/pkgconfig/
|
||
|
doins "build/janet.pc"
|
||
|
dodoc -r examples
|
||
|
dodoc "build/doc.html"
|
||
4 years ago
|
# required for jpm
|
||
|
keepdir /usr/$(get_libdir)/janet/.cache
|
||
|
}
|
||
|
|
||
|
pkg_postinst() {
|
||
|
elog "Enable use flag \"static-libs\" for building stand-alone executables with jpm"
|
||
5 years ago
|
}
|