From 82740267c956faefbd38a7de26fa957906a86d0f Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Tue, 7 May 2024 00:32:33 +0200 Subject: [PATCH] Actually just skip everything for json (the top level one) --- lib/rubygems_plugin.rb | 47 +++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/lib/rubygems_plugin.rb b/lib/rubygems_plugin.rb index b5b45a4..2e397df 100644 --- a/lib/rubygems_plugin.rb +++ b/lib/rubygems_plugin.rb @@ -89,7 +89,12 @@ def post_install elsif extname.to_s == "sqlite3" extname = "sqlite3_native" extconf_args = ["--enable-system-libraries", "--with-pkg-config=pkgconf"] - elsif ['unfext', 'byebug', 'msgpack', 'json', 'generator', 'parser'].include?(extname.to_s) + elsif extname.to_s == 'json' + # json has a makefile, but really it's only json/ext/parser and + # json/ext/generator that are compiled + puts "Not exporting json because it's shallow and doesn't have a static lib (parser and generator do). #{extension_dir.to_s}" + next + elsif ['unfext', 'byebug', 'msgpack', 'generator', 'parser'].include?(extname.to_s) # No-op else puts "Warning: rubygems_plugin.post_install: no configuration given for extension_dir=#{extension_dir}" @@ -148,30 +153,24 @@ def post_install StaticExtensionPlugin.make_static extension_dir, results - # json has a makefile, but really it's only json/ext/parser and - # json/ext/generator that are compiled - if extname.to_s == 'json' - puts "Not exporting json because it's shallow and doesn't have a static lib (parser and generator do). #{extension_dir.to_s}" - else - File.open(@ext_init_file_name, "a") do |f| - f.puts "extern \"C\" {" - f.puts " void Init_#{extname}(void);" - f.puts "}" - f.puts - f.puts "namespace embedded_help {" - f.puts " inline void init_#{extname}() {" - f.puts " Init_#{extname}();" - f.puts " }" - f.puts "}" - f.puts - end + File.open(@ext_init_file_name, "a") do |f| + f.puts "extern \"C\" {" + f.puts " void Init_#{extname}(void);" + f.puts "}" + f.puts + f.puts "namespace embedded_help {" + f.puts " inline void init_#{extname}() {" + f.puts " Init_#{extname}();" + f.puts " }" + f.puts "}" + f.puts + end - File.open(@exports_file_name, "a") do |f| - f.puts "add_library(#{target_name} STATIC IMPORTED)" - f.puts "set_target_properties(#{target_name} PROPERTIES IMPORTED_LOCATION \"${OPENSTUDIO_GEMS_DIR}#{lib_path}\")" - f.puts "list(APPEND ruby_extension_libs #{target_name})" - f.puts - end + File.open(@exports_file_name, "a") do |f| + f.puts "add_library(#{target_name} STATIC IMPORTED)" + f.puts "set_target_properties(#{target_name} PROPERTIES IMPORTED_LOCATION \"${OPENSTUDIO_GEMS_DIR}#{lib_path}\")" + f.puts "list(APPEND ruby_extension_libs #{target_name})" + f.puts end end end