image_optim_pack 0.3.0.20161206 → 0.3.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 +8 -8
- data/.rubocop.yml +9 -0
- data/Makefile +96 -87
- data/README.markdown +1 -1
- data/image_optim_pack.gemspec +1 -1
- data/script/update_versions +14 -11
- data/spec/image_optim_spec.rb +0 -1
- data/vendor/darwin-i386/libpng.dylib +0 -0
- data/vendor/darwin-i386/optipng +0 -0
- data/vendor/darwin-i386/pngcrush +0 -0
- data/vendor/darwin-i386/pngquant +0 -0
- data/vendor/darwin-x86_64/libpng.dylib +0 -0
- data/vendor/darwin-x86_64/optipng +0 -0
- data/vendor/darwin-x86_64/pngcrush +0 -0
- data/vendor/darwin-x86_64/pngquant +0 -0
- data/vendor/freebsd-amd64/libpng.so +0 -0
- data/vendor/freebsd-amd64/optipng +0 -0
- data/vendor/freebsd-amd64/pngcrush +0 -0
- data/vendor/freebsd-amd64/pngquant +0 -0
- data/vendor/freebsd-i386/libpng.so +0 -0
- data/vendor/freebsd-i386/optipng +0 -0
- data/vendor/freebsd-i386/pngcrush +0 -0
- data/vendor/freebsd-i386/pngquant +0 -0
- data/vendor/linux-i686/libpng.so +0 -0
- data/vendor/linux-i686/optipng +0 -0
- data/vendor/linux-i686/pngcrush +0 -0
- data/vendor/linux-i686/pngquant +0 -0
- data/vendor/linux-x86_64/libpng.so +0 -0
- data/vendor/linux-x86_64/optipng +0 -0
- data/vendor/linux-x86_64/pngcrush +0 -0
- data/vendor/linux-x86_64/pngquant +0 -0
- data/vendor/openbsd-amd64/libpng.so +0 -0
- data/vendor/openbsd-amd64/optipng +0 -0
- data/vendor/openbsd-amd64/pngcrush +0 -0
- data/vendor/openbsd-amd64/pngquant +0 -0
- data/vendor/openbsd-i386/libpng.so +0 -0
- data/vendor/openbsd-i386/optipng +0 -0
- data/vendor/openbsd-i386/pngcrush +0 -0
- data/vendor/openbsd-i386/pngquant +0 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MWRmOWUzZTBiYmE2Yzk3MzMzNWQxYTZlYzc5M2U2NDE1NzY2YzI0Yg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MjBmYjE0MGE3ZTYzNWYyZWZiZmUxOTczODVmYWFlNThiNmE2OTVhYg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZjNiZGNlMzdmYWVmNzRhYWQwOGVmYTEwNWQyYzJjM2ZhZjlkNGNjOGJiMTAz
|
10
|
+
M2JjMjNmOTYzOGNiMTZiYWYwNWVmNTYxZTE5NTJhNzIwMDViNTcxOGJhYmJm
|
11
|
+
M2E4N2IyZTU4Mjk2MTQ1MWY4OGE4MzVjY2M5NTAwMzVjNjgzZDU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NTM3MDM3ZWU3YjBkMmMxYTc1MmU1NTYyZTU0NTBlYWQ1NTVlODM5YzczZGFi
|
14
|
+
ODQwMTUzZjY3M2M1MWZiNjhmNGM3ZTU4MjA5ZWVmZjI5YTVkNDgzYTFjNjZk
|
15
|
+
NTFlYTU3OTdlOTI1NTMxNTA4MDM5MjdhZTY4ZjQ0YjUwYjUzNGI=
|
data/.rubocop.yml
CHANGED
@@ -3,6 +3,9 @@ AllCops:
|
|
3
3
|
- '*.gemspec'
|
4
4
|
- Vagrantfile
|
5
5
|
|
6
|
+
Bundler/OrderedGems:
|
7
|
+
Enabled: false
|
8
|
+
|
6
9
|
Lint/EndAlignment:
|
7
10
|
AlignWith: variable
|
8
11
|
|
@@ -39,6 +42,9 @@ Style/IfUnlessModifier:
|
|
39
42
|
Style/IndentHash:
|
40
43
|
EnforcedStyle: consistent
|
41
44
|
|
45
|
+
Style/MultilineBlockChain:
|
46
|
+
Enabled: false
|
47
|
+
|
42
48
|
Style/PercentLiteralDelimiters:
|
43
49
|
PreferredDelimiters:
|
44
50
|
'%w': '[]'
|
@@ -56,6 +62,9 @@ Style/SpaceBeforeBlockBraces:
|
|
56
62
|
Style/SpaceInsideHashLiteralBraces:
|
57
63
|
EnforcedStyle: no_space
|
58
64
|
|
65
|
+
Style/SpecialGlobalVars:
|
66
|
+
Enabled: false
|
67
|
+
|
59
68
|
Style/TrailingCommaInArguments:
|
60
69
|
EnforcedStyleForMultiline: no_comma
|
61
70
|
|
data/Makefile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
all :
|
2
2
|
|
3
3
|
# ====== VERSIONS ======
|
4
4
|
|
@@ -9,11 +9,11 @@ JPEGARCHIVE_VER := 2.1.1
|
|
9
9
|
JPEGOPTIM_VER := 1.4.4
|
10
10
|
LIBJPEG_VER := 9b
|
11
11
|
LIBMOZJPEG_VER := 3.1
|
12
|
-
LIBPNG_VER := 1.6.
|
12
|
+
LIBPNG_VER := 1.6.27
|
13
13
|
LIBZ_VER := 1.2.8
|
14
14
|
OPTIPNG_VER := 0.7.6
|
15
15
|
PNGCRUSH_VER := 1.8.10
|
16
|
-
PNGQUANT_VER := 2.8.
|
16
|
+
PNGQUANT_VER := 2.8.2
|
17
17
|
|
18
18
|
# ====== CONSTANTS ======
|
19
19
|
|
@@ -33,69 +33,78 @@ BUILD_ROOT_DIR := $(CURDIR)/build
|
|
33
33
|
BUILD_DIR := $(BUILD_ROOT_DIR)/$(OS)-$(ARCH)
|
34
34
|
OUTPUT_ROOT_DIR := $(CURDIR)/vendor
|
35
35
|
OUTPUT_DIR := $(OUTPUT_ROOT_DIR)/$(OS)-$(ARCH)
|
36
|
+
$(shell mkdir -p $(DL_DIR) $(BUILD_DIR) $(OUTPUT_DIR))
|
36
37
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
38
|
+
ANSI_RED=\033[31m
|
39
|
+
ANSI_GREEN=\033[32m
|
40
|
+
ANSI_MAGENTA=\033[35m
|
41
|
+
ANSI_RESET=\033[0m
|
41
42
|
|
42
43
|
# ====== HELPERS ======
|
43
44
|
|
44
45
|
downcase = $(shell echo $1 | tr A-Z a-z)
|
45
46
|
|
46
|
-
mkpath := mkdir -p
|
47
47
|
ln_s := ln -sf
|
48
48
|
tar := $(shell if command -v gtar >/dev/null 2>&1; then echo gtar; else echo tar; fi)
|
49
49
|
|
50
|
-
# lock using %.lock dir, download to %.tmp rename to %, remove %.lock
|
51
|
-
define download
|
52
|
-
while ! mkdir $2.lock 2> /dev/null; do sleep 1; done
|
53
|
-
wget -q -O $2.tmp $1
|
54
|
-
mv $2.tmp $2
|
55
|
-
rm -r $2.lock
|
56
|
-
endef
|
57
|
-
|
58
50
|
# ====== ARCHIVES ======
|
59
51
|
|
60
|
-
$(shell $(mkpath) $(DL_DIR)) # just create dl dir
|
61
|
-
|
62
52
|
ARCHIVES :=
|
63
53
|
|
64
54
|
# $1 - name of archive
|
65
|
-
# $2 - url of archive with [VER] for replace with version
|
66
|
-
# $3 - optional addition to version string
|
67
55
|
define archive
|
68
|
-
$1_URL := $(subst [VER],$($1_VER)$(strip $3),$(strip $2))
|
69
|
-
$1_DIR := $(BUILD_DIR)/$(call downcase,$1)
|
70
|
-
$1_TGZ := $(DL_DIR)/$(call downcase,$1)-$($1_VER)$(strip $3).tar.gz
|
71
56
|
ARCHIVES += $1
|
57
|
+
$1_DIR := $(BUILD_DIR)/$(call downcase,$1)
|
58
|
+
$1_TGZ := $(DL_DIR)/$(call downcase,$1)-$($1_VER).tar.gz
|
59
|
+
$1_EXTRACTED := $$($1_DIR)/__$$(notdir $$($1_TGZ))__
|
60
|
+
$$($1_EXTRACTED) : $$($1_TGZ)
|
61
|
+
rm -rf $$(@D)
|
62
|
+
mkdir $$(@D)
|
63
|
+
$(tar) -C $$(@D) --strip-components=1 -xzf $$<
|
64
|
+
touch $$(@D)/__$$(notdir $$<)__
|
65
|
+
endef
|
66
|
+
|
67
|
+
# $1 - name of archive
|
68
|
+
# $2 - url of archive with [VER] for replace with version
|
69
|
+
define archive-dl
|
70
|
+
$(call archive,$1)
|
72
71
|
# download archive from url
|
73
|
-
$$($1_TGZ)
|
74
|
-
|
72
|
+
$$($1_TGZ) :
|
73
|
+
while ! mkdir $$@.lock 2> /dev/null; do sleep 1; done
|
74
|
+
wget -q -O $$@.tmp $(subst [VER],$($1_VER),$(strip $2))
|
75
|
+
mv $$@.tmp $$@
|
76
|
+
rm -r $$@.lock
|
75
77
|
endef
|
76
78
|
|
77
|
-
$(eval $(call archive,ADVANCECOMP, https://github.com/amadvance/advancecomp/releases/download/v[VER]/advancecomp-[VER].tar.gz))
|
78
|
-
$(eval $(call archive,GIFSICLE, http://www.lcdf.org/gifsicle/gifsicle-[VER].tar.gz))
|
79
|
-
$(eval $(call archive,JHEAD, http://www.sentex.net/~mwandel/jhead/jhead-[VER].tar.gz))
|
80
|
-
$(eval $(call archive,JPEGARCHIVE, https://github.com/danielgtaylor/jpeg-archive/archive/[VER].tar.gz))
|
81
|
-
$(eval $(call archive,JPEGOPTIM, http://www.kokkonen.net/tjko/src/jpegoptim-[VER].tar.gz))
|
82
|
-
$(eval $(call archive,LIBJPEG, http://www.ijg.org/files/jpegsrc.v[VER].tar.gz))
|
83
|
-
$(eval $(call archive,LIBMOZJPEG, https://github.com/mozilla/mozjpeg/archive/v[VER].tar.gz))
|
84
|
-
$(eval $(call archive,LIBPNG, http://prdownloads.sourceforge.net/libpng/libpng-[VER].tar.gz?download))
|
85
|
-
$(eval $(call archive,LIBZ, http://prdownloads.sourceforge.net/libpng/zlib-[VER].tar.gz?download))
|
86
|
-
$(eval $(call archive,OPTIPNG, http://prdownloads.sourceforge.net/optipng/optipng-[VER].tar.gz?download))
|
87
|
-
$(eval $(call archive,PNGCRUSH, http://prdownloads.sourceforge.net/pmt/pngcrush-[VER]-nolib.tar.gz?download))
|
88
|
-
$(eval $(call archive,PNGQUANT
|
79
|
+
$(eval $(call archive-dl,ADVANCECOMP, https://github.com/amadvance/advancecomp/releases/download/v[VER]/advancecomp-[VER].tar.gz))
|
80
|
+
$(eval $(call archive-dl,GIFSICLE, http://www.lcdf.org/gifsicle/gifsicle-[VER].tar.gz))
|
81
|
+
$(eval $(call archive-dl,JHEAD, http://www.sentex.net/~mwandel/jhead/jhead-[VER].tar.gz))
|
82
|
+
$(eval $(call archive-dl,JPEGARCHIVE, https://github.com/danielgtaylor/jpeg-archive/archive/[VER].tar.gz))
|
83
|
+
$(eval $(call archive-dl,JPEGOPTIM, http://www.kokkonen.net/tjko/src/jpegoptim-[VER].tar.gz))
|
84
|
+
$(eval $(call archive-dl,LIBJPEG, http://www.ijg.org/files/jpegsrc.v[VER].tar.gz))
|
85
|
+
$(eval $(call archive-dl,LIBMOZJPEG, https://github.com/mozilla/mozjpeg/archive/v[VER].tar.gz))
|
86
|
+
$(eval $(call archive-dl,LIBPNG, http://prdownloads.sourceforge.net/libpng/libpng-[VER].tar.gz?download))
|
87
|
+
$(eval $(call archive-dl,LIBZ, http://prdownloads.sourceforge.net/libpng/zlib-[VER].tar.gz?download))
|
88
|
+
$(eval $(call archive-dl,OPTIPNG, http://prdownloads.sourceforge.net/optipng/optipng-[VER].tar.gz?download))
|
89
|
+
$(eval $(call archive-dl,PNGCRUSH, http://prdownloads.sourceforge.net/pmt/pngcrush-[VER]-nolib.tar.gz?download))
|
90
|
+
$(eval $(call archive,PNGQUANT))
|
89
91
|
|
90
92
|
PNGQUANT_GIT := $(DL_DIR)/pngquant.git
|
91
93
|
$(PNGQUANT_GIT) :; git clone --recursive https://github.com/pornel/pngquant.git $@
|
92
94
|
$(PNGQUANT_TGZ) : $(PNGQUANT_GIT)
|
93
|
-
|
94
|
-
cd $(PNGQUANT_GIT) &&
|
95
|
+
while ! mkdir $@.lock 2> /dev/null; do sleep 1; done
|
96
|
+
cd $(PNGQUANT_GIT) && git fetch && git checkout -q $(PNGQUANT_VER) && git submodule -q update
|
97
|
+
cd $(PNGQUANT_GIT) && $(tar) --exclude=.git -czf $(PNGQUANT_TGZ) .
|
98
|
+
rm -r $@.lock
|
95
99
|
|
96
|
-
|
100
|
+
download : $(foreach archive,$(ARCHIVES),$($(archive)_TGZ))
|
101
|
+
.PHONY : download
|
97
102
|
|
98
|
-
|
103
|
+
download-tidy-up :
|
104
|
+
rm -f $(filter-out $(foreach archive,$(ARCHIVES),$($(archive)_TGZ)) $(PNGQUANT_GIT),$(wildcard $(DL_DIR)/*.*))
|
105
|
+
.PHONY : download-tidy-up
|
106
|
+
|
107
|
+
# ====== PRODUCTS ======
|
99
108
|
|
100
109
|
PRODUCTS :=
|
101
110
|
|
@@ -106,11 +115,9 @@ define target-build
|
|
106
115
|
$1_BASENAME := $(or $3,$(call downcase,$1))
|
107
116
|
$1_DIR := $($(or $2,$1)_DIR)
|
108
117
|
$1_TGZ := $($(or $2,$1)_TGZ)
|
118
|
+
$1_EXTRACTED := $($(or $2,$1)_EXTRACTED)
|
109
119
|
$1_TARGET := $$($1_DIR)/$$($1_BASENAME)
|
110
|
-
|
111
|
-
$$($1_TARGET) $$($1_DIR)/__$$(notdir $$($1_TGZ))__ : $$($1_TGZ)
|
112
|
-
# second dependency on check file
|
113
|
-
$$($1_TARGET) : $$($1_DIR)/__$$(notdir $$($1_TGZ))__
|
120
|
+
$$($1_TARGET) : $$($1_EXTRACTED)
|
114
121
|
endef
|
115
122
|
|
116
123
|
# $1 - product name
|
@@ -119,14 +126,15 @@ endef
|
|
119
126
|
define target
|
120
127
|
$(call target-build,$1,$2,$3)
|
121
128
|
PRODUCTS += $1
|
129
|
+
$1_DESTINATION := $$(OUTPUT_DIR)/$$($1_BASENAME)
|
122
130
|
# copy product to output dir
|
123
|
-
$$(
|
131
|
+
$$($1_DESTINATION) : $$($1_TARGET)
|
124
132
|
temppath=`mktemp tmp.XXXXXXXXXX` && \
|
125
133
|
strip $$< -Sx -o "$$$$temppath" && \
|
126
134
|
chmod 755 "$$$$temppath" && \
|
127
135
|
mv "$$$$temppath" $$@
|
128
136
|
# short name target
|
129
|
-
$(call downcase,$1) : | $$(
|
137
|
+
$(call downcase,$1) : | $$($1_DESTINATION)
|
130
138
|
endef
|
131
139
|
|
132
140
|
$(eval $(call target,ADVPNG,ADVANCECOMP))
|
@@ -145,24 +153,22 @@ $(eval $(call target,PNGQUANT))
|
|
145
153
|
|
146
154
|
# ====== TARGETS ======
|
147
155
|
|
148
|
-
all :
|
149
|
-
|
150
|
-
|
151
|
-
download : $(foreach archive,$(ARCHIVES),$($(archive)_TGZ))
|
152
|
-
download-tidy-up :
|
153
|
-
rm -f $(filter-out $(foreach archive,$(ARCHIVES),$($(archive)_TGZ)),$(wildcard $(DL_DIR)/*.*))
|
156
|
+
all : build
|
157
|
+
@$(MAKE) test
|
158
|
+
.PHONY : all
|
154
159
|
|
155
|
-
build : $(
|
160
|
+
build : $(call downcase,$(PRODUCTS))
|
161
|
+
.PHONY : build
|
156
162
|
|
157
163
|
define check_bin
|
158
164
|
@test -f $(OUTPUT_DIR)/$1 || \
|
159
|
-
{ printf "$(
|
165
|
+
{ printf "$(ANSI_RED)no $1 found$(ANSI_RESET)\n"; exit 1; }
|
160
166
|
@printf "$1: "; \
|
161
167
|
VERSION=$$($(OUTPUT_DIR)/$1 $2 | fgrep -o $3) || \
|
162
|
-
{ printf "$(
|
168
|
+
{ printf "$(ANSI_RED)Expected $3, got $$($(OUTPUT_DIR)/$1 $2)$(ANSI_RESET)\n"; exit 1; }; \
|
163
169
|
ARCH=$$(file -b $(OUTPUT_DIR)/$1 | fgrep -o '$(ARCH_STRING)') || \
|
164
|
-
{ printf "$(
|
165
|
-
printf "$(
|
170
|
+
{ printf "$(ANSI_RED)Expected $(ARCH_STRING), got $$(file -b $(OUTPUT_DIR)/$1)$(ANSI_RESET)\n"; exit 1; }; \
|
171
|
+
printf "$(ANSI_GREEN)$$VERSION$(ANSI_RESET) / $(ANSI_MAGENTA)$$ARCH$(ANSI_RESET)\n"
|
166
172
|
endef
|
167
173
|
|
168
174
|
ifdef IS_DARWIN
|
@@ -183,25 +189,33 @@ test :
|
|
183
189
|
$(call check_bin,optipng,--version,$(OPTIPNG_VER))
|
184
190
|
$(call check_bin,pngcrush,-version 2>&1,$(PNGCRUSH_VER))
|
185
191
|
$(call check_bin,pngquant,--help,$(PNGQUANT_VER))
|
192
|
+
.PHONY : test
|
193
|
+
|
194
|
+
livecheck :; @$(foreach archive,$(ARCHIVES),script/livecheck $(call downcase,$(archive)) $($(archive)_VER);)
|
195
|
+
.PHONY : livecheck
|
186
196
|
|
187
|
-
|
197
|
+
Makefile.updated :
|
198
|
+
cat Makefile | script/update_versions > Makefile.updated
|
188
199
|
|
189
|
-
update-versions :
|
190
|
-
|
191
|
-
|
200
|
+
update-versions : Makefile.updated
|
201
|
+
mv Makefile.updated Makefile
|
202
|
+
.PHONY : update-versions
|
192
203
|
|
193
204
|
# ====== CLEAN ======
|
194
205
|
|
195
206
|
clean :
|
196
207
|
rm -rf $(BUILD_DIR)
|
197
208
|
rm -rf $(OUTPUT_DIR)
|
209
|
+
.PHONY : clean
|
198
210
|
|
199
211
|
clean-all :
|
200
212
|
rm -rf $(BUILD_ROOT_DIR)
|
201
213
|
rm -rf $(OUTPUT_ROOT_DIR)
|
214
|
+
.PHONY : clean-all
|
202
215
|
|
203
216
|
clobber : clean-all
|
204
217
|
rm -rf $(DL_DIR)
|
218
|
+
.PHONY : clobber
|
205
219
|
|
206
220
|
# ====== BUILDING ======
|
207
221
|
|
@@ -209,7 +223,8 @@ clobber : clean-all
|
|
209
223
|
# $2 - list of dependency products
|
210
224
|
define depend-build
|
211
225
|
# depend this product on every specified product
|
212
|
-
|
226
|
+
$($1_EXTRACTED) : $$(filter-out $($1_EXTRACTED),$(foreach dep,$2,$$($(dep)_EXTRACTED)))
|
227
|
+
$($1_TARGET) : $(foreach dep,$2,$$($(dep)_TARGET))
|
213
228
|
# add dependent product dir to CPATH, LIBRARY_PATH and PKG_CONFIG_PATH
|
214
229
|
$($1_TARGET) : export CPATH := $(subst $(eval) ,:,$(foreach dep,$2,$$($(dep)_DIR)))
|
215
230
|
$($1_TARGET) : export LIBRARY_PATH := $$(CPATH)
|
@@ -221,14 +236,7 @@ endef
|
|
221
236
|
define depend
|
222
237
|
$(call depend-build,$1,$2)
|
223
238
|
# depend output of this product on output of every specified product
|
224
|
-
$$(
|
225
|
-
endef
|
226
|
-
|
227
|
-
define clean_untar
|
228
|
-
rm -rf $(@D)
|
229
|
-
$(mkpath) $(@D)
|
230
|
-
$(tar) -C $(@D) --strip-components=1 -xzf $<
|
231
|
-
touch $(@D)/__$(notdir $<)__
|
239
|
+
$$($1_DESTINATION) : $(foreach dep,$2,$$($(dep)_DESTINATION))
|
232
240
|
endef
|
233
241
|
|
234
242
|
pkgconfig_pwd = perl -pi -e 's/(?<=dir=).*/$$ENV{PWD}/'
|
@@ -277,40 +285,43 @@ endif
|
|
277
285
|
|
278
286
|
## advpng
|
279
287
|
$(eval $(call depend,ADVPNG,LIBZ))
|
280
|
-
$(ADVPNG_TARGET)
|
288
|
+
$(ADVPNG_TARGET) :
|
281
289
|
cd $(@D) && ./configure LDFLAGS="$(XORIGIN)"
|
282
290
|
cd $(@D) && $(MAKE) advpng
|
283
291
|
$(call chrpath_origin,$@)
|
284
292
|
|
285
293
|
## gifsicle
|
286
|
-
$(GIFSICLE_TARGET)
|
294
|
+
$(GIFSICLE_TARGET) :
|
287
295
|
cd $(@D) && ./configure
|
288
296
|
cd $(@D) && $(MAKE) gifsicle
|
289
297
|
cd $(@D) && $(ln_s) src/gifsicle .
|
290
298
|
|
291
299
|
## jhead
|
292
|
-
$(JHEAD_TARGET)
|
300
|
+
$(JHEAD_TARGET) :
|
293
301
|
cd $(@D) && $(MAKE) jhead CC="$(CC) $(GCC_FLAGS)"
|
294
302
|
|
295
303
|
## jpeg-recompress
|
296
304
|
$(eval $(call depend-build,JPEG-RECOMPRESS,LIBMOZJPEG))
|
297
|
-
$(JPEG-RECOMPRESS_TARGET)
|
305
|
+
$(JPEG-RECOMPRESS_TARGET) :
|
298
306
|
cd $(@D) && $(MAKE) jpeg-recompress CC="$(CC) $(GCC_FLAGS)" LIBJPEG=$(LIBMOZJPEG_TARGET) \
|
299
307
|
MAKE=$(MAKE) # fix for bsd in jpeg-archive-2.1.1
|
300
308
|
|
301
309
|
## jpegoptim
|
302
310
|
$(eval $(call depend,JPEGOPTIM,LIBJPEG))
|
303
|
-
$(JPEGOPTIM_TARGET)
|
311
|
+
$(JPEGOPTIM_TARGET) :
|
304
312
|
cd $(@D) && ./configure LDFLAGS="$(XORIGIN)" --host $(HOST)
|
305
313
|
cd $(@D) && $(MAKE) jpegoptim
|
306
314
|
$(call chrpath_origin,$@)
|
307
315
|
|
308
316
|
## jpegtran
|
309
317
|
$(eval $(call depend,JPEGTRAN,LIBJPEG))
|
310
|
-
$(JPEGTRAN_TARGET)
|
318
|
+
$(JPEGTRAN_TARGET) :
|
319
|
+
cd $(@D) && $(MAKE) jpegtran LDFLAGS="$(XORIGIN)"
|
320
|
+
cd $(@D) && $(ln_s) .libs/jpegtran .
|
321
|
+
$(call chrpath_origin,$(JPEGTRAN_TARGET))
|
311
322
|
|
312
323
|
## libjpeg
|
313
|
-
$(LIBJPEG_TARGET)
|
324
|
+
$(LIBJPEG_TARGET) :
|
314
325
|
cd $(@D) && ./configure CC="$(CC) $(GCC_FLAGS)"
|
315
326
|
$(libtool_target_soname)
|
316
327
|
ifdef IS_DARWIN
|
@@ -318,12 +329,10 @@ ifdef IS_DARWIN
|
|
318
329
|
else
|
319
330
|
cd $(@D) && $(MAKE) libjpeg.la
|
320
331
|
endif
|
321
|
-
cd $(@D) && $(
|
322
|
-
cd $(@D) && $(ln_s) .libs/libjpeg$(DLEXT) .libs/jpegtran .
|
323
|
-
$(call chrpath_origin,$(JPEGTRAN_TARGET))
|
332
|
+
cd $(@D) && $(ln_s) .libs/libjpeg$(DLEXT) .
|
324
333
|
|
325
334
|
## libmozjpeg
|
326
|
-
$(LIBMOZJPEG_TARGET)
|
335
|
+
$(LIBMOZJPEG_TARGET) :
|
327
336
|
cd $(@D) && autoreconf -fiv
|
328
337
|
cd $(@D) && ./configure --host $(HOST)
|
329
338
|
cd $(@D)/simd && $(MAKE)
|
@@ -332,7 +341,7 @@ $(LIBMOZJPEG_TARGET) :; $(clean_untar)
|
|
332
341
|
|
333
342
|
## libpng
|
334
343
|
$(eval $(call depend,LIBPNG,LIBZ))
|
335
|
-
$(LIBPNG_TARGET)
|
344
|
+
$(LIBPNG_TARGET) :
|
336
345
|
cd $(@D) && ./configure CC="$(CC) $(GCC_FLAGS)"
|
337
346
|
cd $(@D) && $(pkgconfig_pwd) -- *.pc
|
338
347
|
cd $(@D) && perl -pi -e 's/(?<=lpng)\d+//g' -- *.pc # %MAJOR%%MINOR% suffix
|
@@ -351,14 +360,14 @@ $(LIBZ_TARGET) : export LDSHARED = $(CC) -dynamiclib -install_name @loader_path/
|
|
351
360
|
else
|
352
361
|
$(LIBZ_TARGET) : export LDSHARED = $(CC) -shared -Wl,-soname,$(@F),--version-script,zlib.map
|
353
362
|
endif
|
354
|
-
$(LIBZ_TARGET)
|
363
|
+
$(LIBZ_TARGET) :
|
355
364
|
cd $(@D) && ./configure
|
356
365
|
cd $(@D) && $(pkgconfig_pwd) -- *.pc
|
357
366
|
cd $(@D) && $(MAKE) placebo
|
358
367
|
|
359
368
|
## optipng
|
360
369
|
$(eval $(call depend,OPTIPNG,LIBPNG LIBZ))
|
361
|
-
$(OPTIPNG_TARGET)
|
370
|
+
$(OPTIPNG_TARGET) :
|
362
371
|
cd $(@D) && ./configure -with-system-libs
|
363
372
|
cd $(@D) && $(MAKE) all LDFLAGS="$(XORIGIN) $(GCC_FLAGS)"
|
364
373
|
cd $(@D) && $(ln_s) src/optipng/optipng .
|
@@ -366,7 +375,7 @@ $(OPTIPNG_TARGET) :; $(clean_untar)
|
|
366
375
|
|
367
376
|
## pngcrush
|
368
377
|
$(eval $(call depend,PNGCRUSH,LIBPNG LIBZ))
|
369
|
-
$(PNGCRUSH_TARGET)
|
378
|
+
$(PNGCRUSH_TARGET) :
|
370
379
|
cd $(@D) && rm -f png.h pngconf.h
|
371
380
|
cd $(@D) && $(MAKE) -f Makefile pngcrush \
|
372
381
|
LIBS="-lpng -lz -lm" \
|
@@ -376,7 +385,7 @@ $(PNGCRUSH_TARGET) :; $(clean_untar)
|
|
376
385
|
|
377
386
|
## pngquant
|
378
387
|
$(eval $(call depend,PNGQUANT,LIBPNG LIBZ))
|
379
|
-
$(PNGQUANT_TARGET)
|
388
|
+
$(PNGQUANT_TARGET) :
|
380
389
|
cd $(@D) && ./configure --without-cocoa --extra-ldflags="$(XORIGIN)"
|
381
390
|
cd $(@D) && $(MAKE) pngquant
|
382
391
|
$(call chrpath_origin,$@)
|
data/README.markdown
CHANGED
@@ -71,12 +71,12 @@ script/run darwin 64 # Build only platforms matching darwin or 64
|
|
71
71
|
|
72
72
|
make # Build all tools and copy them to vendor/OS-ARCH for current OS and ARCH, then test
|
73
73
|
make all # same
|
74
|
-
make run # same
|
75
74
|
|
76
75
|
make livecheck # Check versions
|
77
76
|
make update-versions # Update versions in Makefile
|
78
77
|
|
79
78
|
make download # Download archives
|
79
|
+
make download-tidy-up # Remove old archives
|
80
80
|
make build # Build all without copying to output directory
|
81
81
|
|
82
82
|
make test # Test bins for current os/arch
|
data/image_optim_pack.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'image_optim_pack'
|
5
|
-
s.version = '0.3.
|
5
|
+
s.version = '0.3.1'
|
6
6
|
s.summary = %q{Precompiled binaries for image_optim: advpng, gifsicle, jhead, jpeg-recompress, jpegoptim, jpegtran, optipng, pngcrush, pngquant}
|
7
7
|
s.homepage = "http://github.com/toy/#{s.name}"
|
8
8
|
s.authors = ['Ivan Kuchin']
|
data/script/update_versions
CHANGED
@@ -2,18 +2,21 @@
|
|
2
2
|
|
3
3
|
# Feed Makefile to this script to set all variables XXX_VER to latest versions
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
tty = $stdout.tty?
|
8
|
-
|
9
|
-
ARGF.each do |line|
|
5
|
+
ARGF.map do |line|
|
10
6
|
if (name = line[/^([A-Z]+)_VER *:= *.*/, 1])
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
7
|
+
Thread.new do
|
8
|
+
version = `script/livecheck --bare #{name}`.strip
|
9
|
+
abort unless $?.success?
|
10
|
+
"#{name}_VER := #{version}\n"
|
11
|
+
end
|
12
|
+
else
|
13
|
+
line
|
14
|
+
end
|
15
|
+
end.each do |out|
|
16
|
+
if out.respond_to?(:value)
|
17
|
+
$stderr << out.value unless $stdout.tty?
|
18
|
+
$stdout << out.value
|
16
19
|
else
|
17
|
-
$stdout <<
|
20
|
+
$stdout << out
|
18
21
|
end
|
19
22
|
end
|
data/spec/image_optim_spec.rb
CHANGED
Binary file
|
data/vendor/darwin-i386/optipng
CHANGED
Binary file
|
data/vendor/darwin-i386/pngcrush
CHANGED
Binary file
|
data/vendor/darwin-i386/pngquant
CHANGED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/vendor/freebsd-i386/optipng
CHANGED
Binary file
|
Binary file
|
Binary file
|
data/vendor/linux-i686/libpng.so
CHANGED
Binary file
|
data/vendor/linux-i686/optipng
CHANGED
Binary file
|
data/vendor/linux-i686/pngcrush
CHANGED
Binary file
|
data/vendor/linux-i686/pngquant
CHANGED
Binary file
|
Binary file
|
data/vendor/linux-x86_64/optipng
CHANGED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/vendor/openbsd-i386/optipng
CHANGED
Binary file
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: image_optim_pack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Kuchin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: image_optim
|