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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db4d679d44f55e55330bf72356fafd9bd297c3ed7ec874f9aa340efb852ae5b3
4
- data.tar.gz: 65010fc04ff3553480cad0aef1679d1c08099a49b9cf5674ff79843640744959
3
+ metadata.gz: 15312e5eb156f36db6628dff713533776fa9dd6d47a9b6178e183222d4c9f25b
4
+ data.tar.gz: b7de20c4f15a88f74427ed719ba19c0788e923f0365c5a5cbc449dd0d84c5f8a
5
5
  SHA512:
6
- metadata.gz: 6c75f1f8ddb58e98f1f488beb0747f4f5a5d6533438e56dc6ac6a031a73cdd9a256464c900c199fbec3fdac05a7b85fb56c58ca7bf2749efe3c475b153ddce87
7
- data.tar.gz: f3964ea686e7888e9a46f6c169dad56a507815df96f333e3f364cb1b6ae1b45f16b1622ec84e86767ea5e0e1bd34315bb30cf2bb2793b6b3a74842fb659dd58a
6
+ metadata.gz: 53a5f46bd78f200e30335d136997ef437b678de24e45739db6a6c39c72333fc97380036a75cfa83229aeba2058692993e330a79d3fcf5161b95a30344b5ea8e6
7
+ data.tar.gz: f910871a62d24d82e445d684dd73f6db46c4f81cc9e68a40f21222376246340fe123db25cfce3c2a03e02966cbe7fa23c3ce870a772947c40100a243b76abf55
data/CMakeLists.txt CHANGED
@@ -1,5 +1,5 @@
1
1
  cmake_minimum_required(VERSION 3.15)
2
- project(fast_resize VERSION 1.0.0 LANGUAGES CXX C)
2
+ project(fast_resize VERSION 1.0.1 LANGUAGES CXX C)
3
3
 
4
4
  set(CMAKE_CXX_STANDARD 14)
5
5
  set(CMAKE_CXX_STANDARD_REQUIRED ON)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
@@ -58,7 +58,7 @@ def check_prebuilt_library
58
58
  end
59
59
  end
60
60
 
61
- return false unless platform
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 "⚡ Skipping compilation (using pre-built binary)"
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
- false
74
+ puts "📦 Will compile everything from source..."
75
+ nil
88
76
  end
89
77
 
90
- if check_prebuilt_library
91
- puts "🎉 Installation complete (pre-built binary)!"
92
- exit 0
93
- end
78
+ prebuilt_dir = check_prebuilt_library
94
79
 
95
- puts "🔨 Compiling FastResize from source..."
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
- puts "🔍 Searching for required libraries..."
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
- unless find_library('jpeg', 'jpeg_CreateDecompress', '/opt/homebrew/lib', '/usr/local/lib', '/usr/lib')
125
- abort "❌ ERROR: libjpeg not found. Please install: brew install jpeg (macOS) or apt-get install libjpeg-dev (Linux)"
126
- end
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 find_library('png', 'png_create_read_struct', '/opt/homebrew/lib', '/usr/local/lib', '/usr/lib')
129
- abort "❌ ERROR: libpng not found. Please install: brew install libpng (macOS) or apt-get install libpng-dev (Linux)"
130
- end
112
+ unless File.directory?(src_dir)
113
+ abort "❌ Source directory not found: #{src_dir}"
114
+ end
131
115
 
132
- unless find_library('z', 'inflate', '/opt/homebrew/lib', '/usr/local/lib', '/usr/lib')
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
- if find_library('webp', 'WebPDecode', '/opt/homebrew/lib', '/usr/local/lib', '/usr/lib')
137
- puts " WebP support enabled"
138
- find_library('webpdemux', 'WebPDemuxGetFrame', '/opt/homebrew/lib', '/usr/local/lib', '/usr/lib')
139
- find_library('sharpyuv', 'SharpYuvGetCPUInfo', '/opt/homebrew/lib', '/usr/local/lib', '/usr/lib')
140
- else
141
- puts "⚠️ WebP support disabled (library not found)"
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
- $srcs = ['fastresize_ext.cpp'] + Dir.glob(File.join(src_dir, '*.cpp')).map { |f| File.basename(f) }
145
- $VPATH << src_dir
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"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FastResize
4
- VERSION = "1.0.0"
4
+ VERSION = "1.0.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fast_resize
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tran Huu Canh (0xTh3OKrypt)