image_optim_pack 0.12.2.20260327 → 0.13.0
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/.github/workflows/build.yml +44 -24
- data/.github/workflows/check.yml +1 -2
- data/.rubocop.yml +3 -0
- data/CHANGELOG.markdown +6 -0
- data/Dockerfile +20 -20
- data/Dockerfile.debian +26 -26
- data/Makefile +36 -21
- data/image_optim_pack-linux-aarch64-musl.gemspec +3 -0
- data/image_optim_pack-linux-x86_64-gnu.gemspec +3 -0
- data/image_optim_pack-linux-x86_64-musl.gemspec +3 -0
- data/image_optim_pack.gemspec +8 -8
- data/lib/image_optim/pack.rb +22 -5
- data/script/run +36 -9
- data/spec/image_optim/pack_spec.rb +8 -2
- data/vendor/linux-aarch64-gnu/advpng +0 -0
- data/vendor/linux-aarch64-gnu/gifsicle +0 -0
- data/vendor/linux-aarch64-gnu/jhead +0 -0
- data/vendor/linux-aarch64-gnu/jpeg-recompress +0 -0
- data/vendor/linux-aarch64-gnu/jpegoptim +0 -0
- data/vendor/linux-aarch64-gnu/jpegtran +0 -0
- data/vendor/linux-aarch64-gnu/libjpeg.so +0 -0
- data/vendor/linux-aarch64-gnu/liblcms2.so +0 -0
- data/vendor/linux-aarch64-gnu/libpng.so +0 -0
- data/vendor/linux-aarch64-gnu/libz.so +0 -0
- data/vendor/linux-aarch64-gnu/optipng +0 -0
- data/vendor/linux-aarch64-gnu/oxipng +0 -0
- data/vendor/linux-aarch64-gnu/pngcrush +0 -0
- data/vendor/linux-aarch64-gnu/pngout +0 -0
- data/vendor/linux-aarch64-gnu/pngquant +0 -0
- data/vendor/linux-aarch64-musl/advpng +0 -0
- data/vendor/linux-aarch64-musl/gifsicle +0 -0
- data/vendor/linux-aarch64-musl/jhead +0 -0
- data/vendor/linux-aarch64-musl/jpeg-recompress +0 -0
- data/vendor/linux-aarch64-musl/jpegoptim +0 -0
- data/vendor/linux-aarch64-musl/jpegtran +0 -0
- data/vendor/linux-aarch64-musl/libjpeg.so +0 -0
- data/vendor/linux-aarch64-musl/liblcms2.so +0 -0
- data/vendor/linux-aarch64-musl/libpng.so +0 -0
- data/vendor/linux-aarch64-musl/libz.so +0 -0
- data/vendor/linux-aarch64-musl/optipng +0 -0
- data/vendor/linux-aarch64-musl/oxipng +0 -0
- data/vendor/linux-aarch64-musl/pngcrush +0 -0
- data/vendor/linux-aarch64-musl/pngout +0 -0
- data/vendor/linux-aarch64-musl/pngquant +0 -0
- data/vendor/linux-x86_64-musl/advpng +0 -0
- data/vendor/linux-x86_64-musl/gifsicle +0 -0
- data/vendor/linux-x86_64-musl/jhead +0 -0
- data/vendor/linux-x86_64-musl/jpeg-recompress +0 -0
- data/vendor/linux-x86_64-musl/jpegoptim +0 -0
- data/vendor/linux-x86_64-musl/jpegtran +0 -0
- data/vendor/linux-x86_64-musl/libjpeg.so +0 -0
- data/vendor/linux-x86_64-musl/liblcms2.so +0 -0
- data/vendor/linux-x86_64-musl/libpng.so +0 -0
- data/vendor/linux-x86_64-musl/libz.so +0 -0
- data/vendor/linux-x86_64-musl/optipng +0 -0
- data/vendor/linux-x86_64-musl/oxipng +0 -0
- data/vendor/linux-x86_64-musl/pngcrush +0 -0
- data/vendor/linux-x86_64-musl/pngout +0 -0
- data/vendor/linux-x86_64-musl/pngquant +0 -0
- metadata +66 -18
- /data/{image_optim_pack-linux-x86_64.gemspec → image_optim_pack-linux-aarch64-gnu.gemspec} +0 -0
- /data/vendor/{linux-x86_64 → linux-x86_64-gnu}/advpng +0 -0
- /data/vendor/{linux-x86_64 → linux-x86_64-gnu}/gifsicle +0 -0
- /data/vendor/{linux-x86_64 → linux-x86_64-gnu}/jhead +0 -0
- /data/vendor/{linux-x86_64 → linux-x86_64-gnu}/jpeg-recompress +0 -0
- /data/vendor/{linux-x86_64 → linux-x86_64-gnu}/jpegoptim +0 -0
- /data/vendor/{linux-x86_64 → linux-x86_64-gnu}/jpegtran +0 -0
- /data/vendor/{linux-x86_64 → linux-x86_64-gnu}/libjpeg.so +0 -0
- /data/vendor/{linux-x86_64 → linux-x86_64-gnu}/liblcms2.so +0 -0
- /data/vendor/{linux-x86_64 → linux-x86_64-gnu}/libpng.so +0 -0
- /data/vendor/{linux-x86_64 → linux-x86_64-gnu}/libz.so +0 -0
- /data/vendor/{linux-x86_64 → linux-x86_64-gnu}/optipng +0 -0
- /data/vendor/{linux-x86_64 → linux-x86_64-gnu}/oxipng +0 -0
- /data/vendor/{linux-x86_64 → linux-x86_64-gnu}/pngcrush +0 -0
- /data/vendor/{linux-x86_64 → linux-x86_64-gnu}/pngout +0 -0
- /data/vendor/{linux-x86_64 → linux-x86_64-gnu}/pngquant +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a61d4808d7c57038edadd1f8fcb7985f4f8739f47c625595f48a016483bdc67e
|
|
4
|
+
data.tar.gz: 21e28d8500925517caa71ca5ee3de37701a7e745c5a6d6506f57bc654eba8399
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5adea1b45237b93c23642a29fed4d7dd6cde1343278d62587f78d0f7c045ed7547056fa66b1fed90bc31cbe406250a3d7fa8c5ab2bbc8797afd0d5f4557bc7ef
|
|
7
|
+
data.tar.gz: 170a3237331e8801290737ed7b6238bf717a75b0d96cdc934fa3ffa0da8db2923646346a669a6016480f4fa8541cc42ce4c0b155a32b074847e90cfd3f3bde91
|
data/.github/workflows/build.yml
CHANGED
|
@@ -3,45 +3,65 @@ on:
|
|
|
3
3
|
push:
|
|
4
4
|
pull_request:
|
|
5
5
|
jobs:
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
linux-gnu-build:
|
|
7
|
+
strategy:
|
|
8
|
+
fail-fast: false
|
|
9
|
+
matrix:
|
|
10
|
+
arch: [x86_64, aarch64]
|
|
11
|
+
runs-on: ${{ case(matrix.arch == 'x86_64', 'ubuntu-latest', 'ubuntu-22.04-arm') }}
|
|
8
12
|
steps:
|
|
9
13
|
- uses: actions/checkout@v6
|
|
10
|
-
- run: uname -m
|
|
14
|
+
- run: uname -m && test "$(uname -m)" = "${{ matrix.arch }}"
|
|
15
|
+
- run: make test
|
|
16
|
+
- run: rm -r vendor
|
|
11
17
|
- run: sudo apt-get install -y chrpath
|
|
12
|
-
- run: rustup target list --installed
|
|
13
18
|
- run: make download download-dependencies
|
|
14
|
-
- run:
|
|
15
|
-
- run: make all
|
|
19
|
+
- run: make all -j
|
|
16
20
|
- uses: actions/upload-artifact@v7
|
|
17
21
|
with:
|
|
18
|
-
name:
|
|
22
|
+
name: ${{ github.job }}-${{ matrix.arch }}
|
|
19
23
|
path: vendor/
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
|
|
25
|
+
linux-musl-build:
|
|
26
|
+
strategy:
|
|
27
|
+
fail-fast: false
|
|
28
|
+
matrix:
|
|
29
|
+
arch: [x86_64, aarch64]
|
|
30
|
+
runs-on: ${{ case(matrix.arch == 'x86_64', 'ubuntu-latest', 'ubuntu-22.04-arm') }}
|
|
22
31
|
steps:
|
|
23
32
|
- uses: actions/checkout@v6
|
|
24
|
-
- run:
|
|
25
|
-
- run:
|
|
26
|
-
- run: make
|
|
27
|
-
- run:
|
|
28
|
-
- run:
|
|
29
|
-
- run:
|
|
33
|
+
- run: docker run -di --rm --name build -v ${{ github.workspace }}:/work -w /work rust:alpine
|
|
34
|
+
- run: docker exec build sh -c 'uname -m && test "$(uname -m)" = "${{ matrix.arch }}"'
|
|
35
|
+
- run: docker exec build apk add --no-cache make file perl
|
|
36
|
+
- run: docker exec build make test
|
|
37
|
+
- run: docker exec build rm -r vendor
|
|
38
|
+
- run: docker exec build apk add --no-cache gcc g++ chrpath pkgconf autoconf automake libtool nasm cmake patch wget
|
|
39
|
+
- run: docker exec build make download download-dependencies
|
|
40
|
+
- run: docker exec build make all -j
|
|
41
|
+
- run: docker stop build
|
|
42
|
+
if: always()
|
|
30
43
|
- uses: actions/upload-artifact@v7
|
|
31
44
|
with:
|
|
32
|
-
name:
|
|
45
|
+
name: ${{ github.job }}-${{ matrix.arch }}
|
|
33
46
|
path: vendor/
|
|
34
|
-
|
|
35
|
-
|
|
47
|
+
|
|
48
|
+
darwin-build:
|
|
49
|
+
strategy:
|
|
50
|
+
fail-fast: false
|
|
51
|
+
matrix:
|
|
52
|
+
arch: [x86_64, arm64]
|
|
53
|
+
build: [x86_64, arm64]
|
|
54
|
+
runs-on: ${{ case(matrix.arch == 'x86_64', 'macos-15-intel', 'macos-14') }}
|
|
36
55
|
steps:
|
|
37
56
|
- uses: actions/checkout@v6
|
|
38
|
-
- run: uname -m
|
|
39
|
-
- run:
|
|
40
|
-
- run: make download download-dependencies
|
|
57
|
+
- run: uname -m && test "$(uname -m)" = "${{ matrix.arch }}"
|
|
58
|
+
- run: make test ARCH="${{ matrix.build }}"
|
|
41
59
|
- run: rm -r vendor
|
|
42
|
-
- run: make
|
|
43
|
-
- run:
|
|
60
|
+
- run: make download download-dependencies
|
|
61
|
+
- run: rustup target add "${{ case(matrix.build == 'arm64', 'aarch64', matrix.build) }}-apple-darwin"
|
|
62
|
+
if: ${{ matrix.build != matrix.arch }}
|
|
63
|
+
- run: make all -j ARCH="${{ matrix.build }}"
|
|
44
64
|
- uses: actions/upload-artifact@v7
|
|
45
65
|
with:
|
|
46
|
-
name:
|
|
66
|
+
name: ${{ github.job }}-${{ matrix.arch }}-build-${{ matrix.build }}
|
|
47
67
|
path: vendor/
|
data/.github/workflows/check.yml
CHANGED
data/.rubocop.yml
CHANGED
data/CHANGELOG.markdown
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## unreleased
|
|
4
4
|
|
|
5
|
+
## v0.13.0 (2026-04-04)
|
|
6
|
+
|
|
7
|
+
* Add linux-x86_64-musl and linux-aarch64-musl builds [@toy](https://github.com/toy)
|
|
8
|
+
* Differentiate linux platform and vendor dirs using libc suffix [@toy](https://github.com/toy)
|
|
9
|
+
* Add linux-aarch64/arm64 platform built using debian bookworm [@toy](https://github.com/toy)
|
|
10
|
+
|
|
5
11
|
## v0.12.2.20260327 (2026-03-27)
|
|
6
12
|
|
|
7
13
|
* libpng 1.6.56 [@toy](https://github.com/toy)
|
data/Dockerfile
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
FROM alpine
|
|
1
|
+
FROM alpine AS base
|
|
2
2
|
ENV LD_LIBRARY_PATH=/usr/local/lib
|
|
3
3
|
WORKDIR /tmp
|
|
4
4
|
|
|
5
|
-
FROM base
|
|
5
|
+
FROM base AS build
|
|
6
6
|
RUN apk add --no-cache build-base cmake nasm bash findutils
|
|
7
7
|
COPY script/extract ./
|
|
8
8
|
ENV CPATH=/usr/local/include
|
|
9
9
|
|
|
10
|
-
FROM rust:1-alpine
|
|
10
|
+
FROM rust:1-alpine AS cargo
|
|
11
11
|
RUN apk add --no-cache build-base
|
|
12
12
|
COPY script/extract ./
|
|
13
13
|
|
|
14
|
-
FROM cargo
|
|
14
|
+
FROM cargo AS libz
|
|
15
15
|
ARG LIBZ_VER
|
|
16
16
|
ARG LIBZ_SHA256
|
|
17
17
|
COPY download/libz-$LIBZ_VER.tar.gz download/
|
|
@@ -20,7 +20,7 @@ RUN ./extract libz && \
|
|
|
20
20
|
./configure && \
|
|
21
21
|
make install
|
|
22
22
|
|
|
23
|
-
FROM libz
|
|
23
|
+
FROM libz AS libpng
|
|
24
24
|
ARG LIBPNG_VER
|
|
25
25
|
ARG LIBPNG_SHA256
|
|
26
26
|
COPY download/libpng-$LIBPNG_VER.tar.gz download/
|
|
@@ -29,7 +29,7 @@ RUN ./extract libpng && \
|
|
|
29
29
|
./configure --with-zlib-prefix=/usr/local && \
|
|
30
30
|
make install
|
|
31
31
|
|
|
32
|
-
FROM libpng
|
|
32
|
+
FROM libpng AS liblcms2
|
|
33
33
|
ARG LIBLCMS2_VER
|
|
34
34
|
ARG LIBLCMS2_SHA256
|
|
35
35
|
COPY download/liblcms2-$LIBLCMS2_VER.tar.gz download/
|
|
@@ -38,7 +38,7 @@ RUN ./extract liblcms2 && \
|
|
|
38
38
|
./configure && \
|
|
39
39
|
make install
|
|
40
40
|
|
|
41
|
-
FROM build
|
|
41
|
+
FROM build AS libjpeg
|
|
42
42
|
ARG LIBJPEG_VER
|
|
43
43
|
ARG LIBJPEG_SHA256
|
|
44
44
|
COPY download/libjpeg-$LIBJPEG_VER.tar.gz download/
|
|
@@ -47,7 +47,7 @@ RUN ./extract libjpeg && \
|
|
|
47
47
|
./configure && \
|
|
48
48
|
make install
|
|
49
49
|
|
|
50
|
-
FROM build
|
|
50
|
+
FROM build AS libmozjpeg
|
|
51
51
|
ARG LIBMOZJPEG_VER
|
|
52
52
|
ARG LIBMOZJPEG_SHA256
|
|
53
53
|
COPY download/libmozjpeg-$LIBMOZJPEG_VER.tar.gz download/
|
|
@@ -56,7 +56,7 @@ RUN ./extract libmozjpeg && \
|
|
|
56
56
|
cmake -DPNG_SUPPORTED=0 -DCMAKE_POLICY_VERSION_MINIMUM=3.5 . && \
|
|
57
57
|
make install
|
|
58
58
|
|
|
59
|
-
FROM libpng
|
|
59
|
+
FROM libpng AS advancecomp
|
|
60
60
|
ARG ADVANCECOMP_VER
|
|
61
61
|
ARG ADVANCECOMP_SHA256
|
|
62
62
|
COPY download/advancecomp-$ADVANCECOMP_VER.tar.gz download/
|
|
@@ -65,7 +65,7 @@ RUN ./extract advancecomp && \
|
|
|
65
65
|
./configure && \
|
|
66
66
|
make install
|
|
67
67
|
|
|
68
|
-
FROM build
|
|
68
|
+
FROM build AS gifsicle
|
|
69
69
|
ARG GIFSICLE_VER
|
|
70
70
|
ARG GIFSICLE_SHA256
|
|
71
71
|
COPY download/gifsicle-$GIFSICLE_VER.tar.gz download/
|
|
@@ -74,7 +74,7 @@ RUN ./extract gifsicle && \
|
|
|
74
74
|
./configure && \
|
|
75
75
|
make install
|
|
76
76
|
|
|
77
|
-
FROM build
|
|
77
|
+
FROM build AS jhead
|
|
78
78
|
ARG JHEAD_VER
|
|
79
79
|
ARG JHEAD_SHA256
|
|
80
80
|
COPY download/jhead-$JHEAD_VER.tar.gz download/
|
|
@@ -83,7 +83,7 @@ RUN ./extract jhead && \
|
|
|
83
83
|
make && \
|
|
84
84
|
install -c jhead /usr/local/bin
|
|
85
85
|
|
|
86
|
-
FROM libmozjpeg
|
|
86
|
+
FROM libmozjpeg AS jpegarchive
|
|
87
87
|
ARG JPEGARCHIVE_VER
|
|
88
88
|
ARG JPEGARCHIVE_SHA256
|
|
89
89
|
COPY download/jpegarchive-$JPEGARCHIVE_VER.tar.gz download/
|
|
@@ -91,7 +91,7 @@ RUN ./extract jpegarchive && \
|
|
|
91
91
|
cd build/jpegarchive && \
|
|
92
92
|
CFLAGS=-fcommon make install
|
|
93
93
|
|
|
94
|
-
FROM libjpeg
|
|
94
|
+
FROM libjpeg AS jpegoptim
|
|
95
95
|
ARG JPEGOPTIM_VER
|
|
96
96
|
ARG JPEGOPTIM_SHA256
|
|
97
97
|
COPY download/jpegoptim-$JPEGOPTIM_VER.tar.gz download/
|
|
@@ -100,7 +100,7 @@ RUN ./extract jpegoptim && \
|
|
|
100
100
|
./configure && \
|
|
101
101
|
make install
|
|
102
102
|
|
|
103
|
-
FROM libpng
|
|
103
|
+
FROM libpng AS optipng
|
|
104
104
|
ARG OPTIPNG_VER
|
|
105
105
|
ARG OPTIPNG_SHA256
|
|
106
106
|
COPY download/optipng-$OPTIPNG_VER.tar.gz download/
|
|
@@ -109,7 +109,7 @@ RUN ./extract optipng && \
|
|
|
109
109
|
./configure && \
|
|
110
110
|
make install
|
|
111
111
|
|
|
112
|
-
FROM cargo
|
|
112
|
+
FROM cargo AS oxipng
|
|
113
113
|
ARG OXIPNG_VER
|
|
114
114
|
ARG OXIPNG_SHA256
|
|
115
115
|
COPY download/oxipng-$OXIPNG_VER.tar.gz download/
|
|
@@ -118,7 +118,7 @@ RUN ./extract oxipng && \
|
|
|
118
118
|
cargo build --release && \
|
|
119
119
|
install -c target/release/oxipng /usr/local/bin
|
|
120
120
|
|
|
121
|
-
FROM libpng
|
|
121
|
+
FROM libpng AS pngcrush
|
|
122
122
|
ARG PNGCRUSH_VER
|
|
123
123
|
ARG PNGCRUSH_SHA256
|
|
124
124
|
COPY download/pngcrush-$PNGCRUSH_VER.tar.gz download/
|
|
@@ -129,7 +129,7 @@ RUN ./extract pngcrush && \
|
|
|
129
129
|
make && \
|
|
130
130
|
install -c pngcrush /usr/local/bin
|
|
131
131
|
|
|
132
|
-
FROM build
|
|
132
|
+
FROM build AS pngout
|
|
133
133
|
ARG PNGOUT_LINUX_STATIC_VER
|
|
134
134
|
ARG PNGOUT_LINUX_STATIC_SHA256
|
|
135
135
|
COPY download/pngout_linux_static-$PNGOUT_LINUX_STATIC_VER.tar.gz download/
|
|
@@ -137,7 +137,7 @@ RUN ./extract pngout_linux_static && \
|
|
|
137
137
|
cd build/pngout_linux_static && \
|
|
138
138
|
cp amd64/pngout-static /usr/local/bin/pngout
|
|
139
139
|
|
|
140
|
-
FROM liblcms2
|
|
140
|
+
FROM liblcms2 AS pngquant
|
|
141
141
|
ARG PNGQUANT_VER
|
|
142
142
|
ARG PNGQUANT_SHA256
|
|
143
143
|
COPY download/pngquant-$PNGQUANT_VER.tar.gz download/
|
|
@@ -146,7 +146,7 @@ RUN ./extract pngquant && \
|
|
|
146
146
|
cargo build --release && \
|
|
147
147
|
install -c target/release/pngquant /usr/local/bin
|
|
148
148
|
|
|
149
|
-
# FROM build
|
|
149
|
+
# FROM build AS [name]
|
|
150
150
|
# ARG [NAME]_VER
|
|
151
151
|
# ARG [NAME]_SHA256
|
|
152
152
|
# COPY download/[name]-$[NAME]_VER.tar.gz download/
|
|
@@ -155,7 +155,7 @@ RUN ./extract pngquant && \
|
|
|
155
155
|
# ./configure && \
|
|
156
156
|
# make install
|
|
157
157
|
|
|
158
|
-
FROM base
|
|
158
|
+
FROM base AS image_optim
|
|
159
159
|
RUN apk add --no-cache libstdc++ ruby npm perl dumb-init
|
|
160
160
|
|
|
161
161
|
COPY README.markdown /
|
data/Dockerfile.debian
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
FROM debian
|
|
1
|
+
FROM debian AS base
|
|
2
2
|
ENV LD_LIBRARY_PATH=/usr/local/lib
|
|
3
3
|
WORKDIR /tmp
|
|
4
4
|
|
|
5
|
-
FROM base
|
|
5
|
+
FROM base AS build
|
|
6
6
|
RUN apt-get update && apt-get install -y build-essential cmake nasm bash findutils
|
|
7
7
|
COPY script/extract ./
|
|
8
8
|
ENV CPATH=/usr/local/include
|
|
9
9
|
|
|
10
|
-
FROM rust:1
|
|
10
|
+
FROM rust:1 AS cargo
|
|
11
11
|
RUN apt-get update && apt-get install -y build-essential
|
|
12
12
|
COPY script/extract ./
|
|
13
13
|
|
|
14
|
-
FROM cargo
|
|
14
|
+
FROM cargo AS libz
|
|
15
15
|
ARG LIBZ_VER
|
|
16
16
|
ARG LIBZ_SHA256
|
|
17
17
|
COPY download/libz-$LIBZ_VER.tar.gz download/
|
|
@@ -20,7 +20,7 @@ RUN ./extract libz && \
|
|
|
20
20
|
./configure && \
|
|
21
21
|
make install
|
|
22
22
|
|
|
23
|
-
FROM libz
|
|
23
|
+
FROM libz AS libpng
|
|
24
24
|
ARG LIBPNG_VER
|
|
25
25
|
ARG LIBPNG_SHA256
|
|
26
26
|
COPY download/libpng-$LIBPNG_VER.tar.gz download/
|
|
@@ -29,7 +29,7 @@ RUN ./extract libpng && \
|
|
|
29
29
|
./configure --with-zlib-prefix=/usr/local && \
|
|
30
30
|
make install
|
|
31
31
|
|
|
32
|
-
FROM libpng
|
|
32
|
+
FROM libpng AS liblcms2
|
|
33
33
|
ARG LIBLCMS2_VER
|
|
34
34
|
ARG LIBLCMS2_SHA256
|
|
35
35
|
COPY download/liblcms2-$LIBLCMS2_VER.tar.gz download/
|
|
@@ -38,7 +38,7 @@ RUN ./extract liblcms2 && \
|
|
|
38
38
|
./configure && \
|
|
39
39
|
make install
|
|
40
40
|
|
|
41
|
-
FROM build
|
|
41
|
+
FROM build AS libjpeg
|
|
42
42
|
ARG LIBJPEG_VER
|
|
43
43
|
ARG LIBJPEG_SHA256
|
|
44
44
|
COPY download/libjpeg-$LIBJPEG_VER.tar.gz download/
|
|
@@ -47,7 +47,7 @@ RUN ./extract libjpeg && \
|
|
|
47
47
|
./configure && \
|
|
48
48
|
make install
|
|
49
49
|
|
|
50
|
-
FROM build
|
|
50
|
+
FROM build AS libmozjpeg
|
|
51
51
|
ARG LIBMOZJPEG_VER
|
|
52
52
|
ARG LIBMOZJPEG_SHA256
|
|
53
53
|
COPY download/libmozjpeg-$LIBMOZJPEG_VER.tar.gz download/
|
|
@@ -56,7 +56,7 @@ RUN ./extract libmozjpeg && \
|
|
|
56
56
|
cmake -DPNG_SUPPORTED=0 -DCMAKE_POLICY_VERSION_MINIMUM=3.5 . && \
|
|
57
57
|
make install
|
|
58
58
|
|
|
59
|
-
FROM libpng
|
|
59
|
+
FROM libpng AS advancecomp
|
|
60
60
|
ARG ADVANCECOMP_VER
|
|
61
61
|
ARG ADVANCECOMP_SHA256
|
|
62
62
|
COPY download/advancecomp-$ADVANCECOMP_VER.tar.gz download/
|
|
@@ -65,7 +65,7 @@ RUN ./extract advancecomp && \
|
|
|
65
65
|
./configure && \
|
|
66
66
|
make install
|
|
67
67
|
|
|
68
|
-
FROM build
|
|
68
|
+
FROM build AS gifsicle
|
|
69
69
|
ARG GIFSICLE_VER
|
|
70
70
|
ARG GIFSICLE_SHA256
|
|
71
71
|
COPY download/gifsicle-$GIFSICLE_VER.tar.gz download/
|
|
@@ -74,7 +74,7 @@ RUN ./extract gifsicle && \
|
|
|
74
74
|
./configure && \
|
|
75
75
|
make install
|
|
76
76
|
|
|
77
|
-
FROM build
|
|
77
|
+
FROM build AS jhead
|
|
78
78
|
ARG JHEAD_VER
|
|
79
79
|
ARG JHEAD_SHA256
|
|
80
80
|
COPY download/jhead-$JHEAD_VER.tar.gz download/
|
|
@@ -83,7 +83,7 @@ RUN ./extract jhead && \
|
|
|
83
83
|
make && \
|
|
84
84
|
install -c jhead /usr/local/bin
|
|
85
85
|
|
|
86
|
-
FROM libmozjpeg
|
|
86
|
+
FROM libmozjpeg AS jpegarchive
|
|
87
87
|
ARG JPEGARCHIVE_VER
|
|
88
88
|
ARG JPEGARCHIVE_SHA256
|
|
89
89
|
COPY download/jpegarchive-$JPEGARCHIVE_VER.tar.gz download/
|
|
@@ -91,7 +91,7 @@ RUN ./extract jpegarchive && \
|
|
|
91
91
|
cd build/jpegarchive && \
|
|
92
92
|
CFLAGS=-fcommon make install
|
|
93
93
|
|
|
94
|
-
FROM libjpeg
|
|
94
|
+
FROM libjpeg AS jpegoptim
|
|
95
95
|
ARG JPEGOPTIM_VER
|
|
96
96
|
ARG JPEGOPTIM_SHA256
|
|
97
97
|
COPY download/jpegoptim-$JPEGOPTIM_VER.tar.gz download/
|
|
@@ -100,7 +100,7 @@ RUN ./extract jpegoptim && \
|
|
|
100
100
|
./configure && \
|
|
101
101
|
make install
|
|
102
102
|
|
|
103
|
-
FROM libpng
|
|
103
|
+
FROM libpng AS optipng
|
|
104
104
|
ARG OPTIPNG_VER
|
|
105
105
|
ARG OPTIPNG_SHA256
|
|
106
106
|
COPY download/optipng-$OPTIPNG_VER.tar.gz download/
|
|
@@ -109,7 +109,7 @@ RUN ./extract optipng && \
|
|
|
109
109
|
./configure && \
|
|
110
110
|
make install
|
|
111
111
|
|
|
112
|
-
FROM cargo
|
|
112
|
+
FROM cargo AS oxipng
|
|
113
113
|
ARG OXIPNG_VER
|
|
114
114
|
ARG OXIPNG_SHA256
|
|
115
115
|
COPY download/oxipng-$OXIPNG_VER.tar.gz download/
|
|
@@ -118,7 +118,7 @@ RUN ./extract oxipng && \
|
|
|
118
118
|
cargo build --release && \
|
|
119
119
|
install -c target/release/oxipng /usr/local/bin
|
|
120
120
|
|
|
121
|
-
FROM libpng
|
|
121
|
+
FROM libpng AS pngcrush
|
|
122
122
|
ARG PNGCRUSH_VER
|
|
123
123
|
ARG PNGCRUSH_SHA256
|
|
124
124
|
COPY download/pngcrush-$PNGCRUSH_VER.tar.gz download/
|
|
@@ -129,15 +129,15 @@ RUN ./extract pngcrush && \
|
|
|
129
129
|
make && \
|
|
130
130
|
install -c pngcrush /usr/local/bin
|
|
131
131
|
|
|
132
|
-
FROM build
|
|
133
|
-
ARG
|
|
134
|
-
ARG
|
|
135
|
-
COPY download/
|
|
136
|
-
RUN ./extract
|
|
137
|
-
cd build/
|
|
138
|
-
cp amd64/pngout
|
|
132
|
+
FROM build AS pngout
|
|
133
|
+
ARG PNGOUT_LINUX_VER
|
|
134
|
+
ARG PNGOUT_LINUX_SHA256
|
|
135
|
+
COPY download/pngout_linux-$PNGOUT_LINUX_VER.tar.gz download/
|
|
136
|
+
RUN ./extract pngout_linux && \
|
|
137
|
+
cd build/pngout_linux && \
|
|
138
|
+
cp amd64/pngout /usr/local/bin/pngout
|
|
139
139
|
|
|
140
|
-
FROM liblcms2
|
|
140
|
+
FROM liblcms2 AS pngquant
|
|
141
141
|
ARG PNGQUANT_VER
|
|
142
142
|
ARG PNGQUANT_SHA256
|
|
143
143
|
COPY download/pngquant-$PNGQUANT_VER.tar.gz download/
|
|
@@ -146,7 +146,7 @@ RUN ./extract pngquant && \
|
|
|
146
146
|
cargo build --release && \
|
|
147
147
|
install -c target/release/pngquant /usr/local/bin
|
|
148
148
|
|
|
149
|
-
# FROM build
|
|
149
|
+
# FROM build AS [name]
|
|
150
150
|
# ARG [NAME]_VER
|
|
151
151
|
# ARG [NAME]_SHA256
|
|
152
152
|
# COPY download/[name]-$[NAME]_VER.tar.gz download/
|
|
@@ -155,7 +155,7 @@ RUN ./extract pngquant && \
|
|
|
155
155
|
# ./configure && \
|
|
156
156
|
# make install
|
|
157
157
|
|
|
158
|
-
FROM base
|
|
158
|
+
FROM base AS image_optim
|
|
159
159
|
RUN apt-get update && apt-get install -y ruby npm perl-base dumb-init
|
|
160
160
|
|
|
161
161
|
COPY README.markdown /
|
data/Makefile
CHANGED
|
@@ -41,15 +41,19 @@ IS_LINUX := $(findstring linux,$(OS))
|
|
|
41
41
|
IS_BSD := $(findstring bsd,$(OS))
|
|
42
42
|
IS_FREEBSD := $(findstring freebsd,$(OS))
|
|
43
43
|
IS_OPENBSD := $(findstring openbsd,$(OS))
|
|
44
|
+
|
|
45
|
+
IS_LINUX_MUSL := $(findstring linux-musl,$(shell gcc -dumpmachine))
|
|
46
|
+
|
|
44
47
|
DLEXT := $(if $(IS_DARWIN),.dylib,.so)
|
|
45
48
|
HOST := $(ARCH:arm64=arm)-$(if $(IS_DARWIN),apple,pc)-$(OS)
|
|
46
|
-
|
|
49
|
+
LIBC_SUFFIX := $(if $(IS_DARWIN),,$(if $(IS_LINUX_MUSL),-musl,-gnu))
|
|
50
|
+
RUST_HOST := $(ARCH:arm64=aarch64)-$(if $(IS_DARWIN),apple-darwin,unknown-linux$(LIBC_SUFFIX))
|
|
47
51
|
|
|
48
52
|
DL_DIR := $(CURDIR)/download
|
|
49
53
|
BUILD_ROOT_DIR := $(CURDIR)/build
|
|
50
|
-
BUILD_DIR := $(BUILD_ROOT_DIR)/$(OS)-$(ARCH)
|
|
54
|
+
BUILD_DIR := $(BUILD_ROOT_DIR)/$(OS)-$(ARCH)$(LIBC_SUFFIX)
|
|
51
55
|
OUTPUT_ROOT_DIR := $(CURDIR)/vendor
|
|
52
|
-
OUTPUT_DIR := $(OUTPUT_ROOT_DIR)/$(OS)-$(ARCH)
|
|
56
|
+
OUTPUT_DIR := $(OUTPUT_ROOT_DIR)/$(OS)-$(ARCH)$(LIBC_SUFFIX)
|
|
53
57
|
PATCHES_DIR := $(CURDIR)/patches
|
|
54
58
|
|
|
55
59
|
export CARGO_HOME := $(DL_DIR)/cargo
|
|
@@ -205,6 +209,8 @@ $(eval $(call target,OXIPNG,,target/$(RUST_HOST)/release/oxipng))
|
|
|
205
209
|
$(eval $(call target,PNGCRUSH))
|
|
206
210
|
ifdef IS_DARWIN
|
|
207
211
|
$(eval $(call target,PNGOUT,PNGOUT_DARWIN,,NOSTRIP))
|
|
212
|
+
else ifdef IS_LINUX_MUSL
|
|
213
|
+
$(eval $(call target,PNGOUT,PNGOUT_LINUX_STATIC,,NOSTRIP))
|
|
208
214
|
else
|
|
209
215
|
$(eval $(call target,PNGOUT,PNGOUT_LINUX,,NOSTRIP))
|
|
210
216
|
endif
|
|
@@ -213,11 +219,7 @@ $(eval $(call target,PNGQUANT,,target/$(RUST_HOST)/release/pngquant))
|
|
|
213
219
|
# ====== TARGETS ======
|
|
214
220
|
|
|
215
221
|
all : build
|
|
216
|
-
ifeq ($(ARCH),$(HOST_ARCH))
|
|
217
222
|
@$(MAKE) test
|
|
218
|
-
else
|
|
219
|
-
@echo Skipping tests when compiling for different architecture
|
|
220
|
-
endif
|
|
221
223
|
.PHONY : all
|
|
222
224
|
|
|
223
225
|
build : $(call downcase,$(PRODUCTS))
|
|
@@ -232,11 +234,17 @@ endif
|
|
|
232
234
|
ldd-version :; $(ldd) --version
|
|
233
235
|
.PHONY : ldd-version
|
|
234
236
|
|
|
235
|
-
define
|
|
236
|
-
@test -
|
|
237
|
+
define check_file_presence
|
|
238
|
+
@test -e $(OUTPUT_DIR)/$1 || \
|
|
237
239
|
{ printf "%s: $(ANSI_RED)not found$(ANSI_RESET)\n" "$1"; exit 1; }
|
|
240
|
+
@test -f $(OUTPUT_DIR)/$1 || \
|
|
241
|
+
{ printf "%s: $(ANSI_RED)not a regular file$(ANSI_RESET)\n" "$1"; exit 1; }
|
|
242
|
+
@test -s $(OUTPUT_DIR)/$1 || \
|
|
243
|
+
{ printf "%s: $(ANSI_RED)has size zero$(ANSI_RESET)\n" "$1"; exit 1; }
|
|
238
244
|
endef
|
|
239
245
|
|
|
246
|
+
CHECK_VERSION := $(if $(findstring $(HOST_ARCH)/$(ARCH),x86_64/arm64),,check)
|
|
247
|
+
|
|
240
248
|
define check_version
|
|
241
249
|
@$(OUTPUT_DIR)/$1 $2 | fgrep -q "$3" || \
|
|
242
250
|
{ printf "%s: $(ANSI_RED)Expected %s, got %s$(ANSI_RESET)\n" "$1" "$3" "$$($(OUTPUT_DIR)/$1 $2)"; exit 1; }
|
|
@@ -248,26 +256,30 @@ define check_arch
|
|
|
248
256
|
endef
|
|
249
257
|
|
|
250
258
|
define check_output
|
|
251
|
-
@printf "%s: $(ANSI_GREEN)%s$(ANSI_RESET) / $(ANSI_MAGENTA)%s$(ANSI_RESET)\n" "$1" "$
|
|
259
|
+
@printf "%s: $(ANSI_GREEN)%s$(ANSI_RESET) / $(ANSI_MAGENTA)%s$(ANSI_RESET)\n" "$1" "$2" "$(ARCH_STRING)"
|
|
252
260
|
endef
|
|
253
261
|
|
|
254
262
|
define check_shlib
|
|
255
|
-
|
|
256
|
-
|
|
263
|
+
@if file $(OUTPUT_DIR)/$1 | fgrep -q 'statically linked'; then \
|
|
264
|
+
printf '\tstatically Linked\n'; \
|
|
265
|
+
else \
|
|
266
|
+
$(ldd) $(OUTPUT_DIR)/$1 | egrep "\s+.*/.*" && \
|
|
267
|
+
! $(ldd) $(OUTPUT_DIR)/$1 | egrep -o $$'[^: \t]+/[^: \t]+' | egrep -v "^(@loader_path|/lib|/lib64|/usr|$(OUTPUT_DIR))/"; \
|
|
268
|
+
fi
|
|
257
269
|
endef
|
|
258
270
|
|
|
259
271
|
define check_lib
|
|
260
|
-
$(call
|
|
272
|
+
$(call check_file_presence,$1)
|
|
261
273
|
$(call check_arch,$1)
|
|
262
|
-
$(call check_output,$1
|
|
274
|
+
$(call check_output,$1,-)
|
|
263
275
|
$(call check_shlib,$1)
|
|
264
276
|
endef
|
|
265
277
|
|
|
266
278
|
define check_bin
|
|
267
|
-
$(call
|
|
268
|
-
$(call check_version,$1,$2,$3)
|
|
279
|
+
$(call check_file_presence,$1)
|
|
280
|
+
$(if $(CHECK_VERSION),$(call check_version,$1,$2,$3))
|
|
269
281
|
$(call check_arch,$1)
|
|
270
|
-
$(call check_output,$1
|
|
282
|
+
$(call check_output,$1,$(if $(CHECK_VERSION),$3,[can't run $(ARCH) on $(HOST_ARCH)]))
|
|
271
283
|
$(call check_shlib,$1)
|
|
272
284
|
endef
|
|
273
285
|
|
|
@@ -275,9 +287,10 @@ ifdef IS_DARWIN
|
|
|
275
287
|
test : ARCH_STRING := $(ARCH)
|
|
276
288
|
else ifeq (amd64,$(ARCH:x86_64=amd64))
|
|
277
289
|
test : ARCH_STRING := x86-64
|
|
290
|
+
else
|
|
291
|
+
test : ARCH_STRING := $(ARCH)
|
|
278
292
|
endif
|
|
279
293
|
test :
|
|
280
|
-
$(if $(ARCH_STRING),,@echo Detecting 'ARCH $(ARCH) for OS $(OS) undefined'; false)
|
|
281
294
|
$(call check_bin,advpng,--version 2>&1,$(ADVANCECOMP_VER))
|
|
282
295
|
$(call check_bin,gifsicle,--version,$(GIFSICLE_VER))
|
|
283
296
|
$(call check_bin,jhead,-V,$(JHEAD_VER))
|
|
@@ -400,7 +413,6 @@ export CXX := g++
|
|
|
400
413
|
endif
|
|
401
414
|
|
|
402
415
|
GCC_FLAGS := -O3
|
|
403
|
-
STATIC_LIBGCC := $(shell if $(CC) -v 2>&1 | fgrep -q gcc; then echo -static-libgcc; fi)
|
|
404
416
|
|
|
405
417
|
export CFLAGS = $(GCC_FLAGS)
|
|
406
418
|
export CXXFLAGS = $(GCC_FLAGS)
|
|
@@ -519,6 +531,9 @@ $(OPTIPNG_TARGET) :
|
|
|
519
531
|
$(call chrpath_origin,$@)
|
|
520
532
|
|
|
521
533
|
## oxipng
|
|
534
|
+
ifdef IS_LINUX_MUSL
|
|
535
|
+
$(PNGQUANT_TARGET) : export RUSTFLAGS = -C target-feature=-crt-static
|
|
536
|
+
endif
|
|
522
537
|
$(OXIPNG_TARGET) :
|
|
523
538
|
cd $(DIR) && cargo build --release --frozen --offline --target=$(RUST_HOST)
|
|
524
539
|
|
|
@@ -539,13 +554,13 @@ $(PNGCRUSH_TARGET) :
|
|
|
539
554
|
## pngout
|
|
540
555
|
$(PNGOUT_TARGET) :
|
|
541
556
|
ifdef IS_LINUX
|
|
542
|
-
cd $(DIR) && ln -sf $(ARCH:x86_64=amd64)/pngout
|
|
557
|
+
cd $(DIR) && ln -sf $(ARCH:x86_64=amd64)/pngout$(if $(IS_LINUX_MUSL),-static) pngout
|
|
543
558
|
endif
|
|
544
559
|
cd $(DIR) && touch pngout
|
|
545
560
|
|
|
546
561
|
## pngquant
|
|
547
562
|
$(eval $(call depend,PNGQUANT,LIBLCMS2 LIBPNG LIBZ))
|
|
548
|
-
$(PNGQUANT_TARGET) : export RUSTFLAGS = -C link-arg=$(XORIGIN)
|
|
563
|
+
$(PNGQUANT_TARGET) : export RUSTFLAGS = -C link-arg=$(XORIGIN) $(if $(IS_LINUX_MUSL),-C target-feature=-crt-static)
|
|
549
564
|
$(PNGQUANT_TARGET) :
|
|
550
565
|
printf "%s\n" \
|
|
551
566
|
$(foreach LIB,PNG Z LCMS2, \
|
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.
|
|
5
|
+
s.version = '0.13.0'
|
|
6
6
|
s.summary = %q{Precompiled binaries for image_optim: advpng, gifsicle, jhead, jpeg-recompress, jpegoptim, jpegtran, optipng, oxipng, pngcrush, pngout, pngquant}
|
|
7
7
|
s.homepage = "https://github.com/toy/#{s.name}"
|
|
8
8
|
s.authors = ['Ivan Kuchin']
|
|
@@ -19,16 +19,16 @@ Gem::Specification.new do |s|
|
|
|
19
19
|
|
|
20
20
|
s.files = `git ls-files`.split("\n")
|
|
21
21
|
if defined?(gemspec_path)
|
|
22
|
-
gem_os,
|
|
22
|
+
gem_os, gem_arch, gem_version = File.basename(gemspec_path, File.extname(gemspec_path)).split('-').drop(1)
|
|
23
23
|
|
|
24
|
-
s.platform = Gem::Platform.new([
|
|
24
|
+
s.platform = Gem::Platform.new([gem_arch, gem_os, gem_version])
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
arch_aliases = {
|
|
27
27
|
'x86_64' => %w[x86_64 amd64],
|
|
28
|
-
}[
|
|
28
|
+
}[gem_arch] || [gem_arch]
|
|
29
29
|
|
|
30
|
-
possible_vendor_dirs =
|
|
31
|
-
|
|
30
|
+
possible_vendor_dirs = arch_aliases.map do |arch_alias|
|
|
31
|
+
[gem_os, arch_alias, gem_version].compact.join('-')
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
existing_vendor_dirs = possible_vendor_dirs.select do |vendor_dir|
|
|
@@ -39,7 +39,7 @@ Gem::Specification.new do |s|
|
|
|
39
39
|
existing_vendor_dirs.first
|
|
40
40
|
else
|
|
41
41
|
message = existing_vendor_dirs.empty? ? 'no vendor dir' : 'multiple vendor dirs'
|
|
42
|
-
fail "#{message} found for os #{gem_os} and
|
|
42
|
+
fail "#{message} found for os #{gem_os} and arch #{gem_arch} out of: #{possible_vendor_dirs.join(', ')}"
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
s.files.reject! do |path|
|
data/lib/image_optim/pack.rb
CHANGED
|
@@ -15,13 +15,16 @@ class ImageOptim
|
|
|
15
15
|
# Intended os
|
|
16
16
|
attr_reader :os
|
|
17
17
|
|
|
18
|
-
#
|
|
18
|
+
# Intended architecture
|
|
19
19
|
attr_reader :arch
|
|
20
20
|
|
|
21
|
+
# Intended version
|
|
22
|
+
attr_reader :version
|
|
23
|
+
|
|
21
24
|
# Receive path, use last part for arch and last but one part for os
|
|
22
25
|
def initialize(path)
|
|
23
26
|
@path = FSPath(path)
|
|
24
|
-
@os, @arch = @path.basename.to_s.split('-',
|
|
27
|
+
@os, @arch, @version = @path.basename.to_s.split('-', 3)
|
|
25
28
|
end
|
|
26
29
|
|
|
27
30
|
# Return path converted to string
|
|
@@ -78,6 +81,15 @@ class ImageOptim
|
|
|
78
81
|
'unknown'
|
|
79
82
|
end
|
|
80
83
|
|
|
84
|
+
# extracted from ldd output
|
|
85
|
+
VERSION = if OS == 'linux'
|
|
86
|
+
begin
|
|
87
|
+
`ldd /bin/sh`[/musl|gnu/]
|
|
88
|
+
rescue Errno::ENOENT
|
|
89
|
+
'unknown'
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
81
93
|
# Path to vendor at root of image_optim_pack
|
|
82
94
|
VENDOR_PATH = FSPath('../../../vendor').expand_path(__FILE__)
|
|
83
95
|
|
|
@@ -96,10 +108,15 @@ class ImageOptim
|
|
|
96
108
|
|
|
97
109
|
private
|
|
98
110
|
|
|
99
|
-
# Order by match of os and
|
|
111
|
+
# Order by match of os, arch and version
|
|
100
112
|
def ordered_by_os_arch_match
|
|
101
|
-
PATHS.sort_by do |path|
|
|
102
|
-
[
|
|
113
|
+
PATHS.sort_by.with_index do |path, i|
|
|
114
|
+
[
|
|
115
|
+
path.os == OS ? 0 : 1,
|
|
116
|
+
path.arch == ARCH ? 0 : 1,
|
|
117
|
+
path.version == VERSION ? 0 : 1,
|
|
118
|
+
i,
|
|
119
|
+
]
|
|
103
120
|
end
|
|
104
121
|
end
|
|
105
122
|
|
data/script/run
CHANGED
|
@@ -62,6 +62,7 @@ fi
|
|
|
62
62
|
container_build() {
|
|
63
63
|
vm=$1
|
|
64
64
|
image=$2
|
|
65
|
+
platform=$3
|
|
65
66
|
|
|
66
67
|
passes-filter "$vm" || return 0
|
|
67
68
|
header "$vm"
|
|
@@ -74,7 +75,15 @@ container_build() {
|
|
|
74
75
|
|
|
75
76
|
if [[ -n "$used_image" && "$used_image" != "$image" ]]; then
|
|
76
77
|
echo "Container is using $used_image instead of $image, recreating"
|
|
77
|
-
"$container_tool" rm "$container_name"
|
|
78
|
+
"$container_tool" rm --force "$container_name"
|
|
79
|
+
fi
|
|
80
|
+
|
|
81
|
+
used_image_id=$("$container_tool" inspect --format '{{.Image}}' "$container_name" 2>/dev/null || true)
|
|
82
|
+
used_platform=$("$container_tool" inspect --format '{{.Os}}/{{.Architecture}}' "$used_image_id" 2>/dev/null || true)
|
|
83
|
+
|
|
84
|
+
if [[ -n "$used_platform" && "$used_platform" != "$platform" ]]; then
|
|
85
|
+
echo "Container is using image platform $used_platform instead of $platform, recreating"
|
|
86
|
+
"$container_tool" rm --force "$container_name"
|
|
78
87
|
fi
|
|
79
88
|
|
|
80
89
|
status=$("$container_tool" inspect --format '{{.State.Status}}' "$container_name" 2>/dev/null || true)
|
|
@@ -84,7 +93,8 @@ container_build() {
|
|
|
84
93
|
|
|
85
94
|
"$container_tool" \
|
|
86
95
|
container create \
|
|
87
|
-
--
|
|
96
|
+
--platform "$platform" \
|
|
97
|
+
--name "$container_name" \
|
|
88
98
|
--stop-signal SIGHUP \
|
|
89
99
|
-it \
|
|
90
100
|
-v "${mount//_path_/}:ro" \
|
|
@@ -95,9 +105,16 @@ container_build() {
|
|
|
95
105
|
|
|
96
106
|
"$container_tool" container start "$container_name"
|
|
97
107
|
|
|
98
|
-
"$container_tool" exec -it "$container_name"
|
|
99
|
-
apt-get
|
|
100
|
-
|
|
108
|
+
"$container_tool" exec -it "$container_name" sh -exc "
|
|
109
|
+
if command -v apt-get; then
|
|
110
|
+
apt-get update
|
|
111
|
+
apt-get -y install make gcc g++ chrpath perl pkg-config autoconf automake libtool nasm cmake patch
|
|
112
|
+
elif command -v apk; then
|
|
113
|
+
apk add --no-cache bash make gcc g++ chrpath perl pkgconf autoconf automake libtool nasm cmake patch file
|
|
114
|
+
else
|
|
115
|
+
echo 'unsupported package manager' >&2
|
|
116
|
+
exit 1
|
|
117
|
+
fi
|
|
101
118
|
"
|
|
102
119
|
fi
|
|
103
120
|
|
|
@@ -113,8 +130,16 @@ container_build() {
|
|
|
113
130
|
exit 0
|
|
114
131
|
fi
|
|
115
132
|
|
|
116
|
-
apt-get
|
|
117
|
-
|
|
133
|
+
if command -v apt-get; then
|
|
134
|
+
apt-get update
|
|
135
|
+
apt-get -y dist-upgrade
|
|
136
|
+
elif command -v apk; then
|
|
137
|
+
apk upgrade --no-cache
|
|
138
|
+
else
|
|
139
|
+
echo 'unsupported package manager' >&2
|
|
140
|
+
exit 1
|
|
141
|
+
fi
|
|
142
|
+
|
|
118
143
|
rustup update
|
|
119
144
|
|
|
120
145
|
touch \"\$UPDATED_FILE\"
|
|
@@ -136,5 +161,7 @@ container_build() {
|
|
|
136
161
|
[[ -n "$NO_HALT" ]] || "$container_tool" container stop "$container_name"
|
|
137
162
|
}
|
|
138
163
|
|
|
139
|
-
|
|
140
|
-
container_build linux-x86_64 rust:
|
|
164
|
+
container_build linux-x86_64-gnu rust:slim-bullseye linux/amd64
|
|
165
|
+
container_build linux-x86_64-musl rust:alpine linux/amd64
|
|
166
|
+
container_build linux-aarch64-gnu rust:slim-bookworm linux/arm64
|
|
167
|
+
container_build linux-aarch64-musl rust:alpine linux/arm64
|
|
@@ -39,13 +39,19 @@ describe ImageOptim::Pack do
|
|
|
39
39
|
|
|
40
40
|
describe :os do
|
|
41
41
|
it 'returns last but one part of path' do
|
|
42
|
-
expect(Path.new('path/futureos-
|
|
42
|
+
expect(Path.new('path/futureos-K_qbit-foo-bar')).to have_attributes(os: 'futureos')
|
|
43
43
|
end
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
describe :arch do
|
|
47
47
|
it 'returns last but one part of path' do
|
|
48
|
-
expect(Path.new('path/futureos-
|
|
48
|
+
expect(Path.new('path/futureos-K_qbit-foo-bar')).to have_attributes(arch: 'K_qbit')
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
describe :version do
|
|
53
|
+
it 'returns last but one part of path' do
|
|
54
|
+
expect(Path.new('path/futureos-K_qbit-foo-bar')).to have_attributes(version: 'foo-bar')
|
|
49
55
|
end
|
|
50
56
|
end
|
|
51
57
|
|
|
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
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: image_optim_pack
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.13.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ivan Kuchin
|
|
@@ -140,7 +140,10 @@ files:
|
|
|
140
140
|
- checksums.mk
|
|
141
141
|
- image_optim_pack-darwin-arm64.gemspec
|
|
142
142
|
- image_optim_pack-darwin-x86_64.gemspec
|
|
143
|
-
- image_optim_pack-linux-
|
|
143
|
+
- image_optim_pack-linux-aarch64-gnu.gemspec
|
|
144
|
+
- image_optim_pack-linux-aarch64-musl.gemspec
|
|
145
|
+
- image_optim_pack-linux-x86_64-gnu.gemspec
|
|
146
|
+
- image_optim_pack-linux-x86_64-musl.gemspec
|
|
144
147
|
- image_optim_pack.gemspec
|
|
145
148
|
- lib/image_optim/pack.rb
|
|
146
149
|
- lib/image_optim_pack.rb
|
|
@@ -182,28 +185,73 @@ files:
|
|
|
182
185
|
- vendor/darwin-x86_64/pngcrush
|
|
183
186
|
- vendor/darwin-x86_64/pngout
|
|
184
187
|
- vendor/darwin-x86_64/pngquant
|
|
185
|
-
- vendor/linux-
|
|
186
|
-
- vendor/linux-
|
|
187
|
-
- vendor/linux-
|
|
188
|
-
- vendor/linux-
|
|
189
|
-
- vendor/linux-
|
|
190
|
-
- vendor/linux-
|
|
191
|
-
- vendor/linux-
|
|
192
|
-
- vendor/linux-
|
|
193
|
-
- vendor/linux-
|
|
194
|
-
- vendor/linux-
|
|
195
|
-
- vendor/linux-
|
|
196
|
-
- vendor/linux-
|
|
197
|
-
- vendor/linux-
|
|
198
|
-
- vendor/linux-
|
|
199
|
-
- vendor/linux-
|
|
188
|
+
- vendor/linux-aarch64-gnu/advpng
|
|
189
|
+
- vendor/linux-aarch64-gnu/gifsicle
|
|
190
|
+
- vendor/linux-aarch64-gnu/jhead
|
|
191
|
+
- vendor/linux-aarch64-gnu/jpeg-recompress
|
|
192
|
+
- vendor/linux-aarch64-gnu/jpegoptim
|
|
193
|
+
- vendor/linux-aarch64-gnu/jpegtran
|
|
194
|
+
- vendor/linux-aarch64-gnu/libjpeg.so
|
|
195
|
+
- vendor/linux-aarch64-gnu/liblcms2.so
|
|
196
|
+
- vendor/linux-aarch64-gnu/libpng.so
|
|
197
|
+
- vendor/linux-aarch64-gnu/libz.so
|
|
198
|
+
- vendor/linux-aarch64-gnu/optipng
|
|
199
|
+
- vendor/linux-aarch64-gnu/oxipng
|
|
200
|
+
- vendor/linux-aarch64-gnu/pngcrush
|
|
201
|
+
- vendor/linux-aarch64-gnu/pngout
|
|
202
|
+
- vendor/linux-aarch64-gnu/pngquant
|
|
203
|
+
- vendor/linux-aarch64-musl/advpng
|
|
204
|
+
- vendor/linux-aarch64-musl/gifsicle
|
|
205
|
+
- vendor/linux-aarch64-musl/jhead
|
|
206
|
+
- vendor/linux-aarch64-musl/jpeg-recompress
|
|
207
|
+
- vendor/linux-aarch64-musl/jpegoptim
|
|
208
|
+
- vendor/linux-aarch64-musl/jpegtran
|
|
209
|
+
- vendor/linux-aarch64-musl/libjpeg.so
|
|
210
|
+
- vendor/linux-aarch64-musl/liblcms2.so
|
|
211
|
+
- vendor/linux-aarch64-musl/libpng.so
|
|
212
|
+
- vendor/linux-aarch64-musl/libz.so
|
|
213
|
+
- vendor/linux-aarch64-musl/optipng
|
|
214
|
+
- vendor/linux-aarch64-musl/oxipng
|
|
215
|
+
- vendor/linux-aarch64-musl/pngcrush
|
|
216
|
+
- vendor/linux-aarch64-musl/pngout
|
|
217
|
+
- vendor/linux-aarch64-musl/pngquant
|
|
218
|
+
- vendor/linux-x86_64-gnu/advpng
|
|
219
|
+
- vendor/linux-x86_64-gnu/gifsicle
|
|
220
|
+
- vendor/linux-x86_64-gnu/jhead
|
|
221
|
+
- vendor/linux-x86_64-gnu/jpeg-recompress
|
|
222
|
+
- vendor/linux-x86_64-gnu/jpegoptim
|
|
223
|
+
- vendor/linux-x86_64-gnu/jpegtran
|
|
224
|
+
- vendor/linux-x86_64-gnu/libjpeg.so
|
|
225
|
+
- vendor/linux-x86_64-gnu/liblcms2.so
|
|
226
|
+
- vendor/linux-x86_64-gnu/libpng.so
|
|
227
|
+
- vendor/linux-x86_64-gnu/libz.so
|
|
228
|
+
- vendor/linux-x86_64-gnu/optipng
|
|
229
|
+
- vendor/linux-x86_64-gnu/oxipng
|
|
230
|
+
- vendor/linux-x86_64-gnu/pngcrush
|
|
231
|
+
- vendor/linux-x86_64-gnu/pngout
|
|
232
|
+
- vendor/linux-x86_64-gnu/pngquant
|
|
233
|
+
- vendor/linux-x86_64-musl/advpng
|
|
234
|
+
- vendor/linux-x86_64-musl/gifsicle
|
|
235
|
+
- vendor/linux-x86_64-musl/jhead
|
|
236
|
+
- vendor/linux-x86_64-musl/jpeg-recompress
|
|
237
|
+
- vendor/linux-x86_64-musl/jpegoptim
|
|
238
|
+
- vendor/linux-x86_64-musl/jpegtran
|
|
239
|
+
- vendor/linux-x86_64-musl/libjpeg.so
|
|
240
|
+
- vendor/linux-x86_64-musl/liblcms2.so
|
|
241
|
+
- vendor/linux-x86_64-musl/libpng.so
|
|
242
|
+
- vendor/linux-x86_64-musl/libz.so
|
|
243
|
+
- vendor/linux-x86_64-musl/optipng
|
|
244
|
+
- vendor/linux-x86_64-musl/oxipng
|
|
245
|
+
- vendor/linux-x86_64-musl/pngcrush
|
|
246
|
+
- vendor/linux-x86_64-musl/pngout
|
|
247
|
+
- vendor/linux-x86_64-musl/pngquant
|
|
200
248
|
homepage: https://github.com/toy/image_optim_pack
|
|
201
249
|
licenses:
|
|
202
250
|
- MIT
|
|
203
251
|
metadata:
|
|
204
252
|
bug_tracker_uri: https://github.com/toy/image_optim_pack/issues
|
|
205
253
|
changelog_uri: https://github.com/toy/image_optim_pack/blob/master/CHANGELOG.markdown
|
|
206
|
-
documentation_uri: https://www.rubydoc.info/gems/image_optim_pack/0.
|
|
254
|
+
documentation_uri: https://www.rubydoc.info/gems/image_optim_pack/0.13.0
|
|
207
255
|
source_code_uri: https://github.com/toy/image_optim_pack
|
|
208
256
|
rdoc_options: []
|
|
209
257
|
require_paths:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|