From 4725be3fcdf9ac4012ec8adea74f284195ee0aae Mon Sep 17 00:00:00 2001 From: Ronan Le Martret Date: Tue, 7 Oct 2014 15:16:20 +0200 Subject: [PATCH] meta-tizen: Add vala recipes Change-Id: If5175169307a517701275688ba193ee840152494 (From meta-tizen rev: 7d9de05698ebf13dfd06d5ee4374236068acdb97) Signed-off-by: Ronan Le Martret Signed-off-by: Patrick Ohly --- ...-gen-don-t-append-dirty-if-we-re-not-in-g.patch | 53 ++++++ .../recipes-tizen/vala/files/Fix-time-stamp.patch | 52 ++++++ meta-tizen/recipes-tizen/vala/vala-extraconf.inc | 5 +- meta-tizen/recipes-tizen/vala/vala.inc | 178 +++++++++++++++++++++ meta-tizen/recipes-tizen/vala/vala_git.bb | 10 ++ 5 files changed, 297 insertions(+), 1 deletion(-) create mode 100644 meta-tizen/recipes-tizen/vala/files/0001-git-version-gen-don-t-append-dirty-if-we-re-not-in-g.patch create mode 100644 meta-tizen/recipes-tizen/vala/files/Fix-time-stamp.patch create mode 100644 meta-tizen/recipes-tizen/vala/vala.inc create mode 100644 meta-tizen/recipes-tizen/vala/vala_git.bb diff --git a/meta-tizen/recipes-tizen/vala/files/0001-git-version-gen-don-t-append-dirty-if-we-re-not-in-g.patch b/meta-tizen/recipes-tizen/vala/files/0001-git-version-gen-don-t-append-dirty-if-we-re-not-in-g.patch new file mode 100644 index 0000000..ca4bba6 --- /dev/null +++ b/meta-tizen/recipes-tizen/vala/files/0001-git-version-gen-don-t-append-dirty-if-we-re-not-in-g.patch @@ -0,0 +1,53 @@ +From 2460d7b79f7e90dcfeebde5e9c53d9b6798a1f3c Mon Sep 17 00:00:00 2001 +From: Martin Jansa +Date: Tue, 21 Feb 2012 17:12:50 +0100 +Subject: [PATCH] meta-tizen: git-version-gen: don't append -dirty if we're not in git + repo + +* for example if we have some dirty directory and we unpack clean vala tarball in it, then it will append -dirty + +Signed-off-by: Martin Jansa +--- + build-aux/git-version-gen | 25 ++++++++++++++----------- + 1 files changed, 14 insertions(+), 11 deletions(-) + +diff --git a/build-aux/git-version-gen b/build-aux/git-version-gen +index 0fa6faa..1d1f9d2 100755 +--- a/build-aux/git-version-gen ++++ b/build-aux/git-version-gen +@@ -126,18 +126,21 @@ fi + + v=`echo "$v" |sed 's/^v//'` + +-# Don't declare a version "dirty" merely because a time stamp has changed. +-git status > /dev/null 2>&1 ++if test -d .git ++then ++ # Don't declare a version "dirty" merely because a time stamp has changed. ++ git status > /dev/null 2>&1 + +-dirty=`sh -c 'git diff-index --name-only HEAD' 2>/dev/null` || dirty= +-case "$dirty" in +- '') ;; +- *) # Append the suffix only if there isn't one already. +- case $v in +- *-dirty) ;; +- *) v="$v-dirty" ;; +- esac ;; +-esac ++ dirty=`sh -c 'git diff-index --name-only HEAD' 2>/dev/null` || dirty= ++ case "$dirty" in ++ '') ;; ++ *) # Append the suffix only if there isn't one already. ++ case $v in ++ *-dirty) ;; ++ *) v="$v-dirty" ;; ++ esac ;; ++ esac ++fi + + # Omit the trailing newline, so that m4_esyscmd can use the result directly. + echo "$v" | tr -d '\012' +-- +1.7.8.4 + diff --git a/meta-tizen/recipes-tizen/vala/files/Fix-time-stamp.patch b/meta-tizen/recipes-tizen/vala/files/Fix-time-stamp.patch new file mode 100644 index 0000000..99d7f00 --- /dev/null +++ b/meta-tizen/recipes-tizen/vala/files/Fix-time-stamp.patch @@ -0,0 +1,52 @@ +diff --git a/ccode/Makefile.am b/ccode/Makefile.am +index eb25f9d..c687282 100644 +--- a/ccode/Makefile.am ++++ b/ccode/Makefile.am +@@ -78,7 +78,7 @@ ccodeinclude_HEADERS = \ + valaccode.h \ + $(NULL) + +-ccode.vapi ccode.vala.stamp: $(libvalaccode_la_VALASOURCES) ++ccode.vapi : $(libvalaccode_la_VALASOURCES) + $(VALA_V)$(VALAC) $(COVERAGE_VALAFLAGS) $(VALAFLAGS) -C --vapidir $(srcdir)/../vapi --pkg gobject-2.0 --vapidir $(srcdir)/../gee --pkg gee --pkg config -H valaccode.h --library ccode $^ + touch $@ + +diff --git a/codegen/Makefile.am b/codegen/Makefile.am +index 33e0c1a..904408f 100644 +--- a/codegen/Makefile.am ++++ b/codegen/Makefile.am +@@ -56,7 +56,7 @@ codegeninclude_HEADERS = \ + valacodegen.h \ + $(NULL) + +-codegen.vapi codegen.vala.stamp: $(libvala_la_VALASOURCES) ++codegen.vapi : $(libvala_la_VALASOURCES) + $(VALA_V)$(VALAC) $(COVERAGE_VALAFLAGS) $(VALAFLAGS) -C --vapidir $(srcdir)/../vapi --pkg gobject-2.0 --vapidir $(srcdir)/../gee --pkg gee --vapidir $(srcdir)/../ccode --pkg ccode --vapidir $(srcdir)/../vala --pkg vala -H valacodegen.h --library codegen $^ + @touch $@ + +diff --git a/gee/Makefile.am b/gee/Makefile.am +index f9ac2fc..b959d98 100644 +--- a/gee/Makefile.am ++++ b/gee/Makefile.am +@@ -35,7 +35,7 @@ geeinclude_HEADERS = \ + valagee.h \ + $(NULL) + +-gee.vapi gee.vala.stamp: $(libgee_la_VALASOURCES) ++gee.vapi : $(libgee_la_VALASOURCES) + $(VALA_V)$(VALAC) $(COVERAGE_VALAFLAGS) $(VALAFLAGS) -C --vapidir $(srcdir)/../vapi --pkg gobject-2.0 -H valagee.h --library gee $^ + @touch $@ + +diff --git a/vala/Makefile.am b/vala/Makefile.am +index ee8d410..c1fb67f 100644 +--- a/vala/Makefile.am ++++ b/vala/Makefile.am +@@ -172,7 +172,7 @@ valainclude_HEADERS = \ + vala.h \ + $(NULL) + +-vala.vapi vala.vala.stamp: $(libvalacore_la_VALASOURCES) ++vala.vapi : $(libvalacore_la_VALASOURCES) + $(VALA_V)$(VALAC) $(COVERAGE_VALAFLAGS) $(VALAFLAGS) -C --vapidir $(srcdir)/../vapi --pkg gobject-2.0 --vapidir $(srcdir)/../gee --pkg gee --pkg config -H vala.h --library vala $^ + @touch $@ + diff --git a/meta-tizen/recipes-tizen/vala/vala-extraconf.inc b/meta-tizen/recipes-tizen/vala/vala-extraconf.inc index a311d59..ed7aa01 100644 --- a/meta-tizen/recipes-tizen/vala/vala-extraconf.inc +++ b/meta-tizen/recipes-tizen/vala/vala-extraconf.inc @@ -1,7 +1,10 @@ -#EXTRA_OECONF = " --with-pic --disable-vapigen" +EXTRA_OECONF = " --with-pic --disable-vapigen" + SRC_URI += " file://0001-git-version-gen-don-t-append-dirty-if-we-re-not-in-g.patch" SRC_URI += " file://Fix-time-stamp.patch" +RDEPENDS_${PN}_remove_class-native = "update-alternatives-native" + do_install_append() { rm -r ${D}${prefix}/share/devhelp } diff --git a/meta-tizen/recipes-tizen/vala/vala.inc b/meta-tizen/recipes-tizen/vala/vala.inc new file mode 100644 index 0000000..f49b722 --- /dev/null +++ b/meta-tizen/recipes-tizen/vala/vala.inc @@ -0,0 +1,178 @@ +DESCRIPTION = "Programming language for GNOME" +HOMEPAGE = "http://live.gnome.org/Vala" +SECTION = "Development/Gnome" +LICENSE = "LGPL-2.0" + +SRC_URI = "" + +S = "${WORKDIR}/git" + +inherit autotools-brokensep + +BBCLASSEXTEND = "" +PROVIDES = "" + +#PROVIDES by libvala +PROVIDES += "libvala" + + +#PROVIDES by vala + + +#PROVIDES by libvala-dev +PROVIDES += "libvala-dev" + + +RDEPENDS = "" +#RDEPENDS of vala (${PN}) +RDEPENDS_${PN} += "update-alternatives" + +#RDEPENDS of libvala-dev (lib${PN}-dev) +RDEPENDS_lib${PN}-dev += "libvala" + + +DEPENDS = "" +#DEPENDS of vala +DEPENDS += "xz" +DEPENDS += "flex" +DEPENDS_append_class-native = " fdupes-native" +DEPENDS_append_class-target = " fdupes-native" +DEPENDS_append_class-native = " bison-native" +DEPENDS_append_class-target = " bison-native" +DEPENDS += "glib-2.0" + +do_prep() { + cd ${S} + chmod -Rf a+rX,u+w,g-w,o-w ${S} + #setup -q + + +} +do_patch_append() { + bb.build.exec_func('do_prep', d) +} + +do_configure() { +} + +do_compile() { + cd ${S} + LANG=C + export LANG + unset DISPLAY + LD_AS_NEEDED=1; export LD_AS_NEEDED ; + + + autotools_do_configure + make -j16 + + + +} +EXTRA_OECONF += " --with-pic --enable-vapigen" + +do_install() { + export RPM_BUILD_ROOT=${D} + cd ${S} + LANG=C + export LANG + unset DISPLAY + rm -rf ${D} + mkdir -p ${D} + + + oe_runmake \ + DESTDIR=${D} \ + INSTALL_ROOT=${D} \ + BINDIR=${prefix}/bin \ + install + rm -f ${D}${infodir}/dir + find ${D} -regex ".*\.la$" | xargs rm -f -- + find ${D} -regex ".*\.a$" | xargs rm -f -- + #fdupes ${D}${prefix}/share + + +} + +pkg_postinst_libvala() { + #!/bin/sh -e + + [ "x$D" == "x" ] && ldconfig +} + +pkg_postinst_${PN}() { + #!/bin/sh -e + + update-alternatives \ + --install $D${prefix}/bin/vala vala $D${prefix}/bin/vala-0.24 \ + 24 \ + --slave $D${prefix}/bin/valac valac $D${prefix}/bin/valac-0.24 \ + --slave $D${prefix}/bin/vala-gen-introspect vala-gen-introspect $D${prefix}/bin/vala-gen-introspect-0.24 \ + --slave $D${prefix}/bin/vapicheck vapicheck $D${prefix}/bin/vapicheck-0.24 \ + --slave $D${prefix}/bin/vapigen vapigen $D${prefix}/bin/vapigen-0.24 \ + --slave ${mandir}/man1/valac.1.gz valac.1.gz ${mandir}/man1/valac-0.24.1.gz \ + --slave ${mandir}/man1/vala-gen-introspect.1.gz vala-gen-introspect.1.gz ${mandir}/man1/vala-gen-introspect-0.24.1.gz \ + --slave ${mandir}/man1/vapigen.1.gz vapigen.1.gz ${mandir}/man1/vapigen-0.24.1.gz \ + --slave $D${prefix}/share/pkgconfig/vapigen.pc vapigen.pc $D${prefix}/share/pkgconfig/vapigen-0.24.pc + +} + +pkg_postrm_${PN}() { + #!/bin/sh -e + + # Note: we don't use "$1 -eq 0", to avoid issues if the package gets renamed + if [ ! -f $D${prefix}/bin/vala-0.24 ]; then + update-alternatives --remove vala $D${prefix}/bin/vala-0.24 + fi + +} + +pkg_postrm_libvala() { + #!/bin/sh -e + + [ "x$D" == "x" ] && ldconfig +} + +PACKAGES = "${PN}-dbg ${PN}-doc ${PN}-locale" +PACKAGES += " libvala " +PACKAGES += " vala " +PACKAGES += " libvala-dev " + +libvala_files = "" +libvala_files += "${prefix}/lib/libvala-0.24.so.*" + +vala_files = "" +vala_files += "${prefix}/bin/vala-0.24" +vala_files += "${prefix}/bin/valac-0.24" +vala_files += "${prefix}/bin/vala-gen-introspect-0.24" +vala_files += "${prefix}/bin/vapicheck-0.24" +vala_files += "${prefix}/bin/vapigen-0.24" +vala_files += "${mandir}/man1/valac-0.24.1*" +vala_files += "${mandir}/man1/vala-gen-introspect-0.24.1*" +vala_files += "${mandir}/man1/vapigen-0.24.1*" +vala_files += "${prefix}/share/aclocal/vala.m4" +vala_files += "${prefix}/share/aclocal/vapigen.m4" +vala_files += "${prefix}/share/pkgconfig/vapigen-0.24.pc" +vala_files += "${prefix}/share/vala" +vala_files += "${prefix}/share/vala/Makefile.vapigen" +vala_files += "${prefix}/share/vala-0.24/" +vala_files += "${prefix}/lib/vala-0.24/" +DIRFILES_${PN} = "" +DIRFILES_${PN} += "${prefix}/share/vala" + +libvala-dev_files = "" +libvala-dev_files += "AUTHORS ChangeLog NEWS README" +libvala-dev_files += "${prefix}/include/vala-0.24/" +libvala-dev_files += "${prefix}/lib/libvala-0.24.so" +libvala-dev_files += "${prefix}/lib/pkgconfig/libvala-0.24.pc" + +FILES_lib${PN} = "${libvala_files}" +FILES_${PN} = "${vala_files}" +FILES_lib${PN}-dev = "${libvala-dev_files}" + +PKG_libvala= "libvala" +PKG_vala= "vala" +PKG_libvala-dev= "libvala-dev" + +require vala-extraconf.inc + diff --git a/meta-tizen/recipes-tizen/vala/vala_git.bb b/meta-tizen/recipes-tizen/vala/vala_git.bb new file mode 100644 index 0000000..6e54c0d --- /dev/null +++ b/meta-tizen/recipes-tizen/vala/vala_git.bb @@ -0,0 +1,10 @@ +require vala.inc + +PRIORITY = "10" + +LIC_FILES_CHKSUM ??= "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" + +SRC_URI += "git://review.tizen.org/platform/upstream/vala;tag=b9dc5bc4a4d841a362bd3252ecac6a927f42ecd5;nobranch=1" + +BBCLASSEXTEND += " native " + -- 2.7.4