maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Need help in modifying an existing open source N900 program .. (https://talk.maemo.org/showthread.php?t=67632)

ahmadka 2010-12-30 08:52

Need help in modifying an existing open source N900 program ..
 
Hi all .. Well I want to fix this simple bug in a program called N9Profil .. The author simply can't be bothered I guess, so I just want to fix it myself ..

The code is available here: http://gitorious.org/n9profile

My problem is how exactly do I recompile a program to install on the N900 .. ? Like from the link above I dont download all the code files, make the changes, but then what ? I don't know how to actually make an installer out of the code ..

Any help here would be really appreciated ..

Wikiwide 2010-12-30 09:43

Re: Need help in modifying an existing open source N900 program ..
 
Quote:

Originally Posted by ahmadka (Post 907330)
Hi all .. Well I want to fix this simple bug in a program called N9Profil .. The author simply can't be bothered I guess, so I just want to fix it myself ..

The code is available here: http://gitorious.org/n9profile

My problem is how exactly do I recompile a program to install on the N900 .. ? Like from the link above I dont download all the code files, make the changes, but then what ? I don't know how to actually make an installer out of the code ..

Any help here would be really appreciated ..

Download all these files and folders:
http://gitorious.org/n9profile/n9profile/trees/master
Edit the files you want.
(the package name, version, author are stated in files in debian folder)

Then in scratchbox or in MADDE terminal, MADDE terminal is included into Nokia Qt SDK, in the main directory of source files, run either
dpkg-buildpackage -sa -S
and submit it to Maemo Extras Assistant
https://garage.maemo.org/extras-assi...dex.php?step=2
to have it in extras-devel

or dpkg-buildpackage -sa
and test it on your N900.

EDIT: If you just want to fix a bug, it would be better to contact the developer so that he could incorporate the fix. Of course, you are welcome to test the fix for yourself before showing it to the developer.

ahmadka 2010-12-30 18:05

Re: Need help in modifying an existing open source N900 program ..
 
Its just a simple bug, only one number needs to be replaced with another .. i've tried posting the bug in the program's thread but the author hasn't responded in weeks ..

Anyways, I have Qt Creator which I've been using for my own development .. Is MADDE included in it ? If yes, can you tell me specifically how to use it ? I haven't explicitly used MADDE so far ..

Wikiwide 2010-12-30 21:37

Re: Need help in modifying an existing open source N900 program ..
 
Quote:

Originally Posted by ahmadka (Post 907763)
Its just a simple bug, only one number needs to be replaced with another .. i've tried posting the bug in the program's thread but the author hasn't responded in weeks ..

Anyways, I have Qt Creator which I've been using for my own development .. Is MADDE included in it ? If yes, can you tell me specifically how to use it ? I haven't explicitly used MADDE so far ..

The developer offers to report bugs to his email, jakub.bzouk at Gmail.
http://maemo.org/packages/view/n9profil/

Nokia Qt SDK includes Qt Creator and MADDE Terminal, but Qt Creator doesn't include MADDE Terminal (I think).

When you get all source files downloaded in one directory, open MADDE Terminal and 'cd' to this directory. Then run
dpkg-buildpackage -sa
to build complete deb (which can be tested on N900)
or
dpkg-buildpackage -sa -S
to build source-only package (which can be uploaded to extras-devel)

ahmadka 2010-12-31 03:04

Re: Need help in modifying an existing open source N900 program ..
 
Alright, I just tried what you said and I'm getting the following error:

Code:

MADDE-0.6.46 /d/n9profile-n9profile
Ahmad $ dpkg-buildpackage -sa
sh: dpkg-buildpackage: command not found

I started MADDE from the start menu, and since my Qt Creator works properly (compiles and runs stuff on my N900, etc ..), I'm assuming that MADDE is 'linked' properly too ..

I installed the complete Qt SDK AFAIK ..

Wikiwide 2010-12-31 03:10

Re: Need help in modifying an existing open source N900 program ..
 
Quote:

Originally Posted by ahmadka (Post 908049)
Alright, I just tried what you said and I'm getting the following error:

Code:

MADDE-0.6.46 /d/n9profile-n9profile
Ahmad $ dpkg-buildpackage -sa
sh: dpkg-buildpackage: command not found

I started MADDE from the start menu, and since my Qt Creator works properly (compiles and runs stuff on my N900, etc ..), I'm assuming that MADDE is 'linked' properly too ..

I installed the complete Qt SDK AFAIK ..

You are on the right track, I hope.
Try:
mad dpkg-buildpackage -sa

I have just forgot for a moment MADDE needs mad before many commands.

ahmadka 2010-12-31 03:12

Re: Need help in modifying an existing open source N900 program ..
 
Alright, I just tried this command and now the output is this:

Code:

MADDE-0.6.46 /d/n9profile-n9profile
Ahmad $ mad dpkg-buildpackage -sa
which: pgp: unknown command
dpkg-buildpackage: set CFLAGS to default value: -g -O2
dpkg-buildpackage: set FFLAGS to default value: -g -O2
dpkg-buildpackage: set CPPFLAGS to default value:
dpkg-buildpackage: set LDFLAGS to default value:
dpkg-buildpackage: set CXXFLAGS to default value: -g -O2
dpkg-buildpackage: source package n9profil
dpkg-buildpackage: source version 0.2-0
dpkg-buildpackage: source changed by Jakub Splichal <jakub.bzouk@gmail.com>
dpkg-buildpackage: host architecture armel
 debian/rules clean
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
# Add here commands to clean up after the build process.
/bin/make clean
make[1]: Entering directory `/d/n9profile-n9profile'
make[1]: *** No rule to make target `clean'.  Stop.
make[1]: Leaving directory `/d/n9profile-n9profile'
make: *** [clean] Error 2
dpkg-buildpackage: failure: debian/rules clean gave error exit status 2

Thanks for your help dude :)

MohammadAG 2010-12-31 03:18

Re: Need help in modifying an existing open source N900 program ..
 
Run qmake :)

Wikiwide 2010-12-31 03:25

Re: Need help in modifying an existing open source N900 program ..
 
Quote:

Originally Posted by ahmadka (Post 908053)
Alright, I just tried this command and now the output is this:

Code:

MADDE-0.6.46 /d/n9profile-n9profile
Ahmad $ mad dpkg-buildpackage -sa
which: pgp: unknown command
dpkg-buildpackage: set CFLAGS to default value: -g -O2
dpkg-buildpackage: set FFLAGS to default value: -g -O2
dpkg-buildpackage: set CPPFLAGS to default value:
dpkg-buildpackage: set LDFLAGS to default value:
dpkg-buildpackage: set CXXFLAGS to default value: -g -O2
dpkg-buildpackage: source package n9profil
dpkg-buildpackage: source version 0.2-0
dpkg-buildpackage: source changed by Jakub Splichal <jakub.bzouk@gmail.com>
dpkg-buildpackage: host architecture armel
 debian/rules clean
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
# Add here commands to clean up after the build process.
/bin/make clean
make[1]: Entering directory `/d/n9profile-n9profile'
make[1]: *** No rule to make target `clean'.  Stop.
make[1]: Leaving directory `/d/n9profile-n9profile'
make: *** [clean] Error 2
dpkg-buildpackage: failure: debian/rules clean gave error exit status 2

Thanks for your help dude :)

