Before we start: This page will not tell you how to diagnose and address problems or shortcomings in source code and build files. We assume you know all that already, or are willing to read up on any missing bits, on your own (but for some hints on useful tools and techniques, be sure to visit Development/Tutorials/Debugging/Debugging on MS Windows, and Projects/KDE on Windows/Tools. The pupose of this page is to give you an outline of the specific steps needed for preparing, testing, and publishing patches in the KDE on Windows project.
You are using emerge to build your KDE on Windows development environment, right? If not, start doing so now. It's mandatory. Some variables to check in your emerge setup:
Often some builds will fail for trivial reasons, like a download failing because the file has moved. This type of error (but also missing or wrong configuration options, and many others) can be corrected in the emerge build files. These are in (subdirectories of) emerge/portage/. Each package has its own subdirectory. In each subdirectory you will find at least one .py-file. I am not aware of any in-depth information on the semantics of these files, but most concepts should be fairly obvious, and if you are unsure, look at other build files for examples.
If the problem needs fixing somewhere inside the source tree, you may be wondering where to look for the sources.
When developing a fix on the level of a package's source code, first locate the final source tree, as detailed above. You do your work directly in the source tree. For quick testing, you can cd to the build directory (%KDEROOT%/build/category/packagename/work/compiler_buildtype-version). Assuming configuration is already complete you can often build directly from there (for MinGW4 use
You can also use
emerge --update to run the build script, without discarding your changes (TODO: Does this apply to all packages, or only svn / git based ones?).
When satisfied with your fix, create a patch with
emerge --createpatch packagename. This will automatically diff your changes against an unmodified source tree, and create a suitable diff. It will be stored in %KDEROOT%/build/category/packagename/.
Next, you will copy this patch to the directory of the package's emerge build script. Add it to the build script using
self.patchToApply[ 'package_version' ] = [( 'patch_file_name.diff' , 1 ), optionally further patches]
Don't forget to test your patch for a clean workdir:
emerge --cleanbuild packagename emerge packagename
TODO: When should build scripts be renamed to reflect newer version? Ever?
Of course in many cases your fix should really become part of the "upstream" package source code. In particular, when patching KDE, you will probably want to commit your fixes to the KDE git repository, directly, in additon (when building an already finalized release of KDE), or instead of creating an emerge patch.
If unsure, ask on firstname.lastname@example.org, on IRC (), or post your patches to reviewboard before committing.
If you are confident in your patch, here's an extremely reduced overview of the git commands involved in getting it included:
git add all files that you have touched git commit with a meaningful message, please git log # and git status # to review your work. git status should typically say "1 commit ahead of origin". # Important: If git status shows more than one commit, and you don't know why, ask for help! git pull --rebase # To synchronize with the central repository git push