2014-06-11 17:14:09 -04:00
|
|
|
How to update a third party library to a newer version
|
|
|
|
======================================================
|
2014-06-11 17:14:02 -04:00
|
|
|
|
|
|
|
0. Introduction
|
|
|
|
---------------
|
|
|
|
|
|
|
|
wxWidgets includes several third party libraries, i.e. libraries which are
|
|
|
|
used by wxWidgets and distributed with it but which we don't maintain nor even
|
|
|
|
modify, inasmuch as possible, ourselves. These libraries are developed by
|
|
|
|
their maintainers and from time to time we need to replace the versions used
|
|
|
|
by wxWidgets with newer versions.
|
|
|
|
|
|
|
|
|
2017-11-11 07:10:22 -05:00
|
|
|
1. Submodules
|
|
|
|
-------------
|
2014-06-11 17:14:02 -04:00
|
|
|
|
2017-11-12 11:42:44 -05:00
|
|
|
All third party libraries are managed using Git submodules. This includes
|
|
|
|
3rdparty/catch and expat, jpeg, png, tiff and zlib subdirectories of src.
|
2014-06-11 17:14:02 -04:00
|
|
|
|
2017-11-11 07:10:22 -05:00
|
|
|
As always with submodules, updating a library involves updating its sources in
|
|
|
|
the submodule, pushing this submodule out and then committing the changes in
|
|
|
|
the top-level repository.
|
2014-06-11 17:14:02 -04:00
|
|
|
|
|
|
|
|
2017-11-11 07:10:22 -05:00
|
|
|
2. Updating the submodule
|
|
|
|
-------------------------
|
2014-06-11 17:14:02 -04:00
|
|
|
|
2017-11-11 07:10:22 -05:00
|
|
|
All submodules use `master` branch for the upstream master and `wx` for the
|
|
|
|
version used by wxWidgets. To update the latter, just merge the appropriate
|
|
|
|
commit from master into `wx`, e.g.
|
2014-06-11 17:14:02 -04:00
|
|
|
|
2017-11-11 07:10:22 -05:00
|
|
|
$ cd src/expat
|
|
|
|
$ git checkout wx
|
|
|
|
$ git merge R_x_y_z # For the latest x.y.z release
|
2014-06-11 17:14:02 -04:00
|
|
|
|
2017-11-11 07:10:22 -05:00
|
|
|
After resolving any conflicts, commit the result, test the build under MSW and
|
|
|
|
under Unix using `--disable-sys-libs` configure option, and push the updated
|
|
|
|
branch out. Notice that you may want to use the ssh GitHub repository URL
|
|
|
|
instead of the default (because more convenient for checking them out) HTTPS
|
|
|
|
one:
|
2014-06-11 17:14:02 -04:00
|
|
|
|
2017-11-11 07:10:22 -05:00
|
|
|
$ git push --set-upstream git@github.com:wxWidgets/libexpat.git wx
|
2014-06-11 17:14:02 -04:00
|
|
|
|
|
|
|
|
2017-11-11 07:10:22 -05:00
|
|
|
3. Updating the main repository
|
|
|
|
-------------------------------
|
2014-06-11 17:14:02 -04:00
|
|
|
|
2017-11-11 07:10:22 -05:00
|
|
|
If there are any changes to the source files used by the library, update the
|
|
|
|
corresponding `build/bakefiles/$lib.bkl` file (e.g. `expat.bkl` for Expat) and
|
|
|
|
rerun bakefile to regenerate most of the makefiles and project files. Currently
|
|
|
|
you will need to update `build/msw/wx_wx$lib.vcxproj{,.filters}` files
|
|
|
|
manually.
|
2014-06-11 17:14:02 -04:00
|
|
|
|
2017-11-11 07:10:22 -05:00
|
|
|
Commit these changes and the submodule and create a PR to test them as usual.
|
2014-06-11 17:14:02 -04:00
|
|
|
|
|
|
|
|
|
|
|
4. Special instructions for libpng
|
|
|
|
----------------------------------
|
|
|
|
|
|
|
|
We use a special hack for libpng as we want to prefix all its symbols with
|
2017-11-11 07:10:22 -05:00
|
|
|
`wx_` but don't want to use its build system which makes this easily possible
|
2014-06-11 17:14:02 -04:00
|
|
|
(perhaps we should, but for now we don't). So, when upgrading libpng, you need
|
|
|
|
to perform an extra step after merging the new version (and before committing
|
|
|
|
your changes):
|
|
|
|
|
|
|
|
Create a temporary build directory and run libpng configure from it using
|
2017-11-11 07:10:22 -05:00
|
|
|
`--with-libpng-prefix=wx_` option. Then run `make pnglibconf.h pngprefix.h`
|
2017-11-11 08:04:51 -05:00
|
|
|
to create these files in the build directory. Next, search for the line
|
|
|
|
containing `PNG_ZLIB_VERNUM` in the `pnglibconf.h` and set it to 0 to disable
|
|
|
|
zlib version checks (this looks dangerous but seems to be unavoidable with the
|
|
|
|
current build system). And then, finally, copy these files to src/png
|
|
|
|
subdirectory of the wxWidgets source tree, overwriting the versions there.
|
2014-06-11 17:14:02 -04:00
|
|
|
|
|
|
|
Notice that config.h generated by libpng configure is not used, we build it
|
2017-11-11 07:10:22 -05:00
|
|
|
without `-DHAVE_CONFIG_H` as it works just fine without it on any ANSI C system
|
2014-06-11 17:14:02 -04:00
|
|
|
(i.e. anywhere by now).
|