image_optim_pack 0.7.0.20211002 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/.dockerignore +10 -0
  3. data/CHANGELOG.markdown +5 -0
  4. data/Dockerfile +167 -0
  5. data/Makefile +50 -7
  6. data/README.markdown +21 -0
  7. data/Vagrantfile +26 -14
  8. data/acknowledgements/liblcms2.txt +21 -0
  9. data/acknowledgements/oxipng.txt +20 -0
  10. data/checksums.mk +2 -0
  11. data/image_optim_pack.gemspec +1 -1
  12. data/script/extract +19 -0
  13. data/script/livecheck +6 -0
  14. data/script/run +2 -2
  15. data/vendor/darwin-x86_64/advpng +0 -0
  16. data/vendor/darwin-x86_64/jhead +0 -0
  17. data/vendor/darwin-x86_64/jpeg-recompress +0 -0
  18. data/vendor/darwin-x86_64/jpegoptim +0 -0
  19. data/vendor/darwin-x86_64/jpegtran +0 -0
  20. data/vendor/darwin-x86_64/libjpeg.dylib +0 -0
  21. data/vendor/darwin-x86_64/liblcms2.dylib +0 -0
  22. data/vendor/darwin-x86_64/libpng.dylib +0 -0
  23. data/vendor/darwin-x86_64/libz.dylib +0 -0
  24. data/vendor/darwin-x86_64/optipng +0 -0
  25. data/vendor/darwin-x86_64/oxipng +0 -0
  26. data/vendor/darwin-x86_64/pngcrush +0 -0
  27. data/vendor/darwin-x86_64/pngquant +0 -0
  28. data/vendor/linux-i686/advpng +0 -0
  29. data/vendor/linux-i686/gifsicle +0 -0
  30. data/vendor/linux-i686/jhead +0 -0
  31. data/vendor/linux-i686/jpeg-recompress +0 -0
  32. data/vendor/linux-i686/jpegoptim +0 -0
  33. data/vendor/linux-i686/jpegtran +0 -0
  34. data/vendor/linux-i686/libjpeg.so +0 -0
  35. data/vendor/linux-i686/liblcms2.so +0 -0
  36. data/vendor/linux-i686/libpng.so +0 -0
  37. data/vendor/linux-i686/libz.so +0 -0
  38. data/vendor/linux-i686/optipng +0 -0
  39. data/vendor/linux-i686/oxipng +0 -0
  40. data/vendor/linux-i686/pngcrush +0 -0
  41. data/vendor/linux-i686/pngquant +0 -0
  42. data/vendor/linux-x86_64/advpng +0 -0
  43. data/vendor/linux-x86_64/gifsicle +0 -0
  44. data/vendor/linux-x86_64/jhead +0 -0
  45. data/vendor/linux-x86_64/jpeg-recompress +0 -0
  46. data/vendor/linux-x86_64/jpegoptim +0 -0
  47. data/vendor/linux-x86_64/jpegtran +0 -0
  48. data/vendor/linux-x86_64/liblcms2.so +0 -0
  49. data/vendor/linux-x86_64/optipng +0 -0
  50. data/vendor/linux-x86_64/oxipng +0 -0
  51. data/vendor/linux-x86_64/pngcrush +0 -0
  52. data/vendor/linux-x86_64/pngquant +0 -0
  53. metadata +15 -6
  54. data/boxes/definitions/centos-i386/definition.rb +0 -32
  55. data/boxes/definitions/centos-i386/ks.cfg +0 -37
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4d4774965d093a7979bd2e40160e816ee89c6be8ea41d07fd6b90d8032bcb38
4
- data.tar.gz: c7eaaaeba22c6775529fc54476b683d02da02e9df708e3001cf5f68a7841d874
3
+ metadata.gz: '039490ae3cb500baf634f59621bca465fac8527fb17f7f9e01ebfae7209b5f63'
4
+ data.tar.gz: d8adb4038981fb27acd1455144c9952251b761c237313c2d5b4939993f192692
5
5
  SHA512:
