blob: 486969422c02e469dc8f9a3474375fd7a4722971 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Guile is the GNU Ubiquitous Intelligent Language for Extensions"
2DESCRIPTION = "Guile is the GNU Ubiquitous Intelligent Language for Extensions,\
3 the official extension language for the GNU operating system.\
4 Guile is a library designed to help programmers create flexible applications.\
5 Using Guile in an application allows the application's functionality to be\
6 extended by users or other programmers with plug-ins, modules, or scripts.\
7 Guile provides what might be described as 'practical software freedom,'\
8 making it possible for users to customize an application to meet their\
9 needs without digging into the application's internals."
10
11HOMEPAGE = "http://www.gnu.org/software/guile/"
12SECTION = "devel"
13LICENSE = "GPLv3"
14LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
15
16SRC_URI = "${GNU_MIRROR}/guile/guile-${PV}.tar.xz \
17 file://debian/0002-Mark-Unused-modules-are-removed-gc-test-as-unresolve.patch \
18 file://debian/0003-Mark-mutex-with-owner-not-retained-threads-test-as-u.patch \
19 file://opensuse/guile-64bit.patch \
20 file://guile_2.0.6_fix_sed_error.patch \
21 file://arm_endianness.patch \
22 file://arm_aarch64.patch \
23 file://workaround-ice-ssa-corruption.patch \
24 file://libguile-Makefile.am-hook.patch \
25 file://libguile-VM-ASM_MUL-for-ARM-Add-earlyclobber.patch \
26 "
27
28# file://debian/0001-Change-guile-to-guile-X.Y-for-info-pages.patch
29# file://opensuse/guile-turn-off-gc-test.patch
30
31SRC_URI[md5sum] = "03f1bce1a4983076d955003472306a13"
32SRC_URI[sha256sum] = "aed0a4a6db4e310cbdfeb3613fa6f86fddc91ef624c1e3f8937a6304c69103e2"
33
34
35inherit autotools gettext pkgconfig texinfo
36BBCLASSEXTEND = "native"
37
38DEPENDS = "libunistring bdwgc gmp libtool libffi ncurses readline"
39# add guile-native only to the target recipe's DEPENDS
40DEPENDS_append_class-target = " guile-native libatomic-ops"
41
42RDEPENDS_${PN}_append_libc-glibc_class-target = "glibc-gconv-iso8859-1"
43
44EXTRA_OECONF += "${@['--without-libltdl-prefix --without-libgmp-prefix --without-libreadline-prefix', ''][bb.data.inherits_class('native',d)]}"
45
46EXTRA_OECONF_append_class-target = " --with-libunistring-prefix=${STAGING_LIBDIR} \
47 --with-libgmp-prefix=${STAGING_LIBDIR} \
48 --with-libltdl-prefix=${STAGING_LIBDIR}"
49
50do_configure_prepend() {
51 mkdir -p po
52}
53
54export GUILE_FOR_BUILD="${BUILD_SYS}-guile"
55
56do_compile_append() {
57 # just for target recipe
58 if [ "${PN}" = "guile" ]
59 then
60 sed -i -e s:${STAGING_DIR_TARGET}::g \
61 -e s:/${TARGET_SYS}::g \
62 -e s:-L/usr/lib::g \
63 -e s:-isystem/usr/include::g \
64 -e s:,/usr/lib:,\$\{libdir\}:g \
65 meta/guile-2.0.pc
66 fi
67}
68
69do_install_append_class-native() {
70 install -m 0755 ${D}${bindir}/guile ${D}${bindir}/${HOST_SYS}-guile
71
72 create_wrapper ${D}/${bindir}/guile \
73 GUILE_LOAD_PATH=${STAGING_DATADIR_NATIVE}/guile/2.0 \
74 GUILE_LOAD_COMPILED_PATH=${STAGING_LIBDIR_NATIVE}/guile/2.0/ccache
75 create_wrapper ${D}${bindir}/${HOST_SYS}-guile \
76 GUILE_LOAD_PATH=${STAGING_DATADIR_NATIVE}/guile/2.0 \
77 GUILE_LOAD_COMPILED_PATH=${STAGING_LIBDIR_NATIVE}/guile/2.0/ccache
78}
79
80SYSROOT_PREPROCESS_FUNCS = "guile_cross_config"
81
82guile_cross_config() {
83 # this is only for target recipe
84 if [ "${PN}" = "guile" ]
85 then
86 # Create guile-config returning target values instead of native values
87 install -d ${SYSROOT_DESTDIR}${STAGING_BINDIR_CROSS}
88 echo '#!'`which ${BUILD_SYS}-guile`$' \\\n--no-auto-compile -e main -s\n!#\n(define %guile-build-info '\'\( \
89 > ${B}/guile-config.cross
90 sed -n -e 's:^[ \t]*{[ \t]*": (:' \
91 -e 's:",[ \t]*": . ":' \
92 -e 's:" *}, *\\:"):' \
93 -e 's:^.*cachedir.*$::' \
94 -e '/^ (/p' \
95 < ${B}/libguile/libpath.h >> ${B}/guile-config.cross
96 echo '))' >> ${B}/guile-config.cross
97 cat ${B}/meta/guile-config >> ${B}/guile-config.cross
98 install ${B}/guile-config.cross ${STAGING_BINDIR_CROSS}/guile-config
99 fi
100}
101
102# Guile needs the compiled files to be newer than the source, and it won't
103# auto-compile into the prefix even if it can write there, so touch them here as
104# sysroot is managed.
105SSTATEPOSTINSTFUNCS += "guile_sstate_postinst"
106guile_sstate_postinst() {
107 if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
108 then
109 find ${STAGING_DIR_TARGET}/${libdir}/guile/2.0/ccache -type f | xargs touch
110 fi
111}