blob: 6cefe664964e152151955d5c319a9076b4d69b7b [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 \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050026 file://remove_strcase_l_funcs.patch \
27 file://0001-libguile-Check-for-strtol_l-during-configure.patch \
28 file://0002-Recognize-nios2-as-compilation-target.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050029 "
30
31# file://debian/0001-Change-guile-to-guile-X.Y-for-info-pages.patch
32# file://opensuse/guile-turn-off-gc-test.patch
33
34SRC_URI[md5sum] = "03f1bce1a4983076d955003472306a13"
35SRC_URI[sha256sum] = "aed0a4a6db4e310cbdfeb3613fa6f86fddc91ef624c1e3f8937a6304c69103e2"
36
37
38inherit autotools gettext pkgconfig texinfo
39BBCLASSEXTEND = "native"
40
41DEPENDS = "libunistring bdwgc gmp libtool libffi ncurses readline"
42# add guile-native only to the target recipe's DEPENDS
43DEPENDS_append_class-target = " guile-native libatomic-ops"
44
Patrick Williamsf1e5d692016-03-30 15:21:19 -050045# The comment of the script guile-config said it has been deprecated but we should
46# at least add the required dependency to make it work since we still provide the script.
47RDEPENDS_${PN} = "pkgconfig"
48
49RDEPENDS_${PN}_append_libc-glibc_class-target = " glibc-gconv-iso8859-1"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050050
51EXTRA_OECONF += "${@['--without-libltdl-prefix --without-libgmp-prefix --without-libreadline-prefix', ''][bb.data.inherits_class('native',d)]}"
52
53EXTRA_OECONF_append_class-target = " --with-libunistring-prefix=${STAGING_LIBDIR} \
54 --with-libgmp-prefix=${STAGING_LIBDIR} \
55 --with-libltdl-prefix=${STAGING_LIBDIR}"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050056EXTRA_OECONF_append_libc-uclibc = " guile_cv_use_csqrt=no "
57
58CFLAGS_append_libc-musl = " -DHAVE_GC_SET_FINALIZER_NOTIFIER \
59 -DHAVE_GC_GET_HEAP_USAGE_SAFE \
60 -DHAVE_GC_GET_FREE_SPACE_DIVISOR \
61 -DHAVE_GC_SET_FINALIZE_ON_DEMAND \
62 "
Patrick Williamsc124f4f2015-09-15 14:41:29 -050063
64do_configure_prepend() {
65 mkdir -p po
66}
67
68export GUILE_FOR_BUILD="${BUILD_SYS}-guile"
69
Patrick Williamsc124f4f2015-09-15 14:41:29 -050070do_install_append_class-native() {
71 install -m 0755 ${D}${bindir}/guile ${D}${bindir}/${HOST_SYS}-guile
72
73 create_wrapper ${D}/${bindir}/guile \
74 GUILE_LOAD_PATH=${STAGING_DATADIR_NATIVE}/guile/2.0 \
75 GUILE_LOAD_COMPILED_PATH=${STAGING_LIBDIR_NATIVE}/guile/2.0/ccache
76 create_wrapper ${D}${bindir}/${HOST_SYS}-guile \
77 GUILE_LOAD_PATH=${STAGING_DATADIR_NATIVE}/guile/2.0 \
78 GUILE_LOAD_COMPILED_PATH=${STAGING_LIBDIR_NATIVE}/guile/2.0/ccache
79}
80
Patrick Williamsf1e5d692016-03-30 15:21:19 -050081do_install_append_class-target() {
82 # cleanup buildpaths in scripts
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050083 sed -i -e 's:${STAGING_DIR_NATIVE}::' ${D}${bindir}/guile-config
84 sed -i -e 's:${STAGING_DIR_HOST}::' ${D}${bindir}/guile-snarf
85
86 sed -i -e 's:${STAGING_DIR_TARGET}::g' ${D}${libdir}/pkgconfig/guile-2.0.pc
87}
88
89do_install_append_libc-musl() {
90 rm -f ${D}${libdir}/charset.alias
Patrick Williamsf1e5d692016-03-30 15:21:19 -050091}
92
Patrick Williamsc124f4f2015-09-15 14:41:29 -050093SYSROOT_PREPROCESS_FUNCS = "guile_cross_config"
94
95guile_cross_config() {
96 # this is only for target recipe
97 if [ "${PN}" = "guile" ]
98 then
99 # Create guile-config returning target values instead of native values
100 install -d ${SYSROOT_DESTDIR}${STAGING_BINDIR_CROSS}
101 echo '#!'`which ${BUILD_SYS}-guile`$' \\\n--no-auto-compile -e main -s\n!#\n(define %guile-build-info '\'\( \
102 > ${B}/guile-config.cross
103 sed -n -e 's:^[ \t]*{[ \t]*": (:' \
104 -e 's:",[ \t]*": . ":' \
105 -e 's:" *}, *\\:"):' \
106 -e 's:^.*cachedir.*$::' \
107 -e '/^ (/p' \
108 < ${B}/libguile/libpath.h >> ${B}/guile-config.cross
109 echo '))' >> ${B}/guile-config.cross
110 cat ${B}/meta/guile-config >> ${B}/guile-config.cross
111 install ${B}/guile-config.cross ${STAGING_BINDIR_CROSS}/guile-config
112 fi
113}
114
115# Guile needs the compiled files to be newer than the source, and it won't
116# auto-compile into the prefix even if it can write there, so touch them here as
117# sysroot is managed.
118SSTATEPOSTINSTFUNCS += "guile_sstate_postinst"
119guile_sstate_postinst() {
120 if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
121 then
122 find ${STAGING_DIR_TARGET}/${libdir}/guile/2.0/ccache -type f | xargs touch
123 fi
124}
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500125
126# http://errors.yoctoproject.org/Errors/Details/20491/
127ARM_INSTRUCTION_SET_armv4 = "arm"
128ARM_INSTRUCTION_SET_armv5 = "arm"