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

Support for FBDev, statically linked library and musl #571

Open
wants to merge 234 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
234 commits
Select commit Hold shift + click to select a range
e3ca10f
add deps
magicode Oct 27, 2013
1152204
fix drop stdout
magicode Oct 27, 2013
f918715
fix libjpeg by libjpeg-turbo
magicode Oct 27, 2013
e3a90bf
add config.h
magicode Oct 27, 2013
5a74d97
gif true
magicode Oct 27, 2013
dd45aa7
add switching static or shared by -thin option
magicode Oct 28, 2013
21dde5c
install with deps when cairo is not installed
magicode May 25, 2014
efd44ae
install with deps when cairo is not installed fix
magicode May 25, 2014
7a6d345
first proof of concept rendering directly to fbdev
Mar 8, 2015
d3d395d
added link to linux framebuffer surface
Mar 8, 2015
e219f5b
size of canvas is now set by size of fbdevice
Mar 8, 2015
466ad8b
started moving backends to external structure to be able to easier ad…
Mar 9, 2015
616021a
decide which cairo format to use by the bpp of the fb device
Mar 9, 2015
331baab
now with exceptions!
Mar 9, 2015
0d00caf
Merge remote-tracking branch 'upstream/master'
Apr 13, 2015
8d9a8ce
added script to install linux dependencies
Apr 13, 2015
181a7af
Merge remote-tracking branch 'upstream/master'
May 1, 2015
454691b
node-canvas now using backend system
May 1, 2015
ee958d6
Merge remote-tracking branch 'ReneHollander/master'
piranna May 2, 2015
79d55f6
Added deps to .gitignore
piranna May 2, 2015
a94281b
removed nodejs 0.6 support
May 2, 2015
af21558
Left 'deps' folder only for downloaded files
piranna May 2, 2015
1b38bb6
Fixed included dirs for standalone build
piranna May 2, 2015
b6d267e
Merge remote-tracking branch 'ReneHollander/master'
piranna Jun 21, 2015
c85d923
Removed useless index.js file (main is already defined in package.json)
piranna Jun 21, 2015
e10f8f7
Compile dependencies statically
piranna Jun 21, 2015
e7997f8
Re-enabled FontFace.cc source code file & minor fix-ups
piranna Jun 22, 2015
8bcf1fd
Updated versions of dependencies and libraries & improved ensure_deps.sh
piranna Jun 25, 2015
590aa6b
Fix download of dependencies (silent download)
piranna Jun 25, 2015
2eaef66
Move cairo/src to cairo/cairo so includes could work correctly
piranna Jun 25, 2015
a877adf
Added missing files to compile
piranna Jun 28, 2015
e8de74d
Implemented virtual destructor for Backend & move function definitions
piranna Jun 28, 2015
597832c
Merge branch 'master' of github.com:Automattic/node-canvas
piranna Jun 28, 2015
1c26ac2
removed install packages script
Jun 29, 2015
9227b9e
fixed Backend.cc not being compiled
Jun 29, 2015
9b2b642
removed main.cc and Makefile
Jun 29, 2015
131ca13
removed binary executable
Jun 29, 2015
00c48fc
reformatted code
Jul 4, 2015
fce293e
first work on better backend system
Jul 4, 2015
a99c318
instantiate backends in javascript
Jul 5, 2015
f480bf7
canvas now accepts backends
Jul 5, 2015
c038190
fixed Canvas.backends being uppercase
Jul 5, 2015
e6afa9c
ticking clock drawn to framebuffer
Jul 5, 2015
ac6ce1c
Allow to define FBDev device from command line
piranna Jul 5, 2015
83cf4ce
Download fontconfig.h file & clean-up of includes
piranna Jul 5, 2015
50348ef
added experimental x11 backend
Jul 5, 2015
f7b99b9
fixed seg fault during gc
Jul 5, 2015
78fffe2
use diffrent code to figure out screensize
Jul 5, 2015
5763708
Merge remote-tracking branch 'ReneHollander/master'
piranna Jul 5, 2015
fda7ec0
now using smem_len to get framebuffer size and not calculate it
Jul 6, 2015
f348fb4
still trying to fix broken fbdev backend on some devices
Jul 7, 2015
b8b0a6a
fixed stupid syntax errors
Jul 7, 2015
da5d4ff
Put in common configuration of canvas for shared and static
piranna Jul 8, 2015
89e84d9
Use fb_vinfo.xres_virtual to calculate the stride
piranna Jul 8, 2015
ab7d2c1
Merge branch 'fixing_fbdev'
piranna Jul 8, 2015
69b72ce
Clean-up of backend classes
piranna Jul 9, 2015
f725bea
Change resolution of FBDev & clean-up of API
piranna Jul 10, 2015
4c41045
Fix for MacBook framebuffer & better FbDev example
piranna Jul 12, 2015
1403e52
Improved X11 backend (no draw)
piranna Jul 13, 2015
d1688b3
Conditionally compile Xlib backend
piranna Jul 23, 2015
13a378c
Merge remote-tracking branch 'Automattic/master'
piranna Jul 25, 2015
5cca798
Removed FbDev formats not available on Cairo
piranna Jul 26, 2015
09aaed0
Updated version of libpng
piranna May 14, 2016
5e843d0
Merge branch 'master' of github.com:Automattic/node-canvas
piranna May 14, 2016
7f774d9
Fixed file permissions
piranna May 20, 2016
8bcf82b
Fix rebase to 1.3.15
piranna Sep 11, 2016
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
7ab3501
Merge branch 'master' of github.com:Automattic/node-canvas
piranna May 9, 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
d17789c
Merge branch 'static'
piranna Aug 5, 2017
27c6ac9
Merge branch 'master' of github.com:Automattic/node-canvas
piranna Nov 19, 2018
6dbb57a
Fixed linting
piranna Nov 19, 2018
fc2c12b
Updated code and restore back FbDev support (X11 is buggy and disabled)
piranna Nov 19, 2018
ad0a41f
Extracted code for FbDev support from #571 to make it easier to revie…
piranna Nov 19, 2018
3a1d55d
Fix linting
piranna Nov 20, 2018
9c8a13d
Merge branch 'linting' into framebuffer
piranna Nov 20, 2018
9ebb624
Move `getFormat()` implementation out of header file
piranna Nov 20, 2018
b37d648
Added `Backend::setFormat()` method
piranna Nov 20, 2018
2aa765c
Added `FBDevBackend::setFormat()` method
piranna Nov 20, 2018
2e60f78
[FBDevBackend] Get `width` and `height` in constructor
piranna Nov 20, 2018
c29ef89
[FBDevBackend] Set `format` in constructor
piranna Nov 20, 2018
851ffb2
[FBDevBackend][fix] Wrongly copy&pasted variable
piranna Nov 20, 2018
4940a7b
Merge branch 'master' of github.com:ventrata/node-canvas into framebu…
piranna Nov 28, 2018
ad2ddc0
[FbDev] Set default FbDev device as constant
piranna Nov 28, 2018
3e4f681
[FbDev] Move initialization of framebuffer device to `initFbDev()` me…
piranna Nov 28, 2018
cf99d46
[FbDev] Allow to define framebuffer device from `Canvas` constructor
piranna Nov 28, 2018
5cc8631
[FbDev] Don't regenerate surface on creation for non-standard color m…
piranna Nov 28, 2018
9a583f3
[FbDev] Don't regenerate surface on creation to define the width and …
piranna Nov 28, 2018
5838252
[FbDev][fix] Set framebuffer dimensions if specified
piranna Nov 28, 2018
497f03d
[Backends] Call to virtual `onPaint()` method after all painting oper…
piranna Nov 30, 2018
b8ee1c9
Merge branch 'dirty_surface' into framebuffer
piranna Nov 30, 2018
7601bf9
[FbDev] Basic implementation of `onPaint()` method
piranna Nov 30, 2018
848ab2e
[Backend] Use default arguments to remove duplicated constructor
piranna Dec 1, 2018
a4c9065
[Backend] Dispatch thread at `onPaint()` to wait for VSync and swap b…
piranna Nov 30, 2018
e3984e3
[Backend] Replaced usage of `AsyncWorker` class for `uv_thread_create()`
piranna Dec 1, 2018
84e8386
Merge branch 'FbDev' into framebuffer
piranna Dec 1, 2018
d46969c
Merge branch 'dirty_surface' into framebuffer
piranna Dec 1, 2018
5f1866b
[FBDevBackend] Wait for framebuffer VSync
piranna Dec 1, 2018
4b866ca
[FBDevBackend] Enable double buffering
piranna Dec 1, 2018
72b933c
[FBDevBackend] Remove double buffer hack and instead destroy Cairo su…
piranna Dec 2, 2018
0236d72
[Backends] Renamed `listenOnDraw` to `listenOnPaint`
piranna Dec 3, 2018
1dad8d4
[Backend] Splitted `dispatchWaitVSync()` from `onPaint()`
piranna Dec 3, 2018
225c5b7
[Backend] Added support `requestAnimationFrame()`
piranna Dec 3, 2018
c681222
Merge branch 'dirty_surface' into framebuffer
piranna Dec 3, 2018
ffaac6b
[Backend] Add async method `waitVSync()`
piranna Dec 6, 2018
db2878f
Merge branch 'waitVSync' into FbDev_vsync
piranna Dec 6, 2018
c2e07fe
[FbDevBackend] Add support for framebuffer native VSync
piranna Dec 6, 2018
b394d31
[Backend] `swapBuffers()` method
piranna Dec 6, 2018
d617198
Merge branch 'doubleBuffer' into FbDev_vsync
piranna Dec 6, 2018
3618b40
[FbDevBackend] Support for optional double buffering (disabled by def…
piranna Dec 7, 2018
995a3f3
[FbDevBackend] Allow to enable double buffering from Javascript
piranna Dec 7, 2018
0e8be22
clean-up
piranna Dec 7, 2018
81fa69f
[FbDev] Show used pixel format in `simple_fbdev` example
piranna Dec 7, 2018
b79795d
[Backend] Made `destroySurface()` method virtual
piranna Dec 8, 2018
0778ed8
[FbDevBackend] Made `copyBackBuffer()` copy only screen size memory
piranna Dec 8, 2018
9f183c3
[FbDevBackend] Add `destroySurface()` that free in-memory buffer
piranna Dec 8, 2018
73b4b4d
[FbDevBackend] Replaced `forceUseCopyBuffer` for lazy checking of pan…
piranna Dec 8, 2018
6864325
[FbDevBackend] Added support for 24 bits framebuffers
piranna Dec 10, 2018
6bf6f1e
[FbDev] Replaced `useCopyBackBuffer` for `useFlipPages` for readibility
piranna Dec 10, 2018
9c97438
[FbDevBackend] Use `calloc()` to clean data at in-memory buffer
piranna Dec 10, 2018
8b8edd2
[Backends] Don't return `cairo_surface_t` objects in `createSurface()`
piranna Dec 13, 2018
71ee4c1
Merge branch 'protected_surfaces' into FbDev_vsync
piranna Dec 13, 2018
c21b8a5
[FbDevBackend] Don't return surface in `createSurface()`
piranna Dec 13, 2018
1c8cdea
[FbDevBackend][fix] Use pages flipping if driver supports vertical pa…
piranna Dec 13, 2018
b50fe3e
[FbDevBackend] Prevent double free'ing of back buffer memory
piranna Dec 13, 2018
96383b1
[FbDevBackend] Clean-up & improved code readibility
piranna Dec 13, 2018
f07cba4
[FbDevBackend] `mmap()` graphic memory on `createSurface()` & code cl…
piranna Dec 14, 2018
b0f81d7
[FbDevBackend] Option to enable flip buffers (disabled by default)
piranna Dec 15, 2018
e90b95c
[FbDevBackend][fix] Reset vertical panning before creating surface
piranna Dec 15, 2018
d737842
[FbDevBackend][fix] Use `swapBuffers()` always for 24 bits images
piranna Dec 15, 2018
a183067
[FbDevBackend] Code clean-up, better readibility
piranna Dec 15, 2018
a0fd140
Merge remote-tracking branch 'Automattic/master' into FbDev
piranna Dec 24, 2018
6a22cb2
Fixed documentation
piranna Dec 24, 2018
6c2d65d
Merge remote-tracking branch 'Automattic/master' into waitVSync
piranna Dec 24, 2018
49bc847
Merge remote-tracking branch 'Automattic/master'
piranna Mar 20, 2020
ff8b503
Merge remote-tracking branch 'Automattic/master' into FbDev
piranna Mar 21, 2020
bfb4f1d
Fixes after merge
piranna Mar 21, 2020
b5f5dd0
Fixed linting
piranna Mar 21, 2020
64fb2e5
Isolated `lint` script
piranna Mar 21, 2020
45021a7
Throw exception for unknown canvas type instead create `Image` by def…
piranna Mar 21, 2020
601a415
Updated dependencies
piranna Mar 21, 2020
3fc6170
Updated dependencies
piranna Mar 21, 2020
352f369
Throw exception for unknown canvas type instead create `Image` by def…
piranna Mar 21, 2020
64fd7d6
Merge remote-tracking branch 'Automattic/master' into protected_surfaces
piranna Mar 21, 2020
f7d3a76
Merge remote-tracking branch 'Automattic/master' into doubleBuffer
piranna Mar 21, 2020
3978af3
Moved screen-only `swapBuffers()` method to isolated `ScreenBuffer` c…
piranna Mar 21, 2020
6d8c0d2
Merge branch 'waitVSync' into doubleBuffer
piranna Mar 21, 2020
8e24861
Moved screens-only `waitVSync` method to `ScreenBackend` abstract class
piranna Mar 21, 2020
7b8f402
Merge branch 'FbDev' into FbDev_vsync
piranna Mar 21, 2020
aa3a6ae
Fixes after merge
piranna Mar 21, 2020
64fe34b
Merge branch 'doubleBuffer' into FbDev_vsync
piranna Mar 21, 2020
3023b36
Fixes after merge
piranna Mar 21, 2020
2b4ec38
Merge branch 'FbDev_vsync' into framebuffer
piranna Mar 21, 2020
6161eb7
Fixes after merge & removal of raf API
piranna Mar 21, 2020
f884acc
Clean-ups
piranna Mar 21, 2020
1bfe1f1
Flip between two surfaces instead of delete and create a new one each…
piranna Mar 21, 2020
5194e0d
Remove useless swapping of buffers pointers
piranna Mar 21, 2020
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
fdf14bc
Remove unmaintained Node.js v6 and v8
piranna Mar 22, 2020
3f38854
Remove unmaintained Node.js v6 and v8
piranna Mar 22, 2020
17256c7
Remove unmaintained Node.js v6 and v8
piranna Mar 22, 2020
9758ed8
Merge remote-tracking branch 'Automattic/master'
piranna Oct 17, 2020
16ca1ee
Merge remote-tracking branch 'Automattic/master' into RangeError
piranna Oct 17, 2020
2667031
Merge remote-tracking branch 'Automattic/master' into protected_surfaces
piranna Oct 17, 2020
efacea1
Merge remote-tracking branch 'Automattic/master' into doubleBuffer
piranna Oct 17, 2020
1bbe95a
Merge remote-tracking branch 'Automattic/master' into static
piranna Oct 17, 2020
6fb4bb4
Merge remote-tracking branch 'Automattic/master' into FbDev
piranna Oct 17, 2020
974cf5d
Merge remote-tracking branch 'Automattic/master' into FbDev_vsync
piranna Oct 17, 2020
e3b16f0
Merge remote-tracking branch 'Automattic/master' into framebuffer
piranna Oct 17, 2020
fcba4d1
Update `devDependencies` to fix linting errors
piranna Oct 17, 2020
c014caa
Update `devDependencies` to fix linting errors
piranna Oct 17, 2020
173a8e4
Update `devDependencies` to fix linting errors
piranna Oct 17, 2020
297514f
Update `devDependencies` to fix linting errors
piranna Oct 17, 2020
0688eff
Update `devDependencies` to fix linting errors
piranna Oct 17, 2020
144337d
Update `devDependencies` to fix linting errors
piranna Oct 17, 2020
e8cfd1a
Update `devDependencies` to fix linting errors
piranna Oct 17, 2020
d7db3bf
Update `devDependencies` to fix linting errors
piranna Oct 17, 2020
6c0eefc
Fix `standard.js` linting
piranna Oct 17, 2020
0129877
Fixed indentation
piranna Oct 17, 2020
6988889
By-pass shell checking tool on Windows
piranna Oct 17, 2020
6f7876a
Enable FbDev backend only on Linux
piranna Oct 17, 2020
81904df
Enable FbDev backend only on Linux
piranna Oct 17, 2020
2cb428e
Enable FbDev backend only on Linux
piranna Oct 17, 2020
fee2521
Enable FbDev backend only on Linux
piranna Oct 17, 2020
2757d9b
Remove useless `<sys/time.h>` include
piranna Oct 17, 2020
9daf309
Fix 'Canvas#type' test
piranna Oct 17, 2020
a429c00
By-pass shell checking tool on Windows
piranna Oct 17, 2020
1f8fea2
Don't check for X11 support on Windows
piranna Oct 17, 2020
b3fd398
Fixed signature of FbDevBackend
piranna Oct 18, 2020
1edad18
Merge branch 'FbDev' into FbDev_vsync
piranna Oct 18, 2020
2e54e21
Merge branch 'doubleBuffer' into FbDev_vsync
piranna Oct 18, 2020
4979f69
Merge branch 'FbDev_vsync' into framebuffer
piranna Oct 18, 2020
167e045
Merge branch 'RangeError'
piranna Oct 18, 2020
bf8808f
Merge branch 'protected_surfaces'
piranna Oct 18, 2020
b744522
Merge branch 'static'
piranna Oct 18, 2020
97070ce
Merge branch 'framebuffer'
piranna Oct 18, 2020
79c3b84
Remove useless `.gyp` files in benefict of `.gypi` ones
piranna Oct 18, 2020
058c3b4
Renamed `X11Backend` to `XlibBackend`
piranna Oct 18, 2020
c9af67e
Remove warning of unsorted initialization
piranna Oct 20, 2020
aa0c1d2
Fixed and updated examples
piranna Oct 20, 2020
0423452
Updated and fixed code for `XlibBackend`
piranna Oct 20, 2020
18ffbdf
Enable usage of `Xlib` backend
piranna Oct 20, 2020
ffd38a6
Fix linting
piranna Oct 20, 2020
1a79dd6
Improved npm scripts
piranna Oct 24, 2020
63e180f
[XlibBackend] Improve abstraction
piranna Oct 24, 2020
1358bcc
Change duplication of `destroySurface()` for assertion it was destroyed
piranna Oct 25, 2020
851661a
Fixed setting of DISPLAY name
piranna Oct 25, 2020
412dfde
Fixed missing definitions
piranna Oct 25, 2020
975a0da
Fixed bad signature of destructor
piranna Oct 25, 2020
7db6bc6
Set window size hints
piranna Oct 25, 2020
30c41e1
Remove window Close and Maximize buttons and resize operation
piranna Oct 25, 2020
8a45973
Updated dependencies
piranna Oct 25, 2020
e3efd68
Updated Win32 backend (WiP)
piranna Nov 6, 2020
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ out.pdf
out.svg
.pomo
node_modules
deps/
npm-debug.log
package-lock.json

# Vim cruft
*.swp
*.un~
deps/
npm-debug.log
7 changes: 7 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
testing
build
benchmarks
examples
support
test
deps
21 changes: 21 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.18362.0",
"compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "msvc-x64"
}
],
"version": 4
}
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"files.associations": {
"*.rh": "cpp"
}
}
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ This project is an implementation of the Web Canvas API and implements that API
### createCanvas()

