Editing PyMaemo/How to build

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
 +
= How to build PyMaemo packages =
 +
 +
== Introduction ==
 +
To build PyMaemo packages from the source, you'll need:
To build PyMaemo packages from the source, you'll need:
Line 41: Line 45:
This will create the directory pymaemo-tools under $BASE.
This will create the directory pymaemo-tools under $BASE.
-
Edit the <code>fremantle-i386.cfg</code> and <code>fremantle-arm.cfg</code> under $BASE/pymaemo-tools/sbdmock, putting the rootstrap path correspondent to each in the following key:
+
Edit the fremantle-i386.cfg and fremantle-arm.cfg under $BASE/pymaemo-tools/sbdmock,
 +
putting the rootstrap path correspondent to each in the following key:
* i386: config_opts['rootstrap'] = "$BASE/rootstraps/maemo-sdk-rootstrap_5.0_i386.tgz"
* i386: config_opts['rootstrap'] = "$BASE/rootstraps/maemo-sdk-rootstrap_5.0_i386.tgz"
* armel: config_opts['rootstrap'] = "$BASE/rootstraps/maemo-sdk-rootstrap_5.0_armel.tgz"
* armel: config_opts['rootstrap'] = "$BASE/rootstraps/maemo-sdk-rootstrap_5.0_armel.tgz"
-
If you do not use the default <code>FREMANTLE_ARMEL</code> and <code>FREMANTLE_X86</code> target names, you also need to change that on the .cfg files, in the <code>config_opts['sbtarget']</code> entry.
+
If you do not use the default FREMANTLE_ARMEL and FREMANTLE_X86 target names, you also need to change that on the .cfg files, in the config_opts['sbtarget'] entry.
You'll need the Nokia binaries repository for building some packages, just add the correspondent line to the config_opts['sources.list'] entry of the .cfg files:
You'll need the Nokia binaries repository for building some packages, just add the correspondent line to the config_opts['sources.list'] entry of the .cfg files:
Line 51: Line 56:
  deb http://repository.maemo.org/ fremantle/<token> nokia-binaries
  deb http://repository.maemo.org/ fremantle/<token> nokia-binaries
-
As Maemo SDK needs some components from Nokia binaries repository, you probably already have a token in <code>/etc/apt/sources.list</code> inside Scratchbox. If you don't have a token, though, go to http://tablets-dev.nokia.com/eula/index.php and get one.
+
As Maemo SDK needs some components from Nokia binaries repository, you probably already have a token in /etc/apt/sources.list inside Scratchbox. If you don't have a token, though, go to http://tablets-dev.nokia.com/eula/index.php and get one.
== Building ==
== Building ==
Line 59: Line 64:
  $ ./build_packages.sh sbdmock:fremantle-i386 packages-fremantle.ini
  $ ./build_packages.sh sbdmock:fremantle-i386 packages-fremantle.ini
-
The same can be done to ARMEL target, just replacing "i386" with "arm". The file <code>packages_fremantle.ini</code> contains all data necessary for obtaining the sources.  
+
The same can be done to ARMEL target, just replacing "i386" with "arm". The file packages_fremantle.ini contains all data necessary for obtaining the sources.  
You can build individual packages too, specifying them as parameters. If you want to build only, let's say, pyopenssl and pycurl for the ARMEL target, run:
You can build individual packages too, specifying them as parameters. If you want to build only, let's say, pyopenssl and pycurl for the ARMEL target, run:
Line 67: Line 72:
Be advised that any PyMaemo dependency for these packages must be built first, as build_packages.sh will attempt to build only the packages provided at the command line.
Be advised that any PyMaemo dependency for these packages must be built first, as build_packages.sh will attempt to build only the packages provided at the command line.
-
There are other options for the build; for more information, run build_packages.sh with no parameters or refer to the README file inside pymaemo-tools.
+
There are other options for the build; for more information, run build_packages.sh  
 +
