Skip to content

Commit 44869c3

Browse files
committed
Update SystemModules.md to succeed on OS X 10.11
El Capitan's System Integrity Protection prevents the user from installing anything in `/usr/include` or `/usr/lib`, so use `/usr/local` instead, which is also where Homebrew installs `jpeg`. Also remove the statement about Homebrew’s jpeglib.h being correct because that's false.
1 parent fe7a21c commit 44869c3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Documentation/SystemModules.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ To `import CJPEG` the package manager requires
2424
that the JPEG library has been installed by a system packager (eg. `apt`, `brew`, `yum`, etc.).
2525
The following files from the JPEG system-package are of interest:
2626

27-
/usr/lib/libjpeg.so # .dylib on OS X
28-
/usr/include/jpeglib.h
27+
/usr/local/lib/libjpeg.so # .dylib on OS X
28+
/usr/local/include/jpeglib.h
2929

3030
Swift packages that provide module maps for system libraries are handled differently from regular Swift packages.
3131

@@ -39,7 +39,7 @@ Create a directory called `CJPEG` parallel to the `example` directory and create
3939
Edit the `module.modulemap` so it consists of the following:
4040

4141
module CJPEG [system] {
42-
header "/usr/include/jpeglib.h"
42+
header "/usr/local/include/jpeglib.h"
4343
link "jpeg"
4444
export *
4545
}
@@ -177,7 +177,7 @@ And run it:
177177
178178
---
179179

180-
Please note that on Ubuntu 15.10 the above steps fail with:
180+
Please note that on some platforms, the above steps fail with:
181181

182182
<module-includes>:1:10: note: in file included from <module-includes>:1:
183183
#include "/usr/include/jpeglib.h"
@@ -186,7 +186,7 @@ Please note that on Ubuntu 15.10 the above steps fail with:
186186
size_t free_in_buffer; /* # of byte spaces remaining in buffer */
187187
^
188188

189-
This is because `jpeglib.h` is not a correct module as bundled with Ubuntu (Homebrew’s jpeglib.h is correct however).
189+
This is because `jpeglib.h` is not a correct module.
190190
To fix this you need to add `#include <stdio.h>` to the top of jpeglib.h.
191191

192192
JPEG lib itself needs to be patched, but since this situation will be common we intend to add a workaround system in module packages.

0 commit comments

Comments
 (0)