maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Madde: How to build/manage third-party libraries? (https://talk.maemo.org/showthread.php?t=48536)

tvogel 2010-03-28 12:47

Madde: How to build/manage third-party libraries?
 
What is the envisioned route for building / managing third-party libraries when developing with madde?
  • install binary deb packages from the repositories (if available)? This again introduces dependency on a Debian based host environment because madde itself doesn't seem to offer a patched/reimplemented dpkg tool for installing into the sysroot.
  • build them on your own? Is madde prepared to install packages to the right location by default? Manual customization needed? This may lead to version inconsistencies with the repository packages

I would really appreciate a way to sync the sysroot to the official SDK packages, preferably without the need to be running madde on a Debian based linux.

How is madde going to integrate with MeeGo style OBS building?

If there is a paper about all this, please point me to it. The madde docs i found are very sparse.

Tilman

arne.anka 2010-03-29 21:47

Re: Madde: How to build/manage third-party libraries?
 
i don't really understand how one could create a development environment w/o considering the need of external libs (yes, Qt is great but it doesn't cover everything).

so far it looks to me, the way to go would be:
- get debian's armel packages for the libs needed, convert them to tar balls with alien and install them somehow
- play around with links, global variables (like LD_LIBRARY_PATH, CFLAGS, ...) and flags like -I or -L

i did not yet go this route, since i got hold of an old laptop which i try to convert in some kind of compiling station (since scratchbox and sdk are not available for 64bit).

all together i really doubt, nokia wants people to develop for maemo at all -- delivering 32bit only, a bunch of chroots, different tools, little up to date software (try to install a recent automake in scratchbox), everything mixed up and hardly documented ...

installing all necessary stuff on the n900 itself should be possible -- theoretically.
but with that crappy busybox and crippled debian i doubt it would really work w/o breaking half of the devices functionality.

why had they to reinvent the wheel and why so badly?

fnordianslip 2010-03-29 21:57

Re: Madde: How to build/manage third-party libraries?
 
Quote:

Originally Posted by arne.anka (Post 587352)
why had they to reinvent the wheel and why so badly?

I think that they've put the Meego train in motion hoping it will have rounder wheels than the ones on the Maemo train.

zimon 2010-03-29 22:09

Re: Madde: How to build/manage third-party libraries?
 
Yes, Maemo is much FUBAR. Too many head cooks. Not enough LSB and freedesktop.org standards obeyed.

Let's hope with a clean start with Meego will get things right.

ChristofferC 2010-03-30 08:43

Re: Madde: How to build/manage third-party libraries?
 
Quote:

Originally Posted by arne.anka (Post 587352)
i did not yet go this route, since i got hold of an old laptop which i try to convert in some kind of compiling station (since scratchbox and sdk are not available for 64bit).

I run the SDK just fine on my 64bit Debian install. Maybe you have to install some 32bit libs on your 64bit system to get it working (32bit libs are in the Debian repos).

As for the question in the OP, just use the SDK instead. MADDE doesn't seem to be very suitable for anything but simple prjects without external dependencies as far as I can tell. At least for now.

tvogel 2010-03-30 09:33

Re: Madde: How to build/manage third-party libraries?
 
Quote:

Originally Posted by ChristofferC (Post 587800)
I run the SDK just fine on my 64bit Debian install. Maybe you have to install some 32bit libs on your 64bit system to get it working (32bit libs are in the Debian repos).
As for the question in the OP, just use the SDK instead. MADDE

Yes, me too (on openSUSE 11.2).

Quote:

Originally Posted by ChristofferC (Post 587800)
As for the question in the OP, just use the SDK instead. MADDE doesn't seem to be very suitable for anything but simple prjects without external dependencies as far as I can tell. At least for now.

Right, and that's why I'd like to get in touch with other MADDE users also with the MADDE developers in order to understand whether this will go into the right direction at all.

Tilman

arne.anka 2010-03-30 10:18

Re: Madde: How to build/manage third-party libraries?
 
Quote:

Originally Posted by fnordianslip (Post 587362)
I think that they've put the Meego train in motion hoping it will have rounder wheels than the ones on the Maemo train.

well, i doubt it.
with maemo they had the opportunity to use a stable well working distribution, debian, and yet they chose to make the worst of it.
now, with meego, as far as i understand, the whole reinventing the wheel starts over again -- and surely they will make all the errors again other distributions made long ago.

heavy case of "not invented here" syndrome.

