nfroidure / ttf2woff2

Convert ttf files to woff2.
MIT License
297 stars 39 forks source link

node-gyp 6.0.0 upgrade (resolves python2 dependency) #55

Closed neilsh closed 4 years ago

neilsh commented 4 years ago

Currently ttf2woff2 requires node-gyp 4.0, which requires python2 (instead of python3). This has led to issues like https://github.com/nfroidure/ttf2woff2/issues/37 and https://github.com/nfroidure/ttf2woff2/issues/28

Earlier this month node-gyp released version 6.0.0, which accepts python3 (https://github.com/nodejs/node-gyp/pull/1844). This PR upgrades the package.json and package-lock.json to node-gyp 6.0.0.

https://github.com/nodejs/node-gyp/blob/master/CHANGELOG.md

I've verified it builds with the new node-gyp version:

$ node-gyp --version
v6.0.0

$ node-gyp configure
gyp info it worked if it ends with ok
gyp info using node-gyp@6.0.0
gyp info using node@10.17.0 | linux | x64
gyp info find Python using Python version 3.6.8 found at "/usr/bin/python3"
gyp info spawn /usr/bin/python3
gyp info spawn args [ '/home/neil/git/ttf2woff2/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/home/neil/git/ttf2woff2/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/neil/git/ttf2woff2/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/neil/.cache/node-gyp/10.17.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/neil/.cache/node-gyp/10.17.0',
gyp info spawn args   '-Dnode_gyp_dir=/home/neil/git/ttf2woff2/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/neil/.cache/node-gyp/10.17.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/neil/git/ttf2woff2',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info ok 

$ node-gyp build
gyp info it worked if it ends with ok
gyp info using node-gyp@6.0.0
gyp info using node@10.17.0 | linux | x64
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/home/neil/git/ttf2woff2/build'
  CXX(target) Release/obj.target/addon/csrc/addon.o
  CXX(target) Release/obj.target/addon/csrc/woff2/glyph.o
  CXX(target) Release/obj.target/addon/csrc/woff2/font.o
  CXX(target) Release/obj.target/addon/csrc/woff2/normalize.o
  CXX(target) Release/obj.target/addon/csrc/woff2/table_tags.o
  CXX(target) Release/obj.target/addon/csrc/woff2/transform.o
  CXX(target) Release/obj.target/addon/csrc/woff2/variable_length.o
  CXX(target) Release/obj.target/addon/csrc/woff2/woff2_common.o
  CXX(target) Release/obj.target/addon/csrc/woff2/woff2_enc.o
  CXX(target) Release/obj.target/addon/csrc/enc/backward_references.o
  CXX(target) Release/obj.target/addon/csrc/enc/block_splitter.o
  CXX(target) Release/obj.target/addon/csrc/enc/brotli_bit_stream.o
  CXX(target) Release/obj.target/addon/csrc/enc/encode.o
  CXX(target) Release/obj.target/addon/csrc/enc/encode_parallel.o
  CXX(target) Release/obj.target/addon/csrc/enc/entropy_encode.o
  CXX(target) Release/obj.target/addon/csrc/enc/histogram.o
  CXX(target) Release/obj.target/addon/csrc/enc/literal_cost.o
  CXX(target) Release/obj.target/addon/csrc/enc/metablock.o
  CXX(target) Release/obj.target/addon/csrc/enc/streams.o
  SOLINK_MODULE(target) Release/obj.target/addon.node
  COPY Release/addon.node
make: Leaving directory '/home/neil/git/ttf2woff2/build'
gyp info ok 
nfroidure commented 4 years ago

Thanks, I'll just try it on my setup before merging, doing this asap.

neilsh commented 4 years ago

hi @nfroidure , gentle reminder to check if you've had a chance to test it yet :)

garrettw commented 4 years ago

Could we get a release that includes this? Your other package, gulp-iconfont, needs it.