6
- metadata.gz: 2fcf599f3e6759a217e59db2681c2b5d5adb98d50b1aad295bd35dd97ecf354be61f9e7db016094bc3be20c0afda7e71e1463bd0b824b27b5369fff40721744f
7
- data.tar.gz: d0b9f3a13cb52fcde2b1d48c53dd42eb1e647edfec9f627b4f1182fcd7a66ae0ea984a6feb0681829dd613e9174192458cb5bf4c48961b14a9525fea7ba76ea3
6
+ metadata.gz: a913d8e6ee3bf82c9204c9add4af56ec7d1471623bd5002fed2369167798c64791b9efc64ab46278a5aae28f9cd09a8fb401b561ef3410f541c9301e01ba8c79
7
+ data.tar.gz: 32029b2143cd58348f707523381e175b8f628d8df323297e5add1ce6354a11a9f015abfc67b80a4d39c418c3263f87a247c9f71deaf6bfa1fc808da49a13bd5d
data/.dockerignore ADDED
@@ -0,0 +1,10 @@
1
+ /boxes/
2
+ /.git/
3
+
4
+ /build/
5
+ /.vagrant/
6
+
7
+ Gemfile.lock
8
+ /*.gem
9
+ /.bundle
10
+ /tmp/
data/CHANGELOG.markdown CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## unreleased
4
4
 
5
+ ## v0.8.0 (2021-10-20)
6
+
7
+ * Add [lcms2](https://littlecms.com) colour management library for pngquant [@toy](https://github.com/toy)
8
+ * Add [oxipng](https://github.com/shssoichiro/oxipng) (v5.0.0), switch to ubuntu/xenial32 for 32 bit [@toy](https://github.com/toy)
9
+
5
10
  ## v0.7.0.20211002 (2021-10-02)
6
11
 
7
12
  * pngquant 2.16.0 [@toy](https://github.com/toy)
data/Dockerfile ADDED
@@ -0,0 +1,167 @@
1
+ FROM alpine:3.12 as base
2
+ ENV LD_LIBRARY_PATH=/usr/local/lib
3
+ WORKDIR /tmp
4
+
5
+ FROM base as build
6
+ RUN apk add --no-cache build-base cmake nasm bash findutils
7
+ COPY script/extract ./
8
+ ENV CPATH=/usr/local/include
9
+
10
+ FROM build as libz
11
+ ARG LIBZ_VER
12
+ ARG LIBZ_SHA256
13
+ COPY download/libz-$LIBZ_VER.tar.gz download/
14
+ RUN ./extract libz && \
15
+ cd build/libz && \
16
+ ./configure && \
17
+ make install
18
+
19
+ FROM libz as libpng
20
+ ARG LIBPNG_VER
21
+ ARG LIBPNG_SHA256
22
+ COPY download/libpng-$LIBPNG_VER.tar.gz download/
23
+ RUN ./extract libpng && \
24
+ cd build/libpng && \
25
+ ./configure --with-zlib-prefix=/usr/local && \
26
+ make install
27
+
28
+ FROM libpng as liblcms
29
+ ARG LIBLCMS_VER
30
+ ARG LIBLCMS_SHA256
31
+ COPY download/liblcms-$LIBLCMS_VER.tar.gz download/
32
+ RUN ./extract liblcms && \
33
+ cd build/liblcms && \
34
+ ./configure && \
35
+ make install
36
+
37
+ FROM build as libjpeg
38
+ ARG LIBJPEG_VER
39
+ ARG LIBJPEG_SHA256
40
+ COPY download/libjpeg-$LIBJPEG_VER.tar.gz download/
41
+ RUN ./extract libjpeg && \
42
+ cd build/libjpeg && \
43
+ ./configure && \
44
+ make install
45
+
46
+ FROM build as libmozjpeg
47
+ ARG LIBMOZJPEG_VER
48
+ ARG LIBMOZJPEG_SHA256
49
+ COPY download/libmozjpeg-$LIBMOZJPEG_VER.tar.gz download/
50
+ RUN ./extract libmozjpeg && \
51
+ cd build/libmozjpeg && \
52
+ cmake -DPNG_SUPPORTED=0 . && \
53
+ make install
54
+
55
+ FROM libpng as advancecomp
56
+ ARG ADVANCECOMP_VER
57
+ ARG ADVANCECOMP_SHA256
58
+ COPY download/advancecomp-$ADVANCECOMP_VER.tar.gz download/
59
+ RUN ./extract advancecomp && \
60
+ cd build/advancecomp && \
61
+ ./configure && \
62
+ make install
63
+
64
+ FROM build as gifsicle
65
+ ARG GIFSICLE_VER
66
+ ARG GIFSICLE_SHA256
67
+ COPY download/gifsicle-$GIFSICLE_VER.tar.gz download/
68
+ RUN ./extract gifsicle && \
69
+ cd build/gifsicle && \
70
+ ./configure && \
71
+ make install
72
+
73
+ FROM build as jhead
74
+ ARG JHEAD_VER
75
+ ARG JHEAD_SHA256
76
+ COPY download/jhead-$JHEAD_VER.tar.gz download/
77
+ RUN ./extract jhead && \
78
+ cd build/jhead && \
79
+ make && \
80
+ install -c jhead /usr/local/bin
81
+
82
+ FROM libmozjpeg as jpegarchive
83
+ ARG JPEGARCHIVE_VER
84
+ ARG JPEGARCHIVE_SHA256
85
+ COPY download/jpegarchive-$JPEGARCHIVE_VER.tar.gz download/
86
+ RUN ./extract jpegarchive && \
87
+ cd build/jpegarchive && \
88
+ make install
89
+
90
+ FROM libjpeg as jpegoptim
91
+ ARG JPEGOPTIM_VER
92
+ ARG JPEGOPTIM_SHA256
93
+ COPY download/jpegoptim-$JPEGOPTIM_VER.tar.gz download/
94
+ RUN ./extract jpegoptim && \
95
+ cd build/jpegoptim && \
96
+ ./configure && \
97
+ make install
98
+
99
+ FROM libpng as optipng
100
+ ARG OPTIPNG_VER
101
+ ARG OPTIPNG_SHA256
102
+ COPY download/optipng-$OPTIPNG_VER.tar.gz download/
103
+ RUN ./extract optipng && \
104
+ cd build/optipng && \
105
+ ./configure && \
106
+ make install
107
+
108
+ FROM rust:1.55-alpine3.13 as oxipng
109
+ RUN apk add --no-cache build-base
110
+ COPY script/extract ./
111
+ ARG OXIPNG_VER
112
+ ARG OXIPNG_SHA256
113
+ COPY download/oxipng-$OXIPNG_VER.tar.gz download/
114
+ RUN ./extract oxipng && \
115
+ cd build/oxipng && \
116
+ cargo build --release && \
117
+ install -c target/release/oxipng /usr/local/bin
118
+
119
+ FROM libpng as pngcrush
120
+ ARG PNGCRUSH_VER
121
+ ARG PNGCRUSH_SHA256
122
+ COPY download/pngcrush-$PNGCRUSH_VER.tar.gz download/
123
+ RUN ./extract pngcrush && \
124
+ cd build/pngcrush && \
125
+ make && \
126
+ install -c pngcrush /usr/local/bin
127
+
128
+ FROM liblcms as pngquant
129
+ ARG PNGQUANT_VER
130
+ ARG PNGQUANT_SHA256
131
+ COPY download/pngquant-$PNGQUANT_VER.tar.gz download/
132
+ RUN ./extract pngquant && \
133
+ cd build/pngquant && \
134
+ make install
135
+
136
+ # FROM build as [name]
137
+ # ARG [NAME]_VER
138
+ # ARG [NAME]_SHA256
139
+ # COPY download/[name]-$[NAME]_VER.tar.gz download/
140
+ # RUN ./extract [name] && \
141
+ # cd build/[name] && \
142
+ # ./configure && \
143
+ # make install
144
+
145
+ FROM base as image_optim
146
+ RUN apk add --no-cache libstdc++ ruby npm perl dumb-init
147
+
148
+ COPY --from=advancecomp /usr/local/bin/advpng /usr/local/bin/
149
+ COPY --from=gifsicle /usr/local/bin/gifsicle /usr/local/bin/
150
+ COPY --from=jhead /usr/local/bin/jhead /usr/local/bin/
151
+ COPY --from=jpegarchive /usr/local/bin/jpeg-recompress /usr/local/bin/
152
+ COPY --from=jpegoptim /usr/local/bin/jpegoptim /usr/local/bin/
153
+ COPY --from=libjpeg /usr/local/bin/jpegtran /usr/local/bin/
154
+ COPY --from=optipng /usr/local/bin/optipng /usr/local/bin/
155
+ COPY --from=oxipng /usr/local/bin/oxipng /usr/local/bin/
156
+ COPY --from=pngcrush /usr/local/bin/pngcrush /usr/local/bin/
157
+ COPY --from=pngquant /usr/local/bin/pngquant /usr/local/bin/
158
+
159
+ COPY --from=libjpeg /usr/local/lib/libjpeg.so.9 /usr/local/lib/
160
+ COPY --from=libpng /usr/local/lib/libpng16.so.16 /usr/local/lib/
161
+ COPY --from=libz /usr/local/lib/libz.so.1 /usr/local/lib/
162
+ COPY --from=liblcms /usr/local/lib/liblcms2.so.2 /usr/local/lib/
163
+
164
+ RUN npm -g install svgo
165
+ RUN gem install --no-document image_optim
166
+ ENTRYPOINT ["dumb-init", "image_optim", "--skip-missing-workers"]
167
+ CMD ["--help"]
data/Makefile CHANGED
@@ -8,10 +8,12 @@ JHEAD_VER := 3.04
8
8
  JPEGARCHIVE_VER := 2.2.0
9
9
  JPEGOPTIM_VER := 1.4.6
10
10
  LIBJPEG_VER := 9d
11
+ LIBLCMS_VER := 2.12
11
12
  LIBMOZJPEG_VER := 4.0.3
12
13
  LIBPNG_VER := 1.6.37
13
14
  LIBZ_VER := 1.2.11
14
15
  OPTIPNG_VER := 0.7.7
16
+ OXIPNG_VER := 5.0.0
15
17
  PNGCRUSH_VER := 1.8.13
16
18
  PNGQUANT_VER := 2.16.0
17
19
 
@@ -37,7 +39,6 @@ BUILD_ROOT_DIR := $(CURDIR)/build
37
39
  BUILD_DIR := $(BUILD_ROOT_DIR)/$(OS)-$(ARCH)
38
40
  OUTPUT_ROOT_DIR := $(CURDIR)/vendor
39
41
  OUTPUT_DIR := $(OUTPUT_ROOT_DIR)/$(OS)-$(ARCH)
40
- $(shell mkdir -p $(DL_DIR) $(BUILD_DIR) $(OUTPUT_DIR))
41
42
 
42
43
  ANSI_RED=\033[31m
43
44
  ANSI_GREEN=\033[32m
@@ -48,7 +49,6 @@ ANSI_RESET=\033[0m
48
49
 
49
50
  downcase = $(shell echo $1 | tr A-Z a-z)
50
51
 
51
- ln_s := ln -sf
52
52
  tar := $(shell if command -v bsdtar >/dev/null 2>&1; then echo bsdtar; else echo tar; fi)
53
53
  sha256sum := $(shell if command -v sha256sum >/dev/null 2>&1; then echo sha256sum; elif command -v shasum >/dev/null 2>&1; then echo shasum -a 256; else echo sha256; fi)
54
54
 
@@ -63,8 +63,9 @@ $1_DIR := $(BUILD_DIR)/$(call downcase,$1)
63
63
  $1_TGZ := $(DL_DIR)/$(call downcase,$1)-$($1_VER).tar.gz
64
64
  $1_EXTRACTED := $$($1_DIR)/__$$(notdir $$($1_TGZ))__
65
65
  $$($1_EXTRACTED) : $$($1_TGZ)
66
+ mkdir -p $(BUILD_DIR)
66
67
  rm -rf $$(@D)
67
- echo "$$($1_SHA256) $$($1_TGZ)" | $(sha256sum) -c
68
+ echo "$$($1_SHA256) $$<" | $(sha256sum) -c
68
69
  mkdir $$(@D)
69
70
  $(tar) -C $$(@D) --strip-components=1 -xzf $$<
70
71
  touch $$(@D)/__$$(notdir $$<)__
@@ -76,6 +77,7 @@ define archive-dl
76
77
  $(call archive,$1)
77
78
  # download archive from url
78
79
  $$($1_TGZ) :
80
+ mkdir -p $(DL_DIR)
79
81
  while ! mkdir $$@.lock 2> /dev/null; do sleep 1; done
80
82
  wget -q -O $$@.tmp $(subst [VER],$($1_VER),$(strip $2))
81
83
  mv $$@.tmp $$@
@@ -88,10 +90,12 @@ $(eval $(call archive-dl,JHEAD, https://www.sentex.ca/~mwandel/jhead/jhead
88
90
  $(eval $(call archive-dl,JPEGARCHIVE, https://github.com/danielgtaylor/jpeg-archive/archive/v[VER].tar.gz))
89
91
  $(eval $(call archive-dl,JPEGOPTIM, https://www.kokkonen.net/tjko/src/jpegoptim-[VER].tar.gz))
90
92
  $(eval $(call archive-dl,LIBJPEG, https://www.ijg.org/files/jpegsrc.v[VER].tar.gz))
93
+ $(eval $(call archive-dl,LIBLCMS, https://prdownloads.sourceforge.net/lcms/lcms2-[VER].tar.gz?download))
91
94
  $(eval $(call archive-dl,LIBMOZJPEG, https://github.com/mozilla/mozjpeg/archive/v[VER].tar.gz))
92
95
  $(eval $(call archive-dl,LIBPNG, https://prdownloads.sourceforge.net/libpng/libpng-[VER].tar.gz?download))
93
96
  $(eval $(call archive-dl,LIBZ, https://prdownloads.sourceforge.net/libpng/zlib-[VER].tar.gz?download))
94
97
  $(eval $(call archive-dl,OPTIPNG, https://prdownloads.sourceforge.net/optipng/optipng-[VER].tar.gz?download))
98
+ $(eval $(call archive-dl,OXIPNG, https://github.com/shssoichiro/oxipng/archive/refs/tags/v[VER].tar.gz))
95
99
  $(eval $(call archive-dl,PNGCRUSH, https://prdownloads.sourceforge.net/pmt/pngcrush-[VER]-nolib.tar.gz?download))
96
100
  $(eval $(call archive-dl,PNGQUANT, https://pngquant.org/pngquant-[VER]-src.tar.gz))
97
101
 
@@ -141,6 +145,7 @@ PRODUCTS += $1
141
145
  $1_DESTINATION := $$(OUTPUT_DIR)/$$($1_BASENAME)
142
146
  # copy product to output dir
143
147
  $$($1_DESTINATION) : $$($1_TARGET)
148
+ mkdir -p $(OUTPUT_DIR)
144
149
  temppath=`mktemp "$(BUILD_DIR)"/tmp.XXXXXXXXXX` && \
145
150
  strip $$< -Sx -o "$$$$temppath" && \
146
151
  chmod 755 "$$$$temppath" && \
@@ -156,10 +161,12 @@ $(eval $(call target,JPEG-RECOMPRESS,JPEGARCHIVE))
156
161
  $(eval $(call target,JPEGOPTIM))
157
162
  $(eval $(call target,JPEGTRAN,LIBJPEG,.libs/jpegtran))
158
163
  $(eval $(call target,LIBJPEG,,libjpeg$(DLEXT)))
164
+ $(eval $(call target,LIBLCMS,,liblcms2$(DLEXT)))
159
165
  $(eval $(call target-build,LIBMOZJPEG,,libjpeg.a))
160
166
  $(eval $(call target,LIBPNG,,libpng$(DLEXT)))
161
167
  $(eval $(call target,LIBZ,,libz$(DLEXT)))
162
168
  $(eval $(call target,OPTIPNG,,src/optipng/optipng))
169
+ $(eval $(call target,OXIPNG,,target/release/oxipng))
163
170
  $(eval $(call target,PNGCRUSH))
164
171
  $(eval $(call target,PNGQUANT))
165
172
 
@@ -235,9 +242,11 @@ test :
235
242
  $(call check_bin,jpegoptim,--version,$(JPEGOPTIM_VER))
236
243
  $(call check_bin,jpegtran,-v - 2>&1,$(LIBJPEG_VER))
237
244
  $(call check_lib,libjpeg$(DLEXT))
245
+ $(call check_lib,liblcms2$(DLEXT))
238
246
  $(call check_lib,libpng$(DLEXT))
239
247
  $(call check_lib,libz$(DLEXT))
240
248
  $(call check_bin,optipng,--version,$(OPTIPNG_VER))
249
+ $(call check_bin,oxipng,--version,$(OXIPNG_VER))
241
250
  $(call check_bin,pngcrush,-version 2>&1,$(PNGCRUSH_VER))
242
251
  $(call check_bin,pngquant,--help,$(PNGQUANT_VER))
243
252
  .PHONY : test
@@ -250,6 +259,24 @@ update-versions :
250
259
  make checksum-update
251
260
  .PHONY : update-versions
252
261
 
262
+ # ====== DOCKER ======
263
+
264
+ DOCKER_IMAGE := ghcr.io/toy/image_optim
265
+ DOCKER_TAG := $(shell date +%Y%m%d)
266
+
267
+ docker-build : download
268
+ @docker build \
269
+ $(foreach archive,$(ARCHIVES),--build-arg $(archive)_VER=$($(archive)_VER) --build-arg $(archive)_SHA256=$($(archive)_SHA256)) \
270
+ -t $(DOCKER_IMAGE):$(DOCKER_TAG) \
271
+ -t $(DOCKER_IMAGE):latest \
272
+ .
273
+ .PHONY : docker-build
274
+
275
+ docker-push : docker-build
276
+ @docker push $(DOCKER_IMAGE):$(DOCKER_TAG)
277
+ @docker push $(DOCKER_IMAGE):latest
278
+ .PHONY : docker-push
279
+
253
280
  # ====== CLEAN ======
254
281
 
255
282
  clean :
@@ -384,7 +411,19 @@ ifdef IS_DARWIN
384
411
  else
385
412
  cd $(DIR) && $(MAKE) libjpeg.la
386
413
  endif
387
- cd $(@D) && $(ln_s) .libs/libjpeg$(DLEXT) .
414
+ cd $(DIR) && ln -sf .libs/libjpeg$(DLEXT) .
415
+
416
+ ## liblcms
417
+ $(LIBLCMS_TARGET) :
418
+ cd $(DIR) && ./configure
419
+ cd $(DIR) && $(libtool_target_soname)
420
+ ifdef IS_DARWIN
421
+ cd $(DIR)/src && make liblcms2.la LDFLAGS="-Wl,-install_name,@loader_path/$(@F)"
422
+ else
423
+ cd $(DIR)/src && make liblcms2.la LDFLAGS="$(XORIGIN)"
424
+ endif
425
+ cd $(DIR) && ln -sf include/lcms2.h .
426
+ cd $(DIR) && ln -sf src/.libs/liblcms2$(DLEXT) .
388
427
 
389
428
  ## libmozjpeg
390
429
  $(LIBMOZJPEG_TARGET) :
@@ -403,7 +442,7 @@ ifdef IS_DARWIN
403
442
  else
404
443
  cd $(DIR) && $(MAKE) libpng16.la LDFLAGS="$(XORIGIN)"
405
444
  endif
406
- cd $(DIR) && $(ln_s) .libs/libpng16$(DLEXT) libpng$(DLEXT)
445
+ cd $(DIR) && ln -sf .libs/libpng16$(DLEXT) libpng$(DLEXT)
407
446
  $(call chrpath_origin,$@)
408
447
 
409
448
  ## libz
@@ -424,6 +463,10 @@ $(OPTIPNG_TARGET) :
424
463
  cd $(DIR) && $(MAKE) all LDFLAGS="$(XORIGIN) $(LDFLAGS)"
425
464
  $(call chrpath_origin,$@)
426
465
 
466
+ ## oxipng
467
+ $(OXIPNG_TARGET) :
468
+ cd $(DIR) && cargo build --release
469
+
427
470
  ## pngcrush
428
471
  $(eval $(call depend,PNGCRUSH,LIBPNG LIBZ))
429
472
  $(PNGCRUSH_TARGET) :
@@ -438,8 +481,8 @@ $(PNGCRUSH_TARGET) :
438
481
  $(call chrpath_origin,$@)
439
482
 
440
483
  ## pngquant
441
- $(eval $(call depend,PNGQUANT,LIBPNG LIBZ))
484
+ $(eval $(call depend,PNGQUANT,LIBLCMS LIBPNG LIBZ))
442
485
  $(PNGQUANT_TARGET) :
443
- cd $(DIR) && ./configure --without-cocoa --without-lcms2 --extra-ldflags="$(XORIGIN) $(STATIC_LIBGCC)"
486
+ cd $(DIR) && ./configure --without-cocoa --extra-ldflags="$(XORIGIN) $(STATIC_LIBGCC)"
444
487
  cd $(DIR) && $(MAKE) pngquant
445
488
  $(call chrpath_origin,$@)
data/README.markdown CHANGED
@@ -28,12 +28,14 @@ A test application with latest `image_optim` and `image_optim_pack` is available
28
28
  * [libjpeg-turbo](https://www.libjpeg-turbo.org/) by libjpeg-turbo Project ([license](acknowledgements/libjpeg-turbo.txt))
29
29
  * based on libjpeg, see above
30
30
  * includes [x86 SIMD extension for IJG JPEG library](https://cetus.sakura.ne.jp/softlab/jpeg-x86simd/jpegsimd.html) by Miyasaka Masaru ([license](acknowledgements/libjpeg-x86-simd.txt))
31
+ * [liblcms2](https://littlecms.com) by Marti Maria ([license](acknowledgements/liblcms2.txt))
31
32
  * [libpng](http://libpng.org/pub/png/) by Guy Eric Schalnat, Andreas Dilger, Glenn Randers-Pehrson and others ([license](acknowledgements/libpng.txt))
32
33
  * [mozjpeg](https://github.com/mozilla/mozjpeg) by Mozilla Research ([license](acknowledgements/mozjpeg.txt))
33
34
  * base on libjpeg and libjpeg-turbo, see above
34
35
  * [optipng](http://optipng.sourceforge.net/) by Cosmin Truta ([license](acknowledgements/optipng.txt), [authors](acknowledgements/optipng-authors.txt))
35
36
  * contains code based in part on the work of Miyasaka Masaru for BMP support ([license](acknowledgements/bmp2png.txt))
36
37
  * and David Koblas for GIF support ([license](acknowledgements/gifread.txt))
38
+ * [oxipng](https://github.com/shssoichiro/oxipng) by Joshua Holmer ([license](acknowledgements/oxipng.txt))
37
39
  * [pngcrush](https://pmt.sourceforge.io/pngcrush/) by Glenn Randers-Pehrson, portions by Greg Roelofs ([license](acknowledgements/pngcrush.txt))
38
40
  * contains [cexcept](http://www.nicemice.net/cexcept/) interface by Adam M. Costello and Cosmin Truta ([license](acknowledgements/cexcept.txt))
39
41
  * [pngquant](https://pngquant.org/) by Kornel Lesiński based on code by Greg Roelofs and Jef Poskanzer after an idea by Stefan Schneider ([license](acknowledgements/pngquant.txt))
@@ -90,6 +92,25 @@ make clean-all # Remove build root and output root directories
90
92
  make clobber # `clean-all` and remove download directory
91
93
  ```
92
94
 
95
+ ## Docker
96
+
97
+ This project includes a `Dockerfile` in the root, which builds a minimal image with most binaries included.
98
+
99
+ #### Running
100
+
101
+ ```bash
102
+ docker run --rm ghcr.io/toy/image_optim --version # image_optim version
103
+ docker run --rm ghcr.io/toy/image_optim --info # image_optim info including bin versions
104
+ docker run --rm -v "$PWD":/here -w /here ghcr.io/toy/image_optim image-in-this-folder.jpg
105
+ ```
106
+
107
+ #### Building
108
+
109
+ ```bash
110
+ make docker-build # will be tagged with latest and current date in format %Y%m%d
111
+ make docker-push # will push tags created by docker-build
112
+ ```
113
+
93
114
  ## Copyright
94
115
 
95
116
  Copyright (c) 2014-2021 Ivan Kuchin. See [LICENSE.txt](LICENSE.txt) for details.
data/Vagrantfile CHANGED
@@ -9,6 +9,7 @@ Vagrant.configure('2') do |config|
9
9
  config.vm.provider 'virtualbox' do |vb|
10
10
  vb.check_guest_additions = false
11
11
  vb.customize ['modifyvm', :id, '--groups', '/image_optim']
12
+ vb.customize ['modifyvm', :id, '--uartmode1', 'disconnected'] # override for ubuntu/xenial32
12
13
  end
13
14
 
14
15
  # handle manually using rsync
@@ -16,30 +17,41 @@ Vagrant.configure('2') do |config|
16
17
 
17
18
  {
18
19
  'linux-x86_64' => 'boxes/centos-amd64.box',
19
- 'linux-i686' => 'boxes/centos-i386.box',
20
+ 'linux-i686' => 'ubuntu/xenial32',
20
21
  }.each do |name, location|
21
22
  config.vm.define name do |machine|
22
23
  machine.vm.hostname = name.gsub('_', '-')
23
24
  machine.vm.box = location
24
25
 
25
- machine.vm.provision :shell, inline: case name
26
- when /^linux/
27
- <<-SH
26
+ machine.vm.provision :shell, inline: <<-SH
27
+ if command -v apt-get; then
28
28
  set -ex
29
- if command -v apt-get; then
30
- apt-get update
31
- apt-get -y install rsync ntpdate make wget gcc g++ chrpath perl pkg-config autoconf automake libtool nasm cmake
32
- else
33
- yum -y install rsync ntpdate make wget gcc gcc-c++ chrpath perl pkg-config autoconf automake libtool nasm cmake
34
- fi
35
- SH
36
- end
37
29
 
38
- machine.vm.provision :shell, inline: <<-SH
39
- set -ex
30
+ apt-get update
31
+ apt-get -y install rsync ntpdate make wget gcc g++ chrpath perl pkg-config autoconf automake libtool nasm cmake cargo
32
+ else
33
+ set -ex
34
+
35
+ yum -y install epel-release
36
+ yum -y install rsync ntpdate make wget gcc gcc-c++ chrpath perl pkg-config autoconf automake libtool nasm cmake cargo
37
+ fi
38
+
40
39
  mkdir -p /vagrant
41
40
  chown vagrant:vagrant /vagrant
42
41
  SH
42
+
43
+ machine.vm.provision :shell, run: 'always', inline: <<-SH
44
+ if command -v apt-get; then
45
+ set -ex
46
+
47
+ apt-get update
48
+ apt-get -y dist-upgrade
49
+ else
50
+ set -ex
51
+
52
+ yum -y update
53
+ fi
54
+ SH
43
55
  end
44
56
  end
45
57
  end
@@ -0,0 +1,21 @@
1
+ Little CMS
2
+ Copyright (c) 1998-2020 Marti Maria Saguer
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining
5
+ a copy of this software and associated documentation files (the
6
+ "Software"), to deal in the Software without restriction, including
7
+ without limitation the rights to use, copy, modify, merge, publish,
8
+ distribute, sublicense, and/or sell copies of the Software, and to
9
+ permit persons to whom the Software is furnished to do so, subject
10
+ to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+ Copyright (c) 2016 Joshua Holmer
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
5
+ this software and associated documentation files (the "Software"), to deal in
6
+ the Software without restriction, including without limitation the rights to
7
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
8
+ of the Software, and to permit persons to whom the Software is furnished to do
9
+ so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
data/checksums.mk CHANGED
@@ -4,9 +4,11 @@ JHEAD_SHA256 := ef89bbcf4f6c25ed88088cf242a47a6aedfff4f08cc7dc205bf3e2c0f10a03c9
4
4
  JPEGARCHIVE_SHA256 := 3da16a5abbddd925dee0379aa51d9fe0cba33da0b5703be27c13a2dda3d7ed75
5
5
  JPEGOPTIM_SHA256 := 88b1eb64c2a33a2f013f068df8b0331f42c019267401ae3fa28e3277403a5ab7
6
6
  LIBJPEG_SHA256 := 6c434a3be59f8f62425b2e3c077e785c9ce30ee5874ea1c270e843f273ba71ee
7
+ LIBLCMS_SHA256 := 18663985e864100455ac3e507625c438c3710354d85e5cbb7cd4043e11fe10f5
7
8
  LIBMOZJPEG_SHA256 := 4f22731db2afa14531a5bf2633d8af79ca5cb697a550f678bf43f24e5e409ef0
8
9
  LIBPNG_SHA256 := daeb2620d829575513e35fecc83f0d3791a620b9b93d800b763542ece9390fb4
9
10
  LIBZ_SHA256 := c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1
10
11
  OPTIPNG_SHA256 := 4f32f233cef870b3f95d3ad6428bfe4224ef34908f1b42b0badf858216654452
12
+ OXIPNG_SHA256 := 2a3197c9a0afdd91967f9981da7ce684b40eced4191c26c167b3c214a7cfd9ec
11
13
  PNGCRUSH_SHA256 := fed0aaf5c098aa8c7f78c75365cd18d7341417326ecbdba547876b7b4f3df4be
12
14
  PNGQUANT_SHA256 := 06c6fdded675753fbdbeacc2b63507fb30f42fae813e48a1684b240bb5b63522
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'image_optim_pack'
5
- s.version = '0.7.0.20211002'
5
+ s.version = '0.8.0'
6
6
  s.summary = %q{Precompiled binaries for image_optim: advpng, gifsicle, jhead, jpeg-recompress, jpegoptim, jpegtran, optipng, pngcrush, pngquant}
7
7
  s.homepage = "https://github.com/toy/#{s.name}"
8
8
  s.authors = ['Ivan Kuchin']
data/script/extract ADDED
@@ -0,0 +1,19 @@
1
+ #!/bin/sh
2
+
3
+ set -e
4
+
5
+ if [ "$#" -ne 1 ]; then
6
+ echo "Require name of package as argument" >&2
7
+ exit 1
8
+ fi
9
+
10
+ name="$1"
11
+ upcase=$(echo "$name" | tr a-z A-Z)
12
+ version=$(printenv "${upcase}_VER")
13
+ checksum=$(printenv "${upcase}_SHA256")
14
+ archive="download/${name}-${version}.tar.gz"
15
+ build_dir="build/$name"
16
+
17
+ echo "$checksum $archive" | sha256sum -c
18
+ mkdir -p "$build_dir"
19
+ tar -C "$build_dir" --strip-components=1 -xzf "$archive"
data/script/livecheck CHANGED
@@ -187,6 +187,9 @@ jpegarchive:
187
187
  libjpeg:
188
188
  url: https://www.ijg.org/files/
189
189
  regexp: jpegsrc.v(.*?).tar.gz
190
+ liblcms:
191
+ url: https://sourceforge.net/projects/lcms/rss?path=/lcms
192
+ regexp: /lcms/(\d+(?:\.\d+)*)/
190
193
  libmozjpeg:
191
194
  url: https://github.com/mozilla/mozjpeg/releases.atom
192
195
  regexp: <id>tag:github.com,2008:Repository/\d+/\D+?(\d+(?:\.\d+)*)</id>
@@ -199,6 +202,9 @@ libz:
199
202
  optipng:
200
203
  url: https://sourceforge.net/projects/optipng/rss
201
204
  regexp: /OptiPNG/optipng-(\d+(?:\.\d+)*)/
205
+ oxipng:
206
+ url: https://github.com/shssoichiro/oxipng/releases.atom
207
+ regexp: <id>tag:github.com,2008:Repository/\d+/v(\d+(?:\.\d+)*)</id>
202
208
  pngcrush:
203
209
  url: https://sourceforge.net/projects/pmt/rss?path=/pngcrush
204
210
  regexp: /pngcrush/(\d+(?:\.\d+)*)/
data/script/run CHANGED
@@ -38,7 +38,7 @@ for arch in x86_64; do
38
38
 
39
39
  mkdir -p "vendor/$platform"
40
40
 
41
- sudo -u _image_optim bash -c "
41
+ sudo -u _image_optim --set-home bash -c "
42
42
  set -e
43
43
 
44
44
  mkdir -p '$build_dir'
@@ -53,7 +53,7 @@ for arch in x86_64; do
53
53
  rsync -aR --del "$build_dir/./vendor/$platform" .
54
54
  done
55
55
 
56
- for vm in $(perl -pe "s/.*?'(.+?-.+?)'\s+=>\s+'.+?\/.+?'.*|.*/\$1/" Vagrantfile); do
56
+ for vm in $(perl -pe "s/.*?'(.+?-.+?)'\s+=>\s+'.+?\/.+?'.*|.*/\$1/" Vagrantfile | uniq); do
57
57
  passes-filter "$vm" || continue
