| OLD | NEW |
| 1 naclports - Ports of open source software to Native Client | 1 naclports - Ports of open source software to Native Client |
| 2 ========================================================== | 2 ========================================================== |
| 3 | 3 |
| 4 naclports is collection of open source libraries and applications that have | 4 naclports is collection of open source libraries and applications that have |
| 5 been ported to Native Client, along with set to tools for building and maintain | 5 been ported to Native Client, along with set to tools for building and maintain |
| 6 them. | 6 them. |
| 7 | 7 |
| 8 The ports themselves live in the ``ports`` directory. Each one contains a | 8 The ports themselves live in the ``ports`` directory. Each one contains a |
| 9 description of the package (pkg_info), a bash script for building it (build.sh) | 9 description of the package (pkg_info), a bash script for building it (build.sh) |
| 10 and an optional patch file (nacl.patch). The build script will download, | 10 and an optional patch file (nacl.patch). To build a package run the |
| 11 patch, build and install the application or library. | 11 naclports.sh script from the package directory. The build script will |
| 12 download, patch, build and install the application or library. |
| 12 | 13 |
| 13 The scripts require that certain tools are present in the host system. | 14 The build scripts require that certain tools are present in the host system. |
| 14 You will need at least these (but probably more): | 15 You will need at least these (but probably more): |
| 15 | 16 |
| 16 - bash | 17 - bash |
| 17 - make | 18 - make |
| 18 - sed | 19 - sed |
| 19 - git | 20 - git |
| 20 - autoconf, automake | 21 - autoconf, automake |
| 21 - pkg-config | 22 - pkg-config |
| 22 - gettext | 23 - gettext |
| 23 - libglib2.0-dev >= 2.26.0 (if you want to build nacl-glib) | 24 - libglib2.0-dev >= 2.26.0 (if you want to build glib) |
| 24 | 25 |
| 25 Before you can build any of the package you must set the NACL_SDK_ROOT | 26 Before you can build any of the package you must set the NACL_SDK_ROOT |
| 26 environment variable to top directory of a version of the Native Client SDK | 27 environment variable to top directory of a version of the Native Client SDK |
| 27 (the directory containing toolchain/). This path should be absolute. | 28 (the directory containing toolchain/). This path should be absolute. |
| 28 | 29 |
| 29 The top level Makefile can be used to build one of more of the packages. | 30 The top level Makefile can be used to build one of more of the packages. |
| 30 Package dependencies are built into this Makefile. For example, ``make vorbis`` | 31 Package dependencies are built into this Makefile. For example, ``make vorbis`` |
| 31 will build ``libvorbis-1.2.3`` and ``libogg-1.1.4``. ``make all`` will build | 32 will build ``libvorbis-1.2.3`` and ``libogg-1.1.4``. ``make all`` will build |
| 32 all of the ports. | 33 all of the packages. |
| 33 | 34 |
| 34 There are 4 possible architectures that NaCl modules can be compiled for: i686, | 35 There are 4 possible architectures that NaCl modules can be compiled for: i686, |
| 35 x86_64, arm, pnacl. The naclports build system will build just one at at time. | 36 x86_64, arm, pnacl. The naclports build system will build just one at at time. |
| 36 You can control which one by setting the ``NACL_ARCH`` environment variable. | 37 You can control which one by setting the ``NACL_ARCH`` environment variable. |
| 37 E.g.:: | 38 E.g.:: |
| 38 | 39 |
| 39 $ NACL_ARCH=arm make openssl | 40 $ NACL_ARCH=arm make openssl |
| 40 | 41 |
| 41 If you want to build a certain package for all architectures you can use the | 42 If you want to build a certain package for all architectures you can use the |
| 42 top level ``make_all.sh`` script. E.g.:: | 43 top level ``make_all.sh`` script. E.g.:: |
| (...skipping 30 matching lines...) Expand all Loading... |
| 73 Adding a new package | 74 Adding a new package |
| 74 -------------------- | 75 -------------------- |
| 75 | 76 |
| 76 To add a package: | 77 To add a package: |
| 77 | 78 |
| 78 1. If you are using svn, make sure you have a writable version of the | 79 1. If you are using svn, make sure you have a writable version of the |
| 79 repository:: | 80 repository:: |
| 80 | 81 |
| 81 $ gclient config https://naclports.googlecode.com/svn/trunk/src | 82 $ gclient config https://naclports.googlecode.com/svn/trunk/src |
| 82 | 83 |
| 83 2. Add a directory to the ``ports`` directory using the name your new port. | 84 2. Add a directory to the ``ports`` directory using the name your new package. |
| 84 For example: ``ports/openssl``. | 85 For example: ``ports/openssl``. |
| 85 3. Add the build.sh script and pkg_info to that directory. | 86 3. Add the build.sh script and pkg_info to that directory. |
| 86 4. Optionally include the upstream tarball and create a .sha1 checksum file. | 87 4. Optionally include the upstream tarball and create a .sha1 checksum file. |
| 87 You can do this using ``build_tools/sha1sum.py``. Redirect the script | 88 You can do this using ``build_tools/sha1sum.py``. Redirect the script |
| 88 output to a .sha1 file so that the build system will find it. E.g.:: | 89 output to a .sha1 file so that the build system will find it. E.g.:: |
| 89 | 90 |
| 90 $ sha1sum.py mypkg.tar.gz > ports/openssl/openssl-0.0.1.sha1 | 91 $ sha1sum.py mypkg.tar.gz > ports/openssl/openssl-0.0.1.sha1 |
| 91 | 92 |
| 92 5. Optionally include a patch file (nacl.patch). See below for the | 93 5. Optionally include a patch file (nacl.patch). See below for the |
| 93 recommended way to generate this patch. | 94 recommended way to generate this patch. |
| 94 6. Add the invocation of your script, and any dependencies to the top level | 95 6. Add the new package, and any dependencies to the top level Makefile. |
| 95 Makefile. | |
| 96 7. Make sure your package builds for all architectures:: | 96 7. Make sure your package builds for all architectures:: |
| 97 | 97 |
| 98 $ ./make_all.sh <PACKAGE_NAME> | 98 $ ./make_all.sh <PACKAGE_NAME> |
| 99 | 99 |
| 100 Modifying package sources / Working with patches | 100 Modifying package sources / Working with patches |
| 101 ------------------------------------------------ | 101 ------------------------------------------------ |
| 102 | 102 |
| 103 When a package is first built, its source is downloaded and extracted to | 103 When a package is first built, its source is downloaded and extracted to |
| 104 ``out/repository/<PKG_NAME>``. A new git repository is then created in this | 104 ``out/repository/<PKG_NAME>``. A new git repository is then created in this |
| 105 folder with the original archive contents on a branch called ``upstream``. The | 105 folder with the original archive contents on a branch called ``upstream``. The |
| 106 optional ``nacl.patch`` file is then applied on the ``master`` branch. This | 106 optional ``nacl.patch`` file is then applied on the ``master`` branch. This |
| 107 means that at any given time you can see the changes from upstream using ``git | 107 means that at any given time you can see the changes from upstream using ``git |
| 108 diff upstream``. | 108 diff upstream``. |
| 109 | 109 |
| 110 To make changes to a package's patch file the recommended workflow is: | 110 To make changes to a package's patch file the recommended workflow is: |
| 111 | 111 |
| 112 1. Directly modify the sources in ``out/repository/PKG_NAME``. | 112 1. Directly modify the sources in ``out/repository/PKG_NAME``. |
| 113 2. Build the package and verify the changes. | 113 2. Build the package and verify the changes. |
| 114 3. Use ``git diff upstream.. > ../path/to/nacl.patch`` to regenerate | 114 3. Use ``git diff upstream.. > ../path/to/nacl.patch`` to regenerate |
| 115 the patch file. | 115 the patch file. |
| 116 | 116 |
| 117 Whenever the upstream archive or patch file changes and you try to build the | 117 Whenever the upstream archive or patch file changes and you try to build the |
| 118 package you will be prompted to remove the existing repository and start a new | 118 package you will be prompted to remove the existing repository and start a new |
| 119 one. This is to avoid deleting a repository that might have unsaved changed. | 119 one. This is to avoid deleting a repository that might have unsaved changed. |
| OLD | NEW |