fast_resize 1.0.0 → 1.0.2
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 +6 -3
- data/VERSION +1 -1
- data/bindings/ruby/ext/fastresize/extconf.rb +67 -48
- 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: bd3aea592f3a52ae5fc7ebb84ef68060882a074cb6b4c5410c21849ba0febdb0
|
|
4
|
+
data.tar.gz: ca6510f5daf824934331282efea95e1f9bae18583348fd843effb7e654a9d6f7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 82f40d7012d6591a553fce82986a15541d4ae2919114aac5424802f0487e03ea23fa9e02a2dd4ce053584d10a09b3e702c9056a04beb7eca5e7ff33e7a4df789
|
|
7
|
+
data.tar.gz: 32d55b77ba417f169ffbc801eb7c014fe1b73303ee931cf4c397e6bd2e5d59ee85b4499903c7cfd8d9097700b3c6213bf4ac6d8408808d7e8381a3c2a1a177d2
|
data/CMakeLists.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
cmake_minimum_required(VERSION 3.15)
|
|
2
|
-
project(fast_resize VERSION 1.0.
|
|
2
|
+
project(fast_resize VERSION 1.0.2 LANGUAGES CXX C)
|
|
3
3
|
|
|
4
4
|
set(CMAKE_CXX_STANDARD 14)
|
|
5
5
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
@@ -10,8 +10,11 @@ if(NOT CMAKE_BUILD_TYPE)
|
|
|
10
10
|
set(CMAKE_BUILD_TYPE Release)
|
|
11
11
|
endif()
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
# Disable LTO for static library builds to ensure compatibility across GCC versions
|
|
14
|
+
# LTO bytecode format changes between GCC versions, causing link failures
|
|
15
|
+
# when the static library is used with a different GCC version
|
|
16
|
+
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
|
|
17
|
+
set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG")
|
|
15
18
|
|
|
16
19
|
# Option for building shared vs static libraries
|
|
17
20
|
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.2
|
|
@@ -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,81 @@ 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
|
-
end
|
|
106
|
+
# Link required image libraries that libfastresize.a depends on
|
|
107
|
+
puts "🔍 Linking required image libraries..."
|
|
127
108
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
109
|
+
# These libraries are required by the pre-built libfastresize.a
|
|
110
|
+
unless find_library('png', 'png_create_read_struct', '/opt/homebrew/lib', '/usr/local/lib', '/usr/lib')
|
|
111
|
+
abort "❌ ERROR: libpng not found. Please install: brew install libpng (macOS) or apt-get install libpng-dev (Linux)"
|
|
112
|
+
end
|
|
131
113
|
|
|
132
|
-
unless find_library('
|
|
133
|
-
|
|
134
|
-
end
|
|
114
|
+
unless find_library('jpeg', 'jpeg_CreateDecompress', '/opt/homebrew/lib', '/usr/local/lib', '/usr/lib')
|
|
115
|
+
abort "❌ ERROR: libjpeg not found. Please install: brew install jpeg (macOS) or apt-get install libjpeg-dev (Linux)"
|
|
116
|
+
end
|
|
135
117
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
118
|
+
unless find_library('z', 'inflate', '/opt/homebrew/lib', '/usr/local/lib', '/usr/lib')
|
|
119
|
+
abort "❌ ERROR: zlib not found. Please install: brew install zlib (macOS) or apt-get install zlib1g-dev (Linux)"
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# WebP is optional
|
|
123
|
+
if find_library('webp', 'WebPDecode', '/opt/homebrew/lib', '/usr/local/lib', '/usr/lib')
|
|
124
|
+
puts "✅ WebP support enabled"
|
|
125
|
+
find_library('webpdemux', 'WebPDemuxGetFrame', '/opt/homebrew/lib', '/usr/local/lib', '/usr/lib')
|
|
126
|
+
find_library('sharpyuv', 'SharpYuvGetCPUInfo', '/opt/homebrew/lib', '/usr/local/lib', '/usr/lib')
|
|
127
|
+
else
|
|
128
|
+
puts "⚠️ WebP support disabled (library not found)"
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Only compile the Ruby binding
|
|
132
|
+
$srcs = ['fastresize_ext.cpp']
|
|
140
133
|
else
|
|
141
|
-
|
|
142
|
-
|
|
134
|
+
# Compile everything from source
|
|
135
|
+
puts "🔨 Compiling from source..."
|
|
136
|
+
|
|
137
|
+
unless File.directory?(src_dir)
|
|
138
|
+
abort "❌ Source directory not found: #{src_dir}"
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
puts "🔍 Searching for required libraries..."
|
|
142
|
+
|
|
143
|
+
unless find_library('jpeg', 'jpeg_CreateDecompress', '/opt/homebrew/lib', '/usr/local/lib', '/usr/lib')
|
|
144
|
+
abort "❌ ERROR: libjpeg not found. Please install: brew install jpeg (macOS) or apt-get install libjpeg-dev (Linux)"
|
|
145
|
+
end
|
|
143
146
|
|
|
144
|
-
|
|
145
|
-
|
|
147
|
+
unless find_library('png', 'png_create_read_struct', '/opt/homebrew/lib', '/usr/local/lib', '/usr/lib')
|
|
148
|
+
abort "❌ ERROR: libpng not found. Please install: brew install libpng (macOS) or apt-get install libpng-dev (Linux)"
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
unless find_library('z', 'inflate', '/opt/homebrew/lib', '/usr/local/lib', '/usr/lib')
|
|
152
|
+
abort "❌ ERROR: zlib not found. Please install: brew install zlib (macOS) or apt-get install zlib1g-dev (Linux)"
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
if find_library('webp', 'WebPDecode', '/opt/homebrew/lib', '/usr/local/lib', '/usr/lib')
|
|
156
|
+
puts "✅ WebP support enabled"
|
|
157
|
+
find_library('webpdemux', 'WebPDemuxGetFrame', '/opt/homebrew/lib', '/usr/local/lib', '/usr/lib')
|
|
158
|
+
find_library('sharpyuv', 'SharpYuvGetCPUInfo', '/opt/homebrew/lib', '/usr/local/lib', '/usr/lib')
|
|
159
|
+
else
|
|
160
|
+
puts "⚠️ WebP support disabled (library not found)"
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
$srcs = ['fastresize_ext.cpp'] + Dir.glob(File.join(src_dir, '*.cpp')).map { |f| File.basename(f) }
|
|
164
|
+
$VPATH << src_dir
|
|
165
|
+
end
|
|
146
166
|
|
|
147
167
|
puts "📝 Generating Makefile..."
|
|
148
168
|
|
|
149
169
|
create_makefile('fastresize/fastresize_ext')
|
|
150
170
|
|
|
151
171
|
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
|