arne.anka 2010-03-30 10:20

Re: Madde: How to build/manage third-party libraries?
 
Quote:

Originally Posted by ChristofferC (Post 587800)
I run the SDK just fine on my 64bit Debian install. Maybe you have to install some 32bit libs on your 64bit system to get it working (32bit libs are in the Debian repos).

a tad out of scope of this thread -- but did you try to build eg navit?
i am stuck with several errors in the sdk (tools too old and stuff) and don't really see how to solve that.

rontti 2010-03-31 12:03

Re: Madde: How to build/manage third-party libraries?
 
Quote:

Originally Posted by tvogel (Post 585361)
What is the envisioned route for building / managing third-party libraries when developing with madde?
  • install binary deb packages from the repositories (if available)? This again introduces dependency on a Debian based host environment because madde itself doesn't seem to offer a patched/reimplemented dpkg tool for installing into the sysroot.
  • build them on your own? Is madde prepared to install packages to the right location by default? Manual customization needed? This may lead to version inconsistencies with the repository packages

Second bullet is only way right now, with using GCC -I and -L options.
We have thought different solutions for the problem but have not
know good solution yet. If some one have ideas that work in Mac, WIndows and Linux, share those with us, please.


Quote:

How is madde going to integrate with MeeGo style OBS building?
No one knows yet. Or at least MADDE development team members don't know. MADDE develepment team is very small, I and two other people.

Quote:

If there is a paper about all this, please point me to it. The madde docs i found are very sparse.

Tilman
There is no paper available.

arne.anka 2010-03-31 12:32

Re: Madde: How to build/manage third-party libraries?
 
Quote:

Originally Posted by rontti (Post 589638)
We have thought different solutions for the problem but have not
know good solution yet. If some one have ideas that work in Mac, WIndows and Linux, share those with us, please.

i might confuse that with scratchbox, but doesn't MADDE too download tarballs and extracts them into the chroots?
and, basically everything needed should exist in maemo repositories (libs, headers, devel-packages)**.
lastly, the pathes to libs and headers should be directories below the chroots.

thus: what about a script that allows downloading devel packages and libs, converts them to tarballs (either with alien or with ar, since debian packages are nothing but ar archives containing data.tar.gz which is the actual archive we need here) and extracts them into the matching folders? as long as the folders follow the structure maemo uses simply extracting them below a certain folder should be sufficient.

since the apt stuff is mostly perl, the scripts needed to calculate dependencies should be available cross platform and maybe easily adapted to these limited needs.

** after playing around with scratchbox i see that nokia makes a huge secret of their packages (you have to accept some eula, get a number and scratchbox creates an apt line with a lengthy checksum as url part).
not sure how important those packages are and if they would be available to MADDE (is MADDE a nokia project after all?).
still confirms my opinion nokia doesn't like development for maemo.

rontti 2010-03-31 12:43

Re: Madde: How to build/manage third-party libraries?
 
Quote:

Originally Posted by arne.anka (Post 589661)
i might confuse that with scratchbox, but doesn't MADDE too download tarballs and extracts them into the chroots?

Nope, madde does not use chroots. I don't know is that even possible in Windows.

Quote:

thus: what about a script that allows downloading devel packages and libs, converts them to tarballs (either with alien or with ar, since debian packages are nothing but ar archives containing data.tar.gz which is the actual archive we need here) and extracts them into the matching folders? as long as the folders follow the structure maemo uses simply extracting them below a certain folder should be sufficient.
That could be a solution. We also need to change sysroot name when it is changed. Otherwise when you create a target again and sweep out old sysroot you have lost your changes.

Quote:

not sure how important those packages are and if they would be available to MADDE (is MADDE a nokia project after all?).
still confirms my opinion nokia doesn't like development for maemo.
MADDE is nokia project.

mst0 2010-07-28 17:02

Re: Madde: How to build/manage third-party libraries?
 
As I have had the same problem (I need to use libqjson while using MADDE/QtCreator), here is how I solved it (ugly hacks, but well, if there is no official way…):
  • Install libqjson on your device (N900 in my case)
  • In order to type less in the following commands, set a variable with the path to the sysroot:
    Code:

    export SYSR=~/.madde/0.6.72/sysroots/fremantle-arm-sysroot-10.2010.19-1-slim
  • Copy the development headers from your system (or from the device, but then you need to install libqjson-dev there, too) to the sysroot:
    Code:

    cp -r /usr/include/qjson ${SYSR}/usr/include
  • Copy the library itself from the device (to ensure that you got the very same version):
    Code:

    scp n900:/usr/lib/libqjson* ${SYSR}/usr/lib
  • This step is important, otherwise MADDE will just fail when building the debian package, stating "dh_shlibdeps failed": Copy the dpkg meta files from the device:
    Code:

    scp n900:/var/lib/dpkg/info/libqjson.* ${SYSR}/var/lib/dpkg/info/

