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 19 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
207 changes: 9 additions & 198 deletions binding.gyp
Original file line number Diff line number Diff line change
@@ -1,203 +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',
'with_rsvg%': 'false',
'variables': { # Nest jpeg_root to evaluate it before with_jpeg
'jpeg_root%': '<!(node ./util/win_jpeg_lookup)'
},
'jpeg_root%': '<(jpeg_root)', # Take value of nested variable
'conditions': [
['jpeg_root==""', {
'with_jpeg%': 'false'
}, {
'with_jpeg%': 'true'
}]
]
}
}, { # 'OS!="win"'
'variables': {
'with_jpeg%': '<!(node ./util/has_lib.js jpeg)',
'with_gif%': '<!(node ./util/has_lib.js gif)',
'with_rsvg%': '<!(node ./util/has_lib.js rsvg)'
}
}]
],
'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'
]
}]
}]
]
'shared%': '<!(node ./util/has_lib.js)'
},
{
'target_name': 'canvas',
'include_dirs': ["<!(node -e \"require('nan')\")"],
'sources': [
'src/backend/Backend.cc',
'src/backend/ImageBackend.cc',
'src/backend/PdfBackend.cc',
'src/backend/SvgBackend.cc',
'src/Backends.cc',
'src/Canvas.cc',
'src/CanvasGradient.cc',
'src/CanvasPattern.cc',
'src/CanvasRenderingContext2d.cc',
'src/closure.cc',
'src/color.cc',
'src/Image.cc',
'src/ImageData.cc',
'src/init.cc',
'src/register_font.cc',
'src/toBuffer.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"', {
'copies': [{
'destination': '<(PRODUCT_DIR)',
'files': [
'<(jpeg_root)/bin/jpeg62.dll',
]
}],
'include_dirs': [
'<(jpeg_root)/include'
],
'libraries': [
'-l<(jpeg_root)/lib/jpeg.lib',
]
}, {
'libraries': [
'-ljpeg'
]
}]
]
}],
['with_gif=="true"', {
'defines': [
'HAVE_GIF'
],
'conditions': [
['OS=="win"', {
'libraries': [
'-l<(GTK_Root)/lib/gif.lib'
]
}, {
'libraries': [
'-lgif'
]
}]
]
}],
['with_rsvg=="true"', {
'defines': [
'HAVE_RSVG'
],
'conditions': [
['OS=="win"', {
'libraries': [
'-l<(GTK_Root)/lib/librsvg-2-2.lib'
]
}, {
'include_dirs': [
'<!@(pkg-config librsvg-2.0 --cflags-only-I | sed s/-I//g)'
],
'libraries': [
'<!@(pkg-config librsvg-2.0 --libs)'
]
}]
]
'conditions':
[
['shared=="true" or OS=="win"', {
'includes': ['shared.gypi']
}, {
'includes': ['static.gypi']
}]
]
}
]
]
}
24 changes: 24 additions & 0 deletions canvas.gypi
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
'target_name': 'canvas',
'include_dirs': ["<!(node -e \"require('nan')\")"],
'sources': [
'src/backend/Backend.cc',
'src/backend/ImageBackend.cc',
'src/backend/PdfBackend.cc',
'src/backend/SvgBackend.cc',
'src/Backends.cc',
'src/Canvas.cc',
'src/CanvasGradient.cc',
'src/CanvasPattern.cc',
'src/CanvasRenderingContext2d.cc',
'src/closure.cc',
'src/color.cc',
'src/Image.cc',
'src/ImageData.cc',
'src/init.cc',
'src/register_font.cc',
'src/toBuffer.cc'
],
'cflags!': ['-fno-exceptions'],
'cflags_cc!': ['-fno-exceptions']
}
Loading