summaryrefslogtreecommitdiff
path: root/README.bundled-libs.txt
blob: 1f50fd2a08e3d312a65b48bf27c8a737ca03c7f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
README.bundled-libs.txt - Developer information for bundled libraries
---------------------------------------------------------------------

This file is mainly intended for FLTK developers and contains information
about the current versions of all bundled libraries and about how to
upgrade these bundled libraries.

Starting with FLTK 1.4.0 the bundled libraries jpeg, png, and zlib use
"symbol prefixing" with the prefix 'fltk_' for all external symbols to
distinguish the bundled libraries from existing system libraries and
to avoid runtime errors.

User code compiled correctly with the header files provided by the
bundled image libraries need not be changed.

The nanosvg library is not affected.

Current versions of bundled libraries (as of Sep 13, 2021):

  Library       Version            Release date         FLTK Version
  --------------------------------------------------------------------------
  jpeg          jpeg-9d            2020-01-12           1.4.0
  nanosvg       461ad7de70 [1]     2021-09-13           1.4.0
  png           libpng-1.6.37      2019-04-14           1.4.0
  zlib          zlib-1.2.11        2017-01-15           1.4.0
  --------------------------------------------------------------------------

Previous versions of bundled libraries:

  Library       Version            Release date         FLTK Version
  ------------------------------------------------------------------
  jpeg          jpeg-9d            2020-01-12           1.3.6
  png           libpng-1.6.37      2019-04-14           1.3.6
  zlib          zlib-1.2.11        2017-01-15           1.3.6
  --------------------------------------------------------------------------


[1] Git commit in branch 'fltk' of https://github.com/fltk/nanosvg
    See also git tag 'fltk_yyyy-mm-dd' where yyyy-mm-dd == "Release date"
    and file nanosvg/README.txt.


General information:

  FLTK does not include the entire library distributions. We only provide the
  source files necessary to build the FLTK library and some README and/or
  CHANGELOG files. There are no test programs or other contributed files.

  We use our own build files, hence a few files MUST NOT be upgraded when
  the library source files are upgraded. We strive to keep changes to the
  library source files as small as possible. Patching library code to
  work with FLTK should be a rare exception. Symbol prefixing with prefix
  'fltk_' is one such exception to the rule.

  If patches are necessary all changes in the library files should be
  marked with "FLTK" in a comment so a developer who upgrades the library
  later is aware of changes in the source code for FLTK. Look for 'FLTK'
  and/or 'fltk_' to find the differences.

  Additional comments should be added to show the rationale, i.e. why
  a particular change was necessary. If applicable, add a reference to
  a Software Trouble Report, GitHub Issue or Pull Request (PR) like
  "STR 3456", "Issue #123", or "PR #234".


How to update the bundled libraries:

  It is generally advisable to use a graphical merge program. I'm using
  'meld' under Linux, but YMMV.

  Do not add any source files unless they are required to build the library.

  Some config header files may be pre-generated in the FLTK sources. These
  header files should be left untouched, but it may be necessary to update
  these files if new items were added to the new library version. In this
  case the new header should be pre-generated on a Linux system with default
  options unless otherwise mentioned below for a specific library.
  Currently there are no known exceptions.


Merging source files:

  Please check if some source and header files contain "FLTK" comments
  and/or 'fltk_' symbol prefixing to be aware of necessary merges.
  It is also good to download the distribution tar ball or Git source
  files of the previous version and to run a (graphical) diff or merge
  tool on the previous version and the bundled version of FLTK to see
  the "previous" differences.

  Files that were not patched in previous versions should be copied to
  the new version w/o changes. Files that had FLTK specific patches must
  be merged manually. FLTK patches should be verified (if still necessary)
  and should be kept in the new source files.

  Source and header files that have been added in the new library version
  should be added in FLTK as well if they are necessary to build the
  library. A simple "trial and error" should be sufficient to find files
  that need to be added. Added files must be added to FLTK's build files
  as well, usually to both `Makefile' and `CMakeLists.txt' to be used in
  configure/make and in CMake based builds, respectively.