58
58
  header "$vm"
59
59
 
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
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.7.0.20211002
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Kuchin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-02 00:00:00.000000000 Z
11
+ date: 2021-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: image_optim
@@ -92,10 +92,12 @@ executables: []
92
92
  extensions: []
93
93
  extra_rdoc_files: []
94
94
  files:
95
+ - ".dockerignore"
95
96
  - ".github/workflows/check.yml"
96
97
  - ".gitignore"
97
98
  - ".rubocop.yml"
98
99
  - CHANGELOG.markdown
100
+ - Dockerfile
99
101
  - Gemfile
100
102
  - LICENSE.txt
101
103
  - Makefile
@@ -114,10 +116,12 @@ files:
114
116
  - acknowledgements/libjpeg-turbo.txt
115
117
  - acknowledgements/libjpeg-x86-simd.txt
116
118
  - acknowledgements/libjpeg.txt
119
+ - acknowledgements/liblcms2.txt
117
120
  - acknowledgements/libpng.txt
118
121
  - acknowledgements/mozjpeg.txt
119
122
  - acknowledgements/optipng-authors.txt
120
123
  - acknowledgements/optipng.txt
124
+ - acknowledgements/oxipng.txt
121
125
  - acknowledgements/pngcrush.txt
122
126
  - acknowledgements/pngquant.txt