Then, in the Qt project file, add:
Code:

CONFIG += link_pkgconfig
PKGCONFIG += QJson


dsolbach 2010-11-08 20:16

Re: Madde: How to build/manage third-party libraries?
 
Thanks to w00t_ on irc I found this thread.

I got it to work with w00t_s help, but I had to do 2 extra steps:

install libqjson-dev on the device

and copy the *.pc file so QJson is found when running qmake.

Code:

scp root@n900:/usr/lib/pkgconfig/QJson.pc ${SYSR}/usr/lib/pkgconfig/

admiral0 2011-02-15 16:45

Re: Madde: How to build/manage third-party libraries?
 
Quote:

Originally Posted by dsolbach (Post 867334)
Thanks to w00t_ on irc I found this thread.

I got it to work with w00t_s help, but I had to do 2 extra steps:

install libqjson-dev on the device

and copy the *.pc file so QJson is found when running qmake.

Code:

scp root@n900:/usr/lib/pkgconfig/QJson.pc ${SYSR}/usr/lib/pkgconfig/

Shouldn't be mad with host's QJson.pc

mr_jrt 2011-06-30 14:52

Re: Madde: How to build/manage third-party libraries?
 
For the benefit of others, I also had to copy the record for the dev package from "/var/lib/dpkg/status" on my device into the one in the MADDE environment in order for "dpkg-checkbuilddeps" to succeed.

Creamy Goodness 2012-12-15 07:46

Re: Madde: How to build/manage third-party libraries?
 
Is there another way to do this with the harmattan sdk? I tried all this but it won't work still, it's not adding my lib to the includes. No big deal cuz I can manually add it, but annoying...

never mind, found the command i was looking for (xdpkg)

in my case, running from I:\QtSDK\Madde\wbin
mad set harmattan_10.2011.34-1_rt1.2
mad-admin xdpkg -i something.deb

I get all the way to "dpkg-checkbuilddeps: Unmet build dependencies:" now
:confused:

Ok, xdpkg + manually modify the "status" file works.

frafI 2013-02-12 14:15

Re: Madde: How to build/manage third-party libraries?
 
The following scripts worked for me:
Replace $MADDEROOT with the correct path on your system.
$MADDEROOT/apt/apt.conf:
Code:

APT::Archives::MaxAge "30";
APT::Archives::MinAge "2";
APT::Archives::MaxSize "500";
APT::Architecture "armel";
Dir::Etc::SourceList "$MADDEROOT/apt/sources.list";
Dir::State::Lists "$MADDEROOT/apt/lists";
Dir::Cache::Archives "$MADDEROOT/apt/cache";
DPkg::Options:: {"--admindir=$MADDEROOT/apt/dpkg";};

$MADDEROOT/madbin/apt-get:
Code:

#!/bin/sh

case "$1" in

update)
    /usr/bin/apt-get -c $SYSROOT_DIR/../../apt/apt.conf update
    ;;
install)
    shift
    cd $SYSROOT_DIR/../../apt/cache/
    /usr/bin/apt-get -c $SYSROOT_DIR/../../apt/apt.conf download $*
    for i in *FAILED ; do
        mv $i `basename $i .FAILED`
    done
    for i in *.deb ; do
        mkdir -p $i.tmp
        ar x $i data.tar.gz
        mv data.tar.gz $i.tmp
        cd $i.tmp && tar xf data.tar.gz &&  rm data.tar.gz && cd ..
        rsync -a $i.tmp/ $SYSROOT_DIR/
    done

    ;;
*) echo "mad apt-get (install pkbnames | update)"
  ;;
esac

$MADDEROOT/apt/sources.list:
Code:

deb http://repository.maemo.org/extras/ fremantle free non-free
deb http://repository.maemo.org/extras-testing/ fremantle free non-free
deb http://repository.maemo.org/extras-devel/ fremantle free non-free
#plus whatever you like



All times are GMT. The time now is 22:22.

vBulletin® Version 3.8.8