fast_resize 1.0.0 → 1.0.1
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 +4 -4
- data/CMakeLists.txt +1 -1
- data/VERSION +1 -1
- data/bindings/ruby/ext/fastresize/extconf.rb +43 -49
- data/bindings/ruby/lib/fastresize/version.rb +1 -1
- data/bindings/ruby/prebuilt/linux-aarch64/bin/fast_resize +0 -0
- data/bindings/ruby/prebuilt/linux-aarch64/lib/libfastresize.a +0 -0
- data/bindings/ruby/prebuilt/linux-aarch64.tar.gz +0 -0
- data/bindings/ruby/prebuilt/linux-x86_64/bin/fast_resize +0 -0
- data/bindings/ruby/prebuilt/linux-x86_64/lib/libfastresize.a +0 -0
- data/bindings/ruby/prebuilt/linux-x86_64.tar.gz +0 -0
- data/bindings/ruby/prebuilt/macos-arm64/bin/fast_resize +0 -0
- data/bindings/ruby/prebuilt/macos-arm64/lib/libfastresize.a +0 -0
- data/bindings/ruby/prebuilt/macos-arm64.tar.gz +0 -0
- data/bindings/ruby/prebuilt/macos-x86_64/bin/fast_resize +0 -0
- data/bindings/ruby/prebuilt/macos-x86_64/lib/libfastresize.a +0 -0
- data/bindings/ruby/prebuilt/macos-x86_64.tar.gz +0 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 15312e5eb156f36db6628dff713533776fa9dd6d47a9b6178e183222d4c9f25b
|
|
4
|
+
data.tar.gz: b7de20c4f15a88f74427ed719ba19c0788e923f0365c5a5cbc449dd0d84c5f8a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 53a5f46bd78f200e30335d136997ef437b678de24e45739db6a6c39c72333fc97380036a75cfa83229aeba2058692993e330a79d3fcf5161b95a30344b5ea8e6
|
|
7
|
+
data.tar.gz: f910871a62d24d82e445d684dd73f6db46c4f81cc9e68a40f21222376246340fe123db25cfce3c2a03e02966cbe7fa23c3ce870a772947c40100a243b76abf55
|
data/CMakeLists.txt
CHANGED
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.1
|
|
@@ -58,7 +58,7 @@ def check_prebuilt_library
|
|
|
58
58
|
end
|
|
59
59
|
end
|
|
60
60
|
|
|
61
|
-
return
|
|
61
|
+
return nil unless platform
|
|
62
62
|
|
|
63
63
|
ext_dir = File.dirname(__FILE__)
|
|
64
64
|
prebuilt_dir = File.expand_path("../../prebuilt/#{platform}", ext_dir)
|
|
@@ -66,36 +66,20 @@ def check_prebuilt_library
|
|
|
66
66
|
|
|
67
67
|
if File.exist?(lib_path)
|
|
68
68
|
puts "✅ Found pre-built library at #{lib_path}"
|
|
69
|
-
puts "⚡
|
|
70
|
-
|
|
71
|
-
File.open('Makefile', 'w') do |f|
|
|
72
|
-
f.puts "all:"
|
|
73
|
-
f.puts "\t@echo '✅ Using pre-built library for #{platform}'"
|
|
74
|
-
f.puts ""
|
|
75
|
-
f.puts "install:"
|
|
76
|
-
f.puts "\t@echo '✅ Using pre-built library for #{platform}'"
|
|
77
|
-
f.puts ""
|
|
78
|
-
f.puts "clean:"
|
|
79
|
-
f.puts "\t@echo 'Nothing to clean'"
|
|
80
|
-
end
|
|
81
|
-
|
|
82
|
-
return true
|
|
69
|
+
puts "⚡ Will compile Ruby binding with pre-built core library"
|
|
70
|
+
return prebuilt_dir
|
|
83
71
|
end
|
|
84
72
|
|
|
85
73
|
puts "⚠️ No pre-built library found for #{platform}"
|
|
86
|
-
puts "📦 Will compile from source..."
|
|
87
|
-
|
|
74
|
+
puts "📦 Will compile everything from source..."
|
|
75
|
+
nil
|
|
88
76
|
end
|
|
89
77
|
|
|
90
|
-
|
|
91
|
-
puts "🎉 Installation complete (pre-built binary)!"
|
|
92
|
-
exit 0
|
|
93
|
-
end
|
|
78
|
+
prebuilt_dir = check_prebuilt_library
|
|
94
79
|
|
|
95
|
-
puts "🔨 Compiling FastResize
|
|
80
|
+
puts "🔨 Compiling FastResize Ruby binding..."
|
|
96
81
|
|
|
97
82
|
$CXXFLAGS << " -std=c++14"
|
|
98
|
-
|
|
99
83
|
$CXXFLAGS << " -O3"
|
|
100
84
|
|
|
101
85
|
ext_dir = File.dirname(__FILE__)
|
|
@@ -107,46 +91,56 @@ unless File.directory?(include_dir)
|
|
|
107
91
|
abort "❌ Include directory not found: #{include_dir}"
|
|
108
92
|
end
|
|
109
93
|
|
|
110
|
-
unless File.directory?(src_dir)
|
|
111
|
-
abort "❌ Source directory not found: #{src_dir}"
|
|
112
|
-
end
|
|
113
|
-
|
|
114
|
-
puts "📂 Building from source tree: #{project_root}"
|
|
115
|
-
|
|
116
94
|
$INCFLAGS << " -I#{include_dir}"
|
|
117
95
|
|
|
118
96
|
['/opt/homebrew/include', '/usr/local/include'].each do |path|
|
|
119
97
|
$INCFLAGS << " -I#{path}" if File.directory?(path)
|
|
120
98
|
end
|
|
121
99
|
|
|
122
|
-
|
|
100
|
+
if prebuilt_dir
|
|
101
|
+
# Use pre-built core library
|
|
102
|
+
puts "📦 Using pre-built core library"
|
|
103
|
+
prebuilt_lib_dir = File.join(prebuilt_dir, 'lib')
|
|
104
|
+
$LDFLAGS << " -L#{prebuilt_lib_dir} -lfastresize"
|
|
123
105
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
106
|
+
# Only compile the Ruby binding
|
|
107
|
+
$srcs = ['fastresize_ext.cpp']
|
|
108
|
+
else
|
|
109
|
+
# Compile everything from source
|
|
110
|
+
puts "🔨 Compiling from source..."
|
|
127
111
|
|
|
128
|
-
unless
|
|
129
|
-
|
|
130
|
-
end
|
|
112
|
+
unless File.directory?(src_dir)
|
|
113
|
+
abort "❌ Source directory not found: #{src_dir}"
|
|
114
|
+
end
|
|
131
115
|
|
|
132
|
-
|
|
133
|
-
abort "❌ ERROR: zlib not found. Please install: brew install zlib (macOS) or apt-get install zlib1g-dev (Linux)"
|
|
134
|
-
end
|
|
116
|
+
puts "🔍 Searching for required libraries..."
|
|
135
117
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
end
|
|
118
|
+
unless find_library('jpeg', 'jpeg_CreateDecompress', '/opt/homebrew/lib', '/usr/local/lib', '/usr/lib')
|
|
119
|
+
abort "❌ ERROR: libjpeg not found. Please install: brew install jpeg (macOS) or apt-get install libjpeg-dev (Linux)"
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
unless find_library('png', 'png_create_read_struct', '/opt/homebrew/lib', '/usr/local/lib', '/usr/lib')
|
|
123
|
+
abort "❌ ERROR: libpng not found. Please install: brew install libpng (macOS) or apt-get install libpng-dev (Linux)"
|
|
124
|
+
end
|
|
143
125
|
|
|
144
|
-
|
|
145
|
-
|
|
126
|
+
unless find_library('z', 'inflate', '/opt/homebrew/lib', '/usr/local/lib', '/usr/lib')
|
|
127
|
+
abort "❌ ERROR: zlib not found. Please install: brew install zlib (macOS) or apt-get install zlib1g-dev (Linux)"
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
if find_library('webp', 'WebPDecode', '/opt/homebrew/lib', '/usr/local/lib', '/usr/lib')
|
|
131
|
+
puts "✅ WebP support enabled"
|
|
132
|
+
find_library('webpdemux', 'WebPDemuxGetFrame', '/opt/homebrew/lib', '/usr/local/lib', '/usr/lib')
|
|
133
|
+
find_library('sharpyuv', 'SharpYuvGetCPUInfo', '/opt/homebrew/lib', '/usr/local/lib', '/usr/lib')
|
|
134
|
+
else
|
|
135
|
+
puts "⚠️ WebP support disabled (library not found)"
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
$srcs = ['fastresize_ext.cpp'] + Dir.glob(File.join(src_dir, '*.cpp')).map { |f| File.basename(f) }
|
|
139
|
+
$VPATH << src_dir
|
|
140
|
+
end
|
|
146
141
|
|
|
147
142
|
puts "📝 Generating Makefile..."
|
|
148
143
|
|
|
149
144
|
create_makefile('fastresize/fastresize_ext')
|
|
150
145
|
|
|
151
146
|
puts "✅ Makefile generated successfully!"
|
|
152
|
-
puts "💡 Run 'make' to compile the extension"
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|