123
127
  - acknowledgements/smallfry.txt
@@ -130,8 +134,6 @@ files:
130
134
  - boxes/Rakefile
131
135
  - boxes/definitions/centos-amd64/definition.rb
132
136
  - boxes/definitions/centos-amd64/ks.cfg
133
- - boxes/definitions/centos-i386/definition.rb
134
- - boxes/definitions/centos-i386/ks.cfg
135
137
  - boxes/definitions/centos-postinstall.sh
136
138
  - checksums.mk
137
139
  - image_optim_pack-darwin-x86_64.gemspec
@@ -140,6 +142,7 @@ files:
140
142
  - image_optim_pack.gemspec
141
143
  - lib/image_optim/pack.rb
142
144
  - lib/image_optim_pack.rb
145
+ - script/extract
143
146
  - script/livecheck
144
147
  - script/platform_downloads
145
148
  - script/run
@@ -153,9 +156,11 @@ files:
153
156
  - vendor/darwin-x86_64/jpegoptim
154
157
  - vendor/darwin-x86_64/jpegtran
155
158
  - vendor/darwin-x86_64/libjpeg.dylib
159
+ - vendor/darwin-x86_64/liblcms2.dylib
156
160
  - vendor/darwin-x86_64/libpng.dylib
157
161
  - vendor/darwin-x86_64/libz.dylib
