tng 0.3.0 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1565b9f82ca06425bf3e88f44f018c0d34e7f3adc5cc91c111a593689303ef77
4
- data.tar.gz: 5a5868449487efa2f07d4d9d57aa3dc4ea1ac050f4b530f225e72bbb7067337a
3
+ metadata.gz: c3b187572f19a15aeb81dfd5be26c940e0e6d2c5a67e9a03a9df7234f11f7850
4
+ data.tar.gz: aac3a342c8560bead38235275e0c76fec3b53ff2fb1bcec4d29116404031e4b0
5
5
  SHA512:
6
- metadata.gz: 11945827a48c2f3e3ff40b5e7c24f356d466b00c0b1b0bcebf397188477b9ce08c10843d762d2ac1835c9ad582c2d26c283fb569eabff395981aa73273320c02
7
- data.tar.gz: '0644595817a169561541f4f052b417435e2ba21629cbf3c144d92a188006cec4fc953edb638517adaaca82bcab4e648782fdfdcb59795a2c1e8bfb42d334d04e'
6
+ metadata.gz: 1029c4728e0de909aa0598b5e5279289508c6a64429aac80004bacce00afadfd7a06d954f5790d0e8fba5a5849966a5e279d0cc72bb0bbc2850aae3b9e345c97
7
+ data.tar.gz: 03dfc617af94c583099e815a834fc90e9126b29343bf8a06c806f6afd2aa4955b36ec1c3a9bee434b2bc9ffd170cfbffd810c0f35b3b6ede171a7b4b0e3d3f78
data/Rakefile CHANGED
@@ -19,6 +19,15 @@ RbSys::ExtensionTask.new("tng", GEMSPEC) do |ext|
19
19
  ext.lib_dir = "lib/tng"
20
20
  end
21
21
 
22
+ # Create tasks for pre-compiled Go UI binaries (they already exist, just need to satisfy rb_sys)
23
+ %w[go-ui-darwin-amd64 go-ui-darwin-arm64 go-ui-linux-amd64 go-ui-linux-arm64].each do |binary|
24
+ file "binaries/#{binary}" do
25
+ unless File.exist?("binaries/#{binary}")
26
+ puts "⚠️ Warning: #{binary} not found in binaries/ - run build_both first for full distribution"
27
+ end
28
+ end
29
+ end
30
+
22
31
  # Create a task for the binaries/tng.bundle file that rb_sys expects
23
32
  file "binaries/tng.bundle" do
24
33
  FileUtils.mkdir_p("binaries")
@@ -49,6 +58,7 @@ task :redo do
49
58
  Rake::Task[:compile].invoke
50
59
 
51
60
  puts "Copying compiled binary to binaries/ directory..."
61
+ # Source and destination use simple name (tng.bundle/tng.so) for Ruby loading compatibility
52
62
  binary_name = RUBY_PLATFORM.include?("darwin") ? "tng.bundle" : "tng.so"
53
63
  source_file = File.join("lib", "tng", binary_name)
54
64
  destination_dir = "binaries"
@@ -94,56 +104,23 @@ end
94
104
 
95
105
  desc "Build binaries for both Mac and Linux platforms"
96
106
  task :build_both do
97
- puts "Building tng native extensions for both platforms..."
107
+ puts "Building tng native extensions and go-ui binaries..."
98
108
 
99
- # Clean up and create binaries directory
100
- puts "Cleaning up old binaries..."
101
- FileUtils.rm_rf("binaries")
102
- puts "Creating binaries directory..."
103
- FileUtils.mkdir_p("binaries")
104
- puts "Binaries directory created: #{Dir.pwd}/binaries/"
105
-
106
- # Build Mac version
107
- puts "Building Mac version..."
108
- system("bundle exec rake compile") || (puts "❌ Mac build failed"
109
- exit 1)
110
-
111
- # Copy Mac binary
112
- mac_binary = "lib/tng/tng.bundle"
113
- if File.exist?(mac_binary)
114
- FileUtils.cp(mac_binary, "binaries/tng.bundle")
115
- puts "Mac binary copied to binaries/ for packaging"
116
- else
117
- puts "❌ Mac binary not found"
118
- exit 1
119
- end
109
+ # Ensure the script is executable
110
+ system("chmod +x build_both.sh")
120
111
 
121
- # Ensure it's in lib/tng/ for gem loading
122
- if File.exist?("lib/tng/tng.bundle")
123
- puts "Mac binary confirmed in lib/tng/ for gem loading"
124
- else
125
- puts "Warning: Mac binary not found in lib/tng/ - copying from binaries/"
126
- FileUtils.cp("binaries/tng.bundle", "lib/tng/tng.bundle")
127
- end
128
-
129
- # Build Linux version
130
- puts "Building Linux version..."
131
- system("./build_linux_binaries.sh") || (puts "❌ Linux build failed"
132
- exit 1)
133
-
134
- puts "Build complete!"
135
- puts "Binaries for packaging:"
136
- system("ls -la binaries/")
137
- puts "Binaries for gem loading:"
138
- system("ls -la lib/tng/*.bundle lib/tng/*.so 2>/dev/null || echo 'No binaries found in lib/tng/'")
112
+ # Delegate to the shell script which handles everything correctly
113
+ # (go-ui binaries, mac binary renaming, linux builds)
114
+ system("./build_both.sh") || (puts "❌ Build failed"; exit 1)
139
115
  end
140
116
 
141
117
  desc "Development build: compile for current OS and build gem"
142
118
  task :dev do
143
- puts "🧹 Cleaning binaries directory..."
144
- FileUtils.rm_rf("binaries")
119
+ puts "🧹 Cleaning Rust binaries (preserving go-ui)..."
120
+ # Only remove tng binaries, keep go-ui binaries
121
+ Dir.glob("binaries/tng*").each { |f| FileUtils.rm_f(f) }
145
122
  FileUtils.mkdir_p("binaries")
146
- puts "✅ Binaries directory cleaned"
123
+ puts "✅ Rust binaries cleaned"
147
124
 
148
125
  Rake::Task[:redo].invoke
149
126