Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static build #813

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
c65bfb9
Static build
piranna Sep 18, 2016
88cc5c6
Merge remote-tracking branch 'Automattic/master' into static
piranna Jan 23, 2017
70a4d38
Download ZLIB from SourceForge
piranna Jan 24, 2017
48e53b4
Add missing libraries (due to Pango?)
piranna Jan 24, 2017
499c56f
Use statically linked Pango (and dynamic dependencies)
piranna Feb 11, 2017
64f810e
Use static `harfbuzz` library
piranna Feb 11, 2017
490a6eb
Use static `glib` library
piranna Feb 12, 2017
4c23df7
Use static `fontconfig` library
piranna Feb 12, 2017
e1d1d79
Use static `expat` library
piranna Feb 12, 2017
13a2030
Use static `ffi` library
piranna Feb 12, 2017
5520bbc
Add missing headers
piranna Feb 13, 2017
7a71fec
Changed extension of all include files from `.gyp` to `.gypi`
piranna Feb 16, 2017
ebd1d2b
Merge branch 'master' of github.com:Automattic/node-canvas into static
piranna Feb 26, 2017
402457c
Renamed `static/cairo.gyp` to `static/cairo.gypi`
piranna Feb 26, 2017
38cf474
Merge branch 'master' of github.com:Automattic/node-canvas into static
piranna May 4, 2017
107be59
Applied @zbjornson patch
piranna May 4, 2017
588def3
Merge branch 'master' of github.com:Automattic/node-canvas into static
piranna Aug 3, 2017
ef51cbf
Check that all shared libraries are available before doing static com…
piranna Aug 4, 2017
09f2f31
Minor clean-up of `has_lib.js`
piranna Aug 4, 2017
6fe4a28
Unified and simplified checking functions at `has_lib.js`
piranna Aug 5, 2017
569f5b8
Fixed lint errors on `shared.gypi`
piranna Aug 5, 2017
3ce846f
Merge remote-tracking branch 'Automattic/master' into static
piranna Mar 21, 2020
4aad102
Fix checking of libraries (and return missing ones) & Update libpng
piranna Mar 22, 2020
d03fbe1
Fix search of system libraries
piranna Mar 22, 2020
1bbe95a
Merge remote-tracking branch 'Automattic/master' into static
piranna Oct 17, 2020
297514f
Update `devDependencies` to fix linting errors
piranna Oct 17, 2020
0129877
Fixed indentation
piranna Oct 17, 2020
6988889
By-pass shell checking tool on Windows
piranna Oct 17, 2020
9a1df72
Merge branch 'master' into static
piranna Aug 15, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ out.pdf
out.svg
.pomo
node_modules
deps/
npm-debug.log