158
162
  - vendor/darwin-x86_64/optipng
163
+ - vendor/darwin-x86_64/oxipng
159
164
  - vendor/darwin-x86_64/pngcrush
160
165
  - vendor/darwin-x86_64/pngquant
161
166
  - vendor/linux-i686/advpng
@@ -165,9 +170,11 @@ files:
165
170
  - vendor/linux-i686/jpegoptim
166
171
  - vendor/linux-i686/jpegtran
167
172
  - vendor/linux-i686/libjpeg.so
173
+ - vendor/linux-i686/liblcms2.so
168
174
  - vendor/linux-i686/libpng.so
169
175
  - vendor/linux-i686/libz.so
170
176
  - vendor/linux-i686/optipng
177
+ - vendor/linux-i686/oxipng
171
178
  - vendor/linux-i686/pngcrush
172
179
  - vendor/linux-i686/pngquant
173
180
  - vendor/linux-x86_64/advpng
@@ -177,9 +184,11 @@ files:
177
184
  - vendor/linux-x86_64/jpegoptim
178
185
  - vendor/linux-x86_64/jpegtran
179
186
  - vendor/linux-x86_64/libjpeg.so
187
+ - vendor/linux-x86_64/liblcms2.so
180
188
  - vendor/linux-x86_64/libpng.so