with no parameters or refer to the README file inside pymaemo-tools.
-
When the build finishes the resultant Debian packages will be placed at $BASE/pymaemo-tools/workdir/fremantle_<target>/repo, where <target> is i386 or armel,and the build logs placed in $BASE/pymaemo-tools/workdir/fremantle_<target>/logs. From that point on, they can be installed on the targets and the ARMEL ones can be copied to the device to be installed there.
+
When the build finishes the resultant Debian packages will be placed at  
 +
$BASE/pymaemo-tools/workdir/fremantle_<target>/repo, where <target> is i386 or armel,and the build logs placed in $BASE/pymaemo-tools/workdir/fremantle_<target>/logs.
 +
From that point on, they can be installed on the targets and the ARMEL ones
 +
can be copied to the device to be installed there.
=== Directories created ===
=== Directories created ===
Line 78: Line 87:
== Adding your own packages to the build ==
== Adding your own packages to the build ==
-
If you want to add your own package to the build process, you just have to edit one file, <code>packages-fremantle.ini</code>. Just add an entry at the end of the file depending on how your package is organized.
+
If you want to add your own package to the build process, you just have to edit one file, packages-fremantle.ini. Just add an entry at the end of the file depending on how your package is organized.
-
* If all the files of your package are contained in a single SVN or Git repository, you just have to point to this repository, as the example below for python-conic:
+
* If all the files of your package are contained in a single SVN or GIT repository, you just have to point to this repository, as the example below for python-conic:
   
   
  [python-conic]
  [python-conic]
Line 107: Line 116:
# Create a clone of the repository at Gitorious for the package you want to modify, and git-clone it;
# Create a clone of the repository at Gitorious for the package you want to modify, and git-clone it;
-
# Modify the <code>packages-fremantle.ini</code> entry of the package to point to the full path of the repository directory;
+
# Modify the packages-fremantle.ini entry of the package to point to the full path of the repository directory;
-
# Modify the package and run <code>build_packages.sh</code> to build it;
+
# Modify the package and run build_packages.sh to build it;
## Don't forget to erase your package files from $BASE/download_cache, $BASE/workdir and $BASE/workdir/fremantle_<target>/repo before the build;
## Don't forget to erase your package files from $BASE/download_cache, $BASE/workdir and $BASE/workdir/fremantle_<target>/repo before the build;
# Install on Scratchbox and on the device, if possible, and run all available unit tests for the package - needless to say, your modifications must not introduce regressions of any type;
# Install on Scratchbox and on the device, if possible, and run all available unit tests for the package - needless to say, your modifications must not introduce regressions of any type;
Line 114: Line 123:
# When you are satisfied with the results, push your local changes to your Gitorious clone and file a merge request.
# When you are satisfied with the results, push your local changes to your Gitorious clone and file a merge request.
-
If you want to modify a package that lives entirely on the Git repository, you can do anything you want, as all the files are under your control. However, if the package is taken from upstream, the only changes you can make will be located in the packaging - you'll have to use patches to actually modify any upstream file in build time.
+
 
 +
If you want to modify a package that lives entirely on the GIT repository, you can do anything you want, as all the files are under your control. However, if the package is taken from upstream, the only changes you can make will be located in the packaging - you'll have to use patches to actually modify any upstream file in build time.
== Tips ==
== Tips ==
Line 120: Line 130:
=== Create a Debian repository with one line ===
=== Create a Debian repository with one line ===
-
If you want to quickly make a Debian repository for easy installation, run the following command at $BASE/pymaemo-tools/workdir/fremantle_<target>/repo:
+
If you want to quickly make a Debian repository for easy installation,  
 +
run the following command at $BASE/pymaemo-tools/workdir/fremantle_<target>/repo:
  $ apt-ftparchive packages . | gzip -9c > Packages.gz  
  $ apt-ftparchive packages . | gzip -9c > Packages.gz  
-
Now you have to expose the packages' path to the Web server and add the repository in the target machine accordingly.
+
Now you have to expose the packages' path to the Web server and add the repository
 +
in the target machine accordingly.
=== Tracking build in real time ===
=== Tracking build in real time ===

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)