Brad Bishop | 868407c | 2019-11-04 13:24:47 -0500 | [diff] [blame] | 1 | require ${BPN}.inc |
| 2 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 3 | FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}-native:" |
Brad Bishop | 868407c | 2019-11-04 13:24:47 -0500 | [diff] [blame] | 4 | |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame^] | 5 | inherit meson pkgconfig native |
Brad Bishop | 868407c | 2019-11-04 13:24:47 -0500 | [diff] [blame] | 6 | |
| 7 | DEPENDS += " \ |
| 8 | meson-native \ |
| 9 | glib-2.0-native \ |
| 10 | lcms-native \ |
| 11 | " |
| 12 | |
| 13 | SRC_URI += " \ |
| 14 | file://0001-Move-the-function-cd_icc_create_from_edid-to-avoid-u.patch \ |
| 15 | file://Makefile;subdir=${BPN}-${PV} \ |
| 16 | " |
| 17 | |
| 18 | do_configure() { |
| 19 | # we expect meson to fail - but before it extracts project's version in log file |
| 20 | meson ${MESONOPTS} "${MESON_SOURCEPATH}" "${B}" ${MESON_CROSS_FILE} ${EXTRA_OEMESON} > /dev/null 2>&1 || true |
| 21 | |
| 22 | # extract and split version |
| 23 | version=`grep 'Project version:' ${B}/meson-logs/meson-log.txt | sed 's|Project version: ||'` |
| 24 | major=`echo $version | cut -d. -f1` |
| 25 | minor=`echo $version | cut -d. -f2` |
| 26 | micro=`echo $version | cut -d. -f3` |
| 27 | echo "Project version: $major.$minor.$micro" |
| 28 | |
| 29 | # extract project name |
| 30 | proj_name=`grep 'Project name:' ${B}/meson-logs/meson-log.txt | sed 's|Project name: ||'` |
| 31 | |
| 32 | # create cd-version.h |
| 33 | mkdir -p ${B}/colord |
| 34 | sed ${S}/lib/colord/cd-version.h.in \ |
| 35 | -e 's:@CD_MAJOR_VERSION_PRIVATE@:1:g' \ |
| 36 | -e 's:@CD_MINOR_VERSION_PRIVATE@:4:g' \ |
| 37 | -e 's:@CD_MICRO_VERSION_PRIVATE@:4:g' \ |
| 38 | > ${B}/colord/cd-version.h |
| 39 | |
| 40 | # create config.h based on target build and add what's necessary only |
| 41 | localedir=`echo ${datadir}/locale | sed 's:${prefix}/::g'` |
| 42 | echo "#define LOCALEDIR \"$localedir\"" >> ${B}/config.h |
| 43 | echo "#define GETTEXT_PACKAGE \"colord\"" >> ${B}/config.h |
| 44 | echo "#define PACKAGE_NAME \"$proj_name\"" >> ${B}/config.h |
| 45 | echo "#define PACKAGE_VERSION \"$version\"" >> ${B}/config.h |
| 46 | } |
| 47 | |
| 48 | do_compile() { |
| 49 | oe_runmake -C${S} DESTDIR=${B} |
| 50 | } |
| 51 | |
| 52 | do_install() { |
| 53 | version=`grep 'Project version:' ${B}/meson-logs/meson-log.txt | sed 's|Project version: ||'` |
| 54 | major=`echo $version | cut -d. -f1` |
| 55 | |
| 56 | install -d ${D}${libdir} |
| 57 | install -m 755 ${B}/libcolord.so ${D}${libdir}/libcolord.so.$version |
| 58 | ln -s libcolord.so.$version "${D}/${libdir}/libcolord.so" |
| 59 | ln -s libcolord.so.$version "${D}/${libdir}/libcolord.so.$major" |
| 60 | |
| 61 | install -d ${D}${bindir} |
| 62 | install -m 755 ${B}/cd_create_profile ${D}${bindir}/ |
| 63 | install -m 755 ${B}/cd_idt8 ${D}${bindir}/ |
| 64 | } |