Upgrade order:

  There is only one dependency between all bundled libraries: libpng
  depends on zlib. Hence zlib should be upgraded first, then all other
  libs can be upgraded in arbitrary order.


Tests after merge:

  Tests should be done on as many platforms as possible, both with
  autotools (configure/make) and CMake. Windows (Visual Studio) and
  macOS (Xcode) builds need CMake to generate the IDE files.


Upgrade notes for specific libraries:

  The following chapters contain informations about specific files and
  how they are upgraded. Since the changes in all bundled libraries are
  not known in advance this information may change in the future. Please
  verify that no other changes are necessary.


zlib:

  Website:    https://zlib.net/
  Download:   See website and follow links.
  Repository: git clone https://github.com/madler/zlib.git


  The following files need special handling:

    CMakeLists.txt: Keep FLTK version, update manually if necessary.

    Makefile: Same as CMakeLists.txt.

    zconf.h: Merge changes.

      As of zlib 1.2.11: two small sections marked with "FLTK" comments
      that need to be kept.

    makedepend: Keep this file.

      Run `make depend' in the zlib folder on a Linux system after
      the upgrade to update this file.


png:

  Website:    http://libpng.org/pub/png/libpng.html
  Download:   See website and follow links.
  Repository: git clone https://git.code.sf.net/p/libpng/code libpng

  libpng should be upgraded after zlib because it depends on zlib.

  Download the latest libpng sources, `cd' to /path-to/libpng and run

    $ ./configure --with-libpng-prefix=fltk_

  This creates the header files 'pnglibconf.h' and 'pngprefix.h'
  with the 'fltk_' symbol prefix.

  The following files need special handling:

    CMakeLists.txt: Keep FLTK version, update manually if necessary.

    Makefile: Same as CMakeLists.txt.

    pnglibconf.h: Generate on a Linux system and merge (see above).
    pngprefix.h:  Generate on a Linux system and merge (see above).

    makedepend: Keep this file.

      Run `make depend' in the png folder on a Linux system after
      the upgrade to update this file.


jpeg:

  Website:    https://ijg.org/
  Download:   See website and follow links.
  Repository: <unknown>

  The following files need special handling:

    CMakeLists.txt: Keep FLTK version, update manually if necessary.

    Makefile: Same as CMakeLists.txt.

    Note: more to come...

    makedepend: Keep this file.

      Run `make depend' in the jpeg folder on a Linux system after
      the upgrade to update this file.


nanosvg:

  Website:    https://github.com/memononen/nanosvg
  Download:   See website and follow links.
  Repository: git clone https://github.com/memononen/nanosvg.git
  FLTK Fork:  git clone https://github.com/fltk/nanosvg.git

  FLTK has its own GitHub fork of the original repository (see above).

  The intention is to update this fork from time to time so the FLTK
  specific patches are up-to-date with the original library. Hopefully
  the FLTK patches will be accepted upstream at some time in the future
  so we no longer need our own patches.
  AlbrechtS, 04 Feb 2018.

  Update (Feb 22, 2021): The upstream library is officially no longer
  maintained (see README.md) although updates appear from time to time.

  Use this fork (branch 'fltk') to get the nanosvg library with FLTK
  specific patches:

    $ git clone https://github.com/fltk/nanosvg.git nanosvg-fltk
    $ cd nanosvg-fltk
    $ git checkout fltk
    $ cd src
    $ cp nanosvg.h nanosvgrast.h /path/to/fltk-1.4/nanosvg/

  This library does not have its own build files since it is a header-only
  library. The headers are included in FLTK where necessary.

  The following files need special handling:

    nanosvg.h:     Merge or download from FLTK's fork (see above).
    nanosvgrast.h: Merge or download from FLTK's fork (see above).