# Recipe created by recipetool
# recipetool create -o mmarchitect_0.5.0-c.bb https://downloads.sourceforge.net/project/mmarchitect/c-source/mmarchitect-c-0.5.0.tar.bz2

LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://debian/copyright;md5=2c1b0d2aaaf1206116238e13bac969b8"

SRC_URI = "https://downloads.sourceforge.net/project/mmarchitect/c-source/mmarchitect-c-0.5.0.tar.bz2"
SRC_URI[md5sum] = "9802e5767df6565c044cbe71fe6a6c09"
SRC_URI[sha256sum] = "e960cfe8642d9119e0805f38c113ff5f62606f66652bbd4a911c3739c9228e71"

S = "${WORKDIR}/${BPN}-c-0.5.0"

# NOTE: this is a Makefile-only piece of software.
# BK 170614 note, this pkg is the c-source version, with C code precreated by vala, in folder '.build'
DEPENDS = "gtk+ libgee libpng gdk-pixbuf librsvg cairo libxml2"
inherit pkgconfig gettext

# BK 170614 note, although valac is built by oe, it cannot be used in a build.
# the so-called "c-source" still insists on using valac. broken for now.

do_configure () {
    sed -i -e 's%gee\-1\.0%gee-0.8%' Makefile
    for MMAFILE in Makefile configure.mk '.build/app.c' 'src/config.vala' '.build/config.c' '.build/editform.c' '.build/main.c' '.build/mapwidgets.c' '.build/node.c' '.build/preferences.c' '.build/properties.c' '.build/welcometab.c' 
    do
     sed -i -e 's%/usr/local%/usr%' ${MMAFILE}
    done
    touch 
}

do_compile () {
    oe_runmake
    #for aCFILE main export app preferences import consts filetab editform svgsource clavertime properties print welcometab mindmap mapwidgets export_dialog config node tab tips
    #do
    # ${CC} -c ${aCFILE} ${aCFILE} ${CFLAGS} ${LDFLAGS} `pkg-config --libs gtk-2.0 gdk-2.0` 
    #done
    
}

do_install () {
    oe_runmake install DESTDIR=${D}
}

