summaryrefslogtreecommitdiff
path: root/docs/patch-policy.txt
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2014-04-02 07:37:27 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2014-04-02 07:37:27 +0200
commit7236e468162b3af51c0acecad10fbef1838c06ad (patch)
tree9c8027cf769aaa7ef7f0a6330b34d7666238b920 /docs/patch-policy.txt
parenta691abc857458de0023f5e532feee866af0218ed (diff)
parent309f13ab6858e1c1639814e210a6c86380ca717b (diff)
Merge branch 'master' of git+ssh://openadk.org/git/openadk
Diffstat (limited to 'docs/patch-policy.txt')
-rw-r--r--docs/patch-policy.txt90
1 files changed, 90 insertions, 0 deletions
diff --git a/docs/patch-policy.txt b/docs/patch-policy.txt
new file mode 100644
index 000000000..e948661cf
--- /dev/null
+++ b/docs/patch-policy.txt
@@ -0,0 +1,90 @@
+// -*- mode:doc; -*-
+// vim: set syntax=asciidoc:
+
+[[patch-policy]]
+
+Patching a package
+------------------
+
+While integrating a new package or updating an existing one, it may be
+necessary to patch the source of the software to get it cross-built within
+OpenADK. OpenADK offers an infrastructure to automatically handle this during
+the builds. Patches are provided within OpenADK, in the package directory;
+these typically aim to fix cross-compilation, libc support, portability issues
+or other things.
+
+Normally the patches are autogenerated via:
+------------
+ $ make package=<package> update-patches
+------------
+
+Otherwise they are manually generated via:
+------------
+ $ diff -Nur <pkgname>-<pkgversion>.orig <pkgname>-<pkgversion> > package/<pkgname>/patches/xxx-description.patch
+------------
+
+The string +xxx+ should be substituted by a number starting with 001. The
+patches will be applied in numeric order. You should either use the automatic
+patch generation or the manual patch creation for a package. Mixed usage is not
+supported.
+
+Format and licensing of the package patches
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Patches are released under the same license as the software that is
+modified.
+
+A message explaining what the patch does, and why it is needed, should
+be added in the header commentary of the patch.
+At the end, the patch should look like:
+
+---------------
+add C++ support test
+
+--- configure.ac.orig
++++ configure.ac
+@@ -40,2 +40,12 @@
+
+AC_PROG_MAKE_SET
++
++AC_CACHE_CHECK([whether the C++ compiler works],
++ [rw_cv_prog_cxx_works],
++ [AC_LANG_PUSH([C++])
++ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
++ [rw_cv_prog_cxx_works=yes],
++ [rw_cv_prog_cxx_works=no])
++ AC_LANG_POP([C++])])
++
++AM_CONDITIONAL([CXX_WORKS], [test "x$rw_cv_prog_cxx_works" = "xyes"])
+---------------
+
+Integrating patches found on the Web
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+When integrating a patch of which you are not the author, you have to
+add a few things in the header of the patch itself.
+
+Depending on whether the patch has been obtained from the project
+repository itself, or from somewhere on the web, add one of the
+following tags:
+
+---------------
+Backported from: <some commit id>
+---------------
+
+or
+
+---------------
+Fetch from: <some url>
+---------------
+
+It is also sensible to add a few words about any changes to the patch
+that may have been necessary.
+
+Upstreaming patches
+~~~~~~~~~~~~~~~~~~~
+
+OpenADK tries to avoid any patches to the source code. If a patch could
+not be avoided, it should be tried to make the patch of a good quality to
+get it upstream. OpenADK tries to report any found issues and try to send
+in any upstream compatible patches.