While editing debian/rules file you made something wrong with 'clean' part of it, it cannot find how to clean the directories before building.

I get:

mad dpkg-buildpackage -sa
which: pgp: unknown command
dpkg-buildpackage: set CFLAGS to default value: -g -O2
dpkg-buildpackage: set FFLAGS to default value: -g -O2
dpkg-buildpackage: set CPPFLAGS to default value:
dpkg-buildpackage: set LDFLAGS to default value:
dpkg-buildpackage: set CXXFLAGS to default value: -g -O2
dpkg-buildpackage: source package n9profil
dpkg-buildpackage: source version 0.1-2
dpkg-buildpackage: source changed by Jakub Splichal <jakub.bzouk@gmail.com>
dpkg-buildpackage: host architecture armel
debian/rules clean
dh_testdir
dh_testroot
rm -f build-stamp
# Add here commands to clean up after the build process.
rm -rf builddir
dh_clean
dpkg-source -b n9profil-0.1
C:\NokiaQtSDK\Maemo\4.6.2\madbin\dpkg-source: info: using source format `1.0'
C:\NokiaQtSDK\Maemo\4.6.2\madbin\dpkg-source: info: building n9profil in n9profil_0.1-2.tar.gz
C:\NokiaQtSDK\Maemo\4.6.2\madbin\dpkg-source: info: building n9profil in n9profil_0.1-2.dsc
debian/rules build


Then it cannot build because it has space in folder path, so I will have to move it somewhere else now.

EDIT:
Quote:

Originally Posted by MohammadAG (Post 908054)
Run qmake :)

I haven't run qmake, and I have 'clean' working.

So, the problem is with some edit.

Oh, yes, I have misread the reply of dpkg-buildpackage:
debian/rules clean
works
while
make clean
doesn't work.

Quote:

Originally Posted by MohammadAG (Post 908061)
Or he removed the Makefile, which again, can be fixed by running qmake.

Yes, it could be Makefile renamed, moved to another place, deleted, or broken by editing.
Including, some problems might be caused by editing Makefile in Windows's Notepad: Linux has one type of Enter and Windows has another (^M as displayed in vi). I have rarely (read: never) used Makefile, so I don't know how tolerant make is.

MohammadAG 2010-12-31 03:32

Re: Need help in modifying an existing open source N900 program ..
 
Or he removed the Makefile, which again, can be fixed by running qmake.

ahmadka 2011-01-16 03:40

Re: Need help in modifying an existing open source N900 program ..
 
Sorry for getting back to this so late .. i was busy to work on this again ..

Anyways, I tried running the command 'mad qmake', and I got the following error (a simple 'qmake' gave a 'command not found' error):

Code:

MADDE-0.6.46 /d/n9profile
Ahmad $ mad qmake
env.exe: /madlib/pkg-config: No such file or directory
env.exe: /madlib/pkg-config: No such file or directory
env.exe: /madlib/pkg-config: No such file or directory
env.exe: /madlib/pkg-config: No such file or directory
env.exe: /madlib/pkg-config: No such file or directory
env.exe: /madlib/pkg-config: No such file or directory
env.exe: /madlib/pkg-config: No such file or directory
env.exe: /madlib/pkg-config: No such file or directory
env.exe: /madlib/pkg-config: No such file or directory
WARNING: desktop.path is not defined: install target not created


ahmadka 2011-01-16 03:45

Re: Need help in modifying an existing open source N900 program ..
 
Quote:

Originally Posted by MohammadAG (Post 908061)
Or he removed the Makefile, which again, can be fixed by running qmake.

As far as I can tell, there's no makefile in the entire source code TAR file you download from http://gitorious.org/n9profile/n9profile/trees/master ..

Wikiwide 2011-01-16 04:29

Re: Need help in modifying an existing open source N900 program ..
 
Quote:

Originally Posted by ahmadka (Post 921326)
Sorry for getting back to this so late .. i was busy to work on this again ..

Anyways, I tried running the command 'mad qmake', and I got the following error (a simple 'qmake' gave a 'command not found' error):

Code:

MADDE-0.6.46 /d/n9profile
Ahmad $ mad qmake
env.exe: /madlib/pkg-config: No such file or directory
env.exe: /madlib/pkg-config: No such file or directory
env.exe: /madlib/pkg-config: No such file or directory
env.exe: /madlib/pkg-config: No such file or directory
env.exe: /madlib/pkg-config: No such file or directory
env.exe: /madlib/pkg-config: No such file or directory
env.exe: /madlib/pkg-config: No such file or directory
env.exe: /madlib/pkg-config: No such file or directory
env.exe: /madlib/pkg-config: No such file or directory
WARNING: desktop.path is not defined: install target not created


I suppose this application needs pkg-config for compiling, and MADDE doesn't have it.
Clutching my head...
I don't know how to install anything in MADDE environment. It has no apt-get.

Ask somebody else...

Try compiling in something else instead of MADDE.
I don't know what scratchbox is,

and these is a way to run qmake on N900 itself (and it's easy to install pkg-config on N900, just apt-get install pkg-config)
http://talk.maemo.org/showthread.php?p=771651

Diph 2011-01-16 08:13

Re: Need help in modifying an existing open source N900 program ..
 
I have Nokia Qt SDK and tried to build n9profile from Qt Creator and it works just fine (compiled and created the package). There shouldn't be any problems.

ahmadka 2011-01-16 08:29

Re: Need help in modifying an existing open source N900 program ..
 
@Diph, can you tell me exactly what steps you did ? Like what version of Qt Creator are you using ? How did you open the project in Qt Creator ? What build settings did you use, etc ?

Diph 2011-01-16 18:34

Re: Need help in modifying an existing open source N900 program ..
 
Quote:

Originally Posted by ahmadka (Post 921377)
@Diph, can you tell me exactly what steps you did ? Like what version of Qt Creator are you using ? How did you open the project in Qt Creator ? What build settings did you use, etc ?

Latest Nokia Qt SDK. I just opened the *.pro file and pressed build. :)

ahmadka 2011-01-16 22:57

Re: Need help in modifying an existing open source N900 program ..
 
Alright well I just opened the pro file, choose the output forms in the popup that appears, and then pressed CTRL+B (Build Project) .. I'm getting some missing file and undeclared variables errors:

Code:

In file included from controlclass.cpp:7:
calendatprofile.h:9:23: error: CCalendar.h: No such file or directory
calendatprofile.h:10:28: error: CMulticalendar.h: No such file or directory
calendatprofile.h:11:19: error: CTodo.h: No such file or directory
calendatprofile.h:12:24: error: CBdayEvent.h: No such file or directory
calendatprofile.h:13:20: error: CEvent.h: No such file or directory
In file included from controlclass.cpp:7:
calendatprofile.h:52: error: 'CalendarColour' has not been declared
make: Leaving directory `/d/n9profile'
make: *** [controlclass.o] Error 1
Exited with code 2.
Error while building project n9profil (target: Maemo)
When executing build step 'Make'