181
189
  - vendor/linux-x86_64/libz.so
182
190
  - vendor/linux-x86_64/optipng
191
+ - vendor/linux-x86_64/oxipng
183
192
  - vendor/linux-x86_64/pngcrush
184
193
  - vendor/linux-x86_64/pngquant
185
194
  homepage: https://github.com/toy/image_optim_pack
@@ -188,7 +197,7 @@ licenses:
188
197
  metadata:
189
198
  bug_tracker_uri: https://github.com/toy/image_optim_pack/issues
190
199
  changelog_uri: https://github.com/toy/image_optim_pack/blob/master/CHANGELOG.markdown
191
- documentation_uri: https://www.rubydoc.info/gems/image_optim_pack/0.7.0.20211002
200
+ documentation_uri: https://www.rubydoc.info/gems/image_optim_pack/0.8.0
192
201
  source_code_uri: https://github.com/toy/image_optim_pack
193
202
  post_install_message:
194
203
  rdoc_options: []
@@ -205,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
205
214
  - !ruby/object:Gem::Version
206
215
  version: '0'
207
216
  requirements: []
208
- rubygems_version: 3.1.6
217
+ rubygems_version: 3.2.29
209
218
  signing_key:
210
219
  specification_version: 4
211
220
  summary: 'Precompiled binaries for image_optim: advpng, gifsicle, jhead, jpeg-recompress,