> ```ts
> createCanvas(width: number, height: number, type?: 'PDF'|'SVG') => Canvas
> createCanvas(width: number, height: number, type?: 'fbdev'|'pdf'|'svg') => Canvas
> ```

Creates a Canvas instance. This method works in both Node.js and Web browsers, where there is no Canvas constructor. (See `browser.js` for the implementation that runs in browsers.)
Expand Down
233 changes: 16 additions & 217 deletions binding.gyp
Original file line number Diff line number Diff line change
@@ -1,222 +1,21 @@
{
'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': [
{
'target_name': 'canvas-postbuild',
'dependencies': ['canvas'],
'conditions': [
'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'
]
}]
}]
]
},
{
'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/bmp/BMPParser.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'
],
'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, 4611
]
}
}
'includes': ['shared.gypi']
}, {
'variables':
{
'shared%': '<!(node ./util/has_lib.js)'
},
'Release': {
'msvs_settings': {
'VCCLCompilerTool': {
'WarningLevel': 4,
'ExceptionHandling': 1,
'DisableSpecificWarnings': [
4100, 4611
]
}
}
}
}
}, { # '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)'
],
'cflags': ['-Wno-cast-function-type'],
'cflags!': ['-fno-exceptions'],
'cflags_cc!': ['-fno-exceptions']
}],
['OS=="mac"', {
'xcode_settings': {
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES'
}
}],
['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"', {
'copies': [{
'destination': '<(PRODUCT_DIR)',
'files': [
'<(GTK_Root)/bin/librsvg-2-2.dll',
'<(GTK_Root)/bin/libgdk_pixbuf-2.0-0.dll',
'<(GTK_Root)/bin/libgio-2.0-0.dll',
'<(GTK_Root)/bin/libcroco-0.6-3.dll',
'<(GTK_Root)/bin/libgsf-1-114.dll',
'<(GTK_Root)/bin/libxml2-2.dll'
]
}],
'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"', {
'includes': ['shared.gypi']
}, {
'includes': ['static.gypi']
}]
]
}]
]
}
]
]
}
59 changes: 59 additions & 0 deletions canvas.gypi
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
'variables':
{
'has_FBDev%': 'true'
},
'conditions':
[
['OS=="win"',
{
'sources': ['src/backend/Win32Backend.cc']
}, { # 'OS!="win"'
'cflags!': ['-fno-exceptions'],
'cflags_cc!': ['-fno-exceptions'],
'variables':
{
'has_X11%': '<!(node ./util/has_lib.js X11)'
},
'conditions':
[
['has_X11=="true"',
{
'defines': ['HAS_X11'],
'sources': [
'src/backend/XlibBackend.cc',
'src/backend/XlibBackendPriv.cc'
],
'libraries': ['-lX11', '-lXrender', '-lXext']
}]
],
}],
['OS=="linux" and has_FBDev=="true"',
{
'defines': ['HAS_FBDEV'],
'sources': ['src/backend/FBDevBackend.cc']
}]
],
'target_name': 'canvas',
'include_dirs': ["<!(node -e \"require('nan')\")"],
'sources':
[
'src/backend/Backend.cc',
'src/backend/ImageBackend.cc',
'src/backend/PdfBackend.cc',
'src/backend/ScreenBackend.cc',
'src/backend/SvgBackend.cc',
'src/bmp/BMPParser.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'
]
}
Loading