# Vim cruft
*.swp
Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ benchmarks
examples
support
test
deps
155 changes: 9 additions & 146 deletions binding.gyp
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,151 +1,14 @@
{
'conditions': [
['OS=="win"', {
'variables': {
'GTK_Root%': 'C:/GTK', # Set the location of GTK all-in-one bundle
'with_jpeg%': 'false',
'with_gif%': 'false'
}
}, { # 'OS!="win"'
'variables': {
'with_jpeg%': '<!(node ./util/has_lib.js jpeg)',
'with_gif%': '<!(node ./util/has_lib.js gif)'
}
}]
],
'targets': [
'variables':
{
'target_name': 'canvas-postbuild',
'dependencies': ['canvas'],
'conditions': [
['OS=="win"', {
'copies': [{
'destination': '<(PRODUCT_DIR)',
'files': [
'<(GTK_Root)/bin/zlib1.dll',
'<(GTK_Root)/bin/libintl-8.dll',
'<(GTK_Root)/bin/libpng14-14.dll',
'<(GTK_Root)/bin/libpangocairo-1.0-0.dll',
'<(GTK_Root)/bin/libpango-1.0-0.dll',
'<(GTK_Root)/bin/libpangoft2-1.0-0.dll',
'<(GTK_Root)/bin/libpangowin32-1.0-0.dll',
'<(GTK_Root)/bin/libcairo-2.dll',
'<(GTK_Root)/bin/libfontconfig-1.dll',
'<(GTK_Root)/bin/libfreetype-6.dll',
'<(GTK_Root)/bin/libglib-2.0-0.dll',
'<(GTK_Root)/bin/libgobject-2.0-0.dll',
'<(GTK_Root)/bin/libgmodule-2.0-0.dll',
'<(GTK_Root)/bin/libgthread-2.0-0.dll',
'<(GTK_Root)/bin/libexpat-1.dll'
]
}]
}]
]
'has_cairo%': '<!(node ./util/has_lib.js cairo)'
},
{
'target_name': 'canvas',
'include_dirs': ["<!(node -e \"require('nan')\")"],
'sources': [
'src/Canvas.cc',
'src/CanvasGradient.cc',
'src/CanvasPattern.cc',
'src/CanvasRenderingContext2d.cc',
'src/color.cc',
'src/Image.cc',
'src/ImageData.cc',
'src/register_font.cc',
'src/init.cc'
],
'conditions': [
['OS=="win"', {
'libraries': [
'-l<(GTK_Root)/lib/cairo.lib',
'-l<(GTK_Root)/lib/libpng.lib',
'-l<(GTK_Root)/lib/pangocairo-1.0.lib',
'-l<(GTK_Root)/lib/pango-1.0.lib',
'-l<(GTK_Root)/lib/freetype.lib',
'-l<(GTK_Root)/lib/glib-2.0.lib',
'-l<(GTK_Root)/lib/gobject-2.0.lib'
],
'include_dirs': [
'<(GTK_Root)/include',
'<(GTK_Root)/include/cairo',
'<(GTK_Root)/include/pango-1.0',
'<(GTK_Root)/include/glib-2.0',
'<(GTK_Root)/include/freetype2',
'<(GTK_Root)/lib/glib-2.0/include'
],
'defines': [
'_USE_MATH_DEFINES' # for M_PI
],
'configurations': {
'Debug': {
'msvs_settings': {
'VCCLCompilerTool': {
'WarningLevel': 4,
'ExceptionHandling': 1,
'DisableSpecificWarnings': [4100, 4127, 4201, 4244, 4267, 4506, 4611, 4714, 4512]
}
}
},
'Release': {
'msvs_settings': {
'VCCLCompilerTool': {
'WarningLevel': 4,
'ExceptionHandling': 1,
'DisableSpecificWarnings': [4100, 4127, 4201, 4244, 4267, 4506, 4611, 4714, 4512]
}
}
}
}
}, { # 'OS!="win"'
'libraries': [
'<!@(pkg-config pixman-1 --libs)',
'<!@(pkg-config cairo --libs)',
'<!@(pkg-config libpng --libs)',
'<!@(pkg-config pangocairo --libs)',
'<!@(pkg-config freetype2 --libs)'
],
'include_dirs': [
'<!@(pkg-config cairo --cflags-only-I | sed s/-I//g)',
'<!@(pkg-config libpng --cflags-only-I | sed s/-I//g)',
'<!@(pkg-config pangocairo --cflags-only-I | sed s/-I//g)',
'<!@(pkg-config freetype2 --cflags-only-I | sed s/-I//g)'
]
}],
['with_jpeg=="true"', {
'defines': [
'HAVE_JPEG'
],
'conditions': [
['OS=="win"', {
'libraries': [
'-l<(GTK_Root)/lib/jpeg.lib'
]
}, {
'libraries': [
'-ljpeg'
]
}]
]
}],
['with_gif=="true"', {
'defines': [
'HAVE_GIF'
],
'conditions': [
['OS=="win"', {
'libraries': [
'-l<(GTK_Root)/lib/gif.lib'
]
}, {
'libraries': [
'-lgif'
]
}]
]
'conditions':
[
['has_cairo=="true"', {
'includes': ['shared.gypi']
}, {
'includes': ['static.gypi']
}]
]
}
]
]
}
20 changes: 20 additions & 0 deletions canvas.gypi
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
'target_name': 'canvas',
'include_dirs': [
"<!(node -e \"require('nan')\")"
],
'sources':
[
'src/Canvas.cc',
'src/CanvasGradient.cc',
'src/CanvasPattern.cc',
'src/CanvasRenderingContext2d.cc',
'src/color.cc',
'src/Image.cc',
'src/ImageData.cc',
'src/register_font.cc',
'src/init.cc',
],
'cflags!': ['-fno-exceptions'],
'cflags_cc!': ['-fno-exceptions']
}
192 changes: 192 additions & 0 deletions shared.gypi
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
{
'conditions':
[
['OS=="win"', {
'variables':
{
'GTK_Root%': 'C:/GTK', # Set the location of GTK all-in-one bundle
'with_jpeg%': 'false',
'with_gif%': 'false',
'with_pango%': 'false',
'with_freetype%': 'false'
}
}, { # OS!="win"'
'variables':
{
'with_jpeg%': '<!(node ./util/has_lib.js jpeg)',
'with_gif%': '<!(node ./util/has_lib.js gif)',
'with_pango%': '<!(node ./util/has_lib.js pango)',
'with_freetype%': '<!(node ./util/has_lib.js freetype)'
}
}]
],
'targets':
[
{
'target_name': 'canvas-postbuild',
'dependencies': ['canvas'],
'conditions':
[
['OS=="win"', {
'copies':
[{
'destination': '<(PRODUCT_DIR)',
'files':
[
'<(GTK_Root)/bin/libcairo-2.dll',
'<(GTK_Root)/bin/libexpat-1.dll',
'<(GTK_Root)/bin/libfontconfig-1.dll',
'<(GTK_Root)/bin/libfreetype-6.dll',
'<(GTK_Root)/bin/libglib-2.0-0.dll',
'<(GTK_Root)/bin/libgobject-2.0-0.dll',
'<(GTK_Root)/bin/libgmodule-2.0-0.dll',
'<(GTK_Root)/bin/libgthread-2.0-0.dll',
'<(GTK_Root)/bin/libintl-8.dll',
'<(GTK_Root)/bin/libpangocairo-1.0-0.dll',
'<(GTK_Root)/bin/libpango-1.0-0.dll',
'<(GTK_Root)/bin/libpangoft2-1.0-0.dll',
'<(GTK_Root)/bin/libpangowin32-1.0-0.dll',
'<(GTK_Root)/bin/libpng14-14.dll',
'<(GTK_Root)/bin/zlib1.dll',
]
}]
}]
]
},
{
'includes': ['canvas.gypi'],
'conditions':
[
['OS=="win"', {
'libraries':
[
'-l<(GTK_Root)/lib/cairo.lib',
'-l<(GTK_Root)/lib/freetype.lib',
'-l<(GTK_Root)/lib/glib-2.0.lib',
'-l<(GTK_Root)/lib/gobject-2.0.lib',
'-l<(GTK_Root)/lib/libpng.lib',
'-l<(GTK_Root)/lib/pangocairo-1.0.lib',
'-l<(GTK_Root)/lib/pango-1.0.lib'
],
'include_dirs':
[
'<(GTK_Root)/include',
'<(GTK_Root)/include/cairo',
'<(GTK_Root)/include/pango-1.0',
'<(GTK_Root)/include/glib-2.0',
'<(GTK_Root)/include/freetype2',
'<(GTK_Root)/lib/glib-2.0/include'
],
'defines':
[
'snprintf=_snprintf',
'_USE_MATH_DEFINES' # for M_PI
],
'configurations':
{
'Debug':
{
'msvs_settings':
{
'VCCLCompilerTool':
{
'WarningLevel': 4,
'ExceptionHandling': 1,
'DisableSpecificWarnings':
[
4100, 4127, 4201, 4244, 4267, 4506,
4611, 4714, 4512
]
}
}
},
'Release':
{
'msvs_settings':
{
'VCCLCompilerTool':
{
'WarningLevel': 4,
'ExceptionHandling': 1,
'DisableSpecificWarnings':
[
4100, 4127, 4201, 4244, 4267, 4506,
4611, 4714, 4512
]
}
}
}
}
}, { # OS!="win"'
'libraries':
[
'<!@(pkg-config pixman-1 --libs)',
'<!@(pkg-config cairo --libs)',
'<!@(pkg-config freetype2 --libs)',
'<!@(pkg-config libpng --libs)',
'<!@(pkg-config pangocairo --libs)'
],
'include_dirs':
[
'<!@(pkg-config cairo --cflags-only-I | sed s/-I//g)',
'<!@(pkg-config freetype2 --cflags-only-I | sed s/-I//g)',
'<!@(pkg-config libpng --cflags-only-I | sed s/-I//g)',
'<!@(pkg-config pangocairo --cflags-only-I | sed s/-I//g)'
]
}],

['with_freetype=="true"', {
'defines': ['HAVE_FREETYPE'],
'conditions':
[
['OS!="win"', {
'include_dirs': [
# tried to pass through cflags but failed. Need
# to include the header files of cairo AND
# freetype. Looking up the includes of cairo
# does both.
'<!@(pkg-config cairo --cflags-only-I | sed s/-I//g)'
]
}]
]
}],
['with_pango=="true"', {
'defines': ['HAVE_PANGO'],
'conditions':
[
['OS=="win"', {
'libraries': ['-l<(GTK_Root)/lib/pangocairo.lib']
}, { # 'OS!="win"'
'include_dirs': [ # tried to pass through cflags but failed
'<!@(pkg-config pangocairo --cflags-only-I | sed s/-I//g)'
],
'libraries': ['<!@(pkg-config pangocairo --libs)']
}]
]
}],
['with_jpeg=="true"', {
'defines': ['HAVE_JPEG'],
'conditions':
[
['OS=="win"', {
'libraries': ['-l<(GTK_Root)/lib/jpeg.lib']
}, {
'libraries': ['-ljpeg']
}]
]
}],
['with_gif=="true"', {
'defines': ['HAVE_GIF'],
'conditions':
[
['OS=="win"', {
'libraries': ['-l<(GTK_Root)/lib/gif.lib']
}, {
'libraries': ['-lgif']
}]
]
}]
]
}
]
}
Empty file modified src/CanvasRenderingContext2d.cc
100755 → 100644
Empty file.
Empty file modified src/init.cc
100755 → 100644
Empty file.
Loading