@@ -1,32 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- Veewee::Session.declare({
4
- :cpu_count => '1',
5
- :memory_size => '512',
6
- :disk_size => '8192',
7
- :disk_format => 'VDI',
8
- :hostiocache => 'off',
9
- :os_type_id => 'RedHat',
10
- :iso_file => 'CentOS-7-i386-Minimal-2009.iso',
11
- :iso_src => 'http://linux.darkpenguin.net/distros/CentOS-AltArch/7.9.2009/isos/i386/CentOS-7-i386-Minimal-2009.iso',
12
- :iso_sha256 => 'bcbde5d345c5013fa618c38380765547be01a354883b3055f32d7067dd7b5bca',
13
- :iso_download_timeout => '1000',
14
- :boot_wait => '10',
15
- :boot_cmd_sequence => [
16
- '<Tab> text ks=http://%IP%:%PORT%/ks.cfg<Enter>',
17
- ],
18
- :kickstart_port => '7122',
19
- :kickstart_timeout => '300',
20
- :kickstart_file => 'ks.cfg',
21
- :ssh_login_timeout => '10000',
22
- :ssh_user => 'veewee',
23
- :ssh_password => 'veewee',
24
- :ssh_key => '',
25
- :ssh_host_port => '7222',
26
- :ssh_guest_port => '22',
27
- :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
28
- :shutdown_cmd => '/sbin/halt -h -p',
29
- :postinstall_files => %w[../centos-postinstall.sh],
30
- :postinstall_timeout => '10000',
31
- :skip_iso_transfer => true,
32
- })
@@ -1,37 +0,0 @@
1
- install
2
- cdrom
3
- lang en_US.UTF-8
4
- keyboard us
5
- network --bootproto=dhcp
6
- rootpw --iscrypted $1$damlkd,f$UC/u5pUts5QiU3ow.CSso/
7
- firewall --enabled --service=ssh
8
- authconfig --enableshadow --passalgo=sha512
9
- selinux --disabled
10
- timezone UTC
11
- bootloader --location=mbr
12
-
13
- text
14
- skipx
15
- zerombr
16
-
17
- clearpart --all --initlabel
18
- autopart
19
-
20
- auth --useshadow --enablemd5
21
- firstboot --disabled
22
- reboot
23
-
24
- %packages --nobase
25
- @core
26
- openssh-clients
27
- %end
28
-
29
- %post
30
- /usr/bin/yum -y install sudo
31
- /usr/sbin/groupadd veewee
32
- /usr/sbin/useradd veewee -g veewee -G wheel
33
- echo "veewee"|passwd --stdin veewee
34
- echo "veewee ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/veewee
35
- chmod 0440 /etc/sudoers.d/veewee
36
- %end
37
-