Are you getting these errors too ? If so, what did you do to get around them ?

Diph 2011-01-17 20:03

Re: Need help in modifying an existing open source N900 program ..
 
Sorry, I don't know how to help. It just worked from scratch. I have Ubuntu and latest Nokia Qt SDK if it helps.

ahmadka 2011-01-17 20:40

Re: Need help in modifying an existing open source N900 program ..
 
can you just check if any of the files I'm betting not found error for are included in the package you downloaded .. ?

because I actually tried finding such files in the source code TAR file I downloaded and couldnt find any of them ...

Diph 2011-01-18 06:12

Re: Need help in modifying an existing open source N900 program ..
 
I just cloned the git repo from the first post's link.

Code:

git clone git://gitorious.org/n9profile/n9profile.git
Have you tried this?

http://gitorious.org/n9profile/n9pro...tarball/master

ahmadka 2011-01-18 07:09

Re: Need help in modifying an existing open source N900 program ..
 
I dont follow .. again, something I haven't tried .. :P

Where do I type in the command you mentioned ?

Also, the second link you gave simply downloads a TAR.GZ file which doesn't contain any GIT file .. so where is the GIT file coming for the first command ?

Diph 2011-01-18 08:25

Re: Need help in modifying an existing open source N900 program ..
 
From here: http://talk.maemo.org/showpost.php?p=907330&postcount=1 :P

You have to install git before you can use it from command line, but I guess you are using Windows?

You should be able to pull the same source code from tar.gz. Just extract it somewhere and open n9profil.pro file in Qt Creator and build the project.

ahmadka 2011-01-18 12:34

Re: Need help in modifying an existing open source N900 program ..
 
Where can I get this 'git' tool for Windows ? It is even available for Windows ?

I did try download the TAR.GZ file, but there are files missing in it .. When I try to compile it, I get missing files errors .. These errors are reported whether I'm using MADDE to compile or Qt Creator .. This is why I asked you several posts back if you received any such errors ..

So is 'git' available for Windows .. ? Can you maybe send me the code you compiled from (maybe it contains the extra files) ?

Diph 2011-01-18 13:20

Re: Need help in modifying an existing open source N900 program ..
 
I guess the problem is with pkg-config as Wikiwide said earlier. The pro file looks like this:

Code:

CONFIG +=  link_pkgconfig qt mobility

PKGCONFIG += dbus-1 calendar-backend profile

Found a reported bug about the issue: http://bugreports.qt.nokia.com/browse/QTCREATORBUG-1245

E: This should be fixed in Qt Creator 2.1. Maybe you should try it: http://qt.nokia.com/developer/qt-qtcreator-prerelease/

ahmadka 2011-01-20 17:42

Re: Need help in modifying an existing open source N900 program ..
 
@Diph, dude thanks for all your help ..

But I'm not sure what you're asking me to do .. Should I change something in the PRO file ? Or are you suggesting I use a more recent Qt Creator ?

What about that 'git' tool you suggested earlier on ? Is that available for Windows ?

ahmadka 2011-01-20 17:49

Re: Need help in modifying an existing open source N900 program ..
 
@Diph, is it possible if I can tell you to make a minor change in the code and then send me the DEB file for the changed code ?

I expect you would only need to edit 1 line of code at max ... There's actually a feature in this program that sets the profile (General, Sient, etc ..) based on the contact calling .. So for Person A the phone can be silent, while for Person B it can be General ..

When using the above feature you have to provide the phone number based on which you're setting the profile .. The bug is in the accepted phone number length .. it should be 10 digits long, but right not only 9 digits are accepted for this .. So I assume the code change required would be just changing a number or something ..

If you can send me the compiled N900 DEB for the changed code I'd be very grateful .. If you agree, I can look through the code and tell you where the change needs to be made ..

Wikiwide 2011-01-20 20:59

Re: Need help in modifying an existing open source N900 program ..
 
Quick reply....
git is available for N900

Diph 2011-01-21 08:09

Re: Need help in modifying an existing open source N900 program ..
 
I can try it later today, but there might be some problems because I'm not at home and I'll have to use Windows PC. :P

In previous post I meant that you try the newer version of Qt Creator, because the bug should be fixed in that version.

Diph 2011-01-21 18:19

Re: Need help in modifying an existing open source N900 program ..
 
Ok, I tried the app with the latest Qt SDK (Qt and Nokia SDK's included) on Windows. Unfortunately I was unable to build the package, because there were still some dpkg errors. :(

Maybe you should ask someone else, because I don't know when I'm back home and with Linux. :)


All times are GMT. The time now is 03:56.

vBulletin® Version 3.8.8