Skip to content

Commit 1d9fc8c

Browse files
Doy-leeBilb
authored andcommitted
Add SSE2-only linux-x64 build
1 parent 750995e commit 1d9fc8c

File tree

13 files changed

+94
-122
lines changed

13 files changed

+94
-122
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ jobs:
3030
include:
3131
- os: "ubuntu-24.04"
3232
platform: "linux-x64"
33-
# FIXME enable this back
3433
- os: "ubuntu-24.04"
35-
platform: "linux-armv6"
34+
platform: "linux-sse2-x64"
3635
- os: "ubuntu-24.04"
3736
platform: "win32-x64"
3837
- os: "macos-15-intel"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ One [build script](build/posix.sh) is used to (cross-)compile
1818
the same shared libraries within multiple containers.
1919

2020
- [x64 glibc](platforms/linux-x64/Dockerfile)
21-
- [ARMv6 glibc](platforms/linux-armv6/Dockerfile)
21+
- [x64 sse2 glibc](platforms/linux-sse2-x64/Dockerfile)
2222
- [ARM64v8-A glibc](platforms/linux-arm64v8/Dockerfile)
2323

2424
### Windows

build.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if [ $# -lt 1 ]; then
1212
echo "Possible values for PLATFORM are:"
1313
echo "- win32-x64"
1414
echo "- linux-x64"
15-
echo "- linux-armv6"
15+
echo "- linux-sse2-x64"
1616
echo "- linux-arm64v8"
1717
echo "- darwin-x64"
1818
echo "- darwin-arm64v8"
@@ -75,8 +75,8 @@ for flavour in win32-x64; do
7575
fi
7676
done
7777

78-
# Linux (x64, ARMv6, ARM64v8)
79-
for flavour in linux-x64 linux-armv6 linux-arm64v8; do
78+
# Linux (x64, x64 with sse2, ARM64v8)
79+
for flavour in linux-x64 linux-sse2-x64 linux-arm64v8; do
8080
if [ $PLATFORM = "all" ] || [ $PLATFORM = $flavour ]; then
8181
echo "Building $flavour..."
8282
docker build --pull -t vips-dev-$flavour platforms/$flavour
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"name": "@img/sharp-libvips-linux-arm",
2+
"name": "@img/sharp-libvips-linux-sse2-x64",
33
"version": "1.2.7",
4-
"description": "Prebuilt libvips and dependencies for use with sharp on Linux (glibc) 32-bit ARM",
4+
"description": "Prebuilt libvips and dependencies for use with sharp on Linux (glibc) x64 (SSE2 build)",
55
"author": "Lovell Fuller <npm@lovell.info>",
66
"homepage": "https://sharp.pixelplumbing.com",
77
"repository": {
88
"type": "git",
99
"url": "git+https://github.com/lovell/sharp-libvips.git",
10-
"directory": "npm/linux-arm"
10+
"directory": "npm/linux-x64"
1111
},
1212
"license": "LGPL-3.0-or-later",
1313
"funding": {
@@ -21,14 +21,14 @@
2121
"lib",
2222
"versions.json"
2323
],
24+
"type": "commonjs",
2425
"exports": {
2526
"./lib": "./lib/index.js",
2627
"./package": "./package.json",
2728
"./versions": "./versions.json"
2829
},
29-
"type": "commonjs",
3030
"config": {
31-
"glibc": ">=2.31"
31+
"glibc": ">=2.26"
3232
},
3333
"os": [
3434
"linux"
@@ -37,6 +37,6 @@
3737
"glibc"
3838
],
3939
"cpu": [
40-
"arm"
40+
"x64"
4141
]
4242
}

npm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"dev",
77
"darwin-x64",
88
"darwin-arm64",
9-
"linux-arm",
109
"linux-arm64",
1110
"linux-x64",
11+
"linux-sse2-x64",
1212
"win32-x64"
1313
]
1414
}

package-npm-packages.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@ npm pack --workspaces --pack-destination=${GITHUB_WORKSPACE}/dist
1111
ls -la ${GITHUB_WORKSPACE}/dist
1212
pwd
1313

14-
cd ../
1514
npm pack --pack-destination=${GITHUB_WORKSPACE}/dist

platforms/linux-armv6/Dockerfile

Lines changed: 0 additions & 57 deletions
This file was deleted.

platforms/linux-armv6/Toolchain.cmake

Lines changed: 0 additions & 15 deletions
This file was deleted.

platforms/linux-armv6/meson.ini

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
FROM amazonlinux:2
2+
LABEL maintainer="Lovell Fuller <npm@lovell.info>"
3+
4+
# Create Amazon Linux 2 (glibc 2.26) container suitable for building Linux x64 binaries
5+
6+
# Path settings
7+
ENV \
8+
RUSTUP_HOME="/usr/local/rustup" \
9+
CARGO_HOME="/usr/local/cargo" \
10+
PATH="/usr/local/cargo/bin:$PATH"
11+
12+
# Build dependencies
13+
RUN \
14+
yum update -y && \
15+
amazon-linux-extras install epel -y && \
16+
yum install -y --setopt=tsflags=nodocs \
17+
--exclude=gcc \
18+
autoconf \
19+
automake \
20+
bzip2 \
21+
cmake3 \
22+
curl \
23+
gcc10 \
24+
gcc10-binutils \
25+
gcc10-c++ \
26+
gettext \
27+
git \
28+
gperf \
29+
jq \
30+
make \
31+
nasm \
32+
openssl-devel \
33+
patch \
34+
pkgconfig \
35+
python3 \
36+
tar \
37+
xz \
38+
&& \
39+
ln -s /usr/bin/gcc10-gcc /usr/bin/cc && \
40+
ln -s /usr/bin/gcc10-g++ /usr/bin/c++ && \
41+
ln -s /usr/bin/gcc10-ar /usr/bin/ar && \
42+
ln -s /usr/bin/gcc10-nm /usr/bin/nm && \
43+
ln -s /usr/bin/gcc10-ld.bfd /usr/bin/ld && \
44+
ln -s /usr/bin/gcc10-strip /usr/bin/strip && \
45+
ln -s /usr/bin/gcc10-ranlib /usr/bin/ranlib && \
46+
ln -s /usr/bin/gcc10-readelf /usr/bin/readelf && \
47+
ln -sf /usr/bin/gcc10-ld.bfd /usr/bin/gcc10-ld && \
48+
rm /usr/bin/gcc10-ld.gold && \
49+
curl https://sh.rustup.rs -sSf | sh -s -- -y \
50+
--no-modify-path \
51+
--profile minimal \
52+
--default-toolchain nightly \
53+
&& \
54+
cargo install cargo-c --locked && \
55+
ln -s /usr/bin/cmake3 /usr/bin/cmake && \
56+
pip3 install meson ninja tomli
57+
58+
# Compiler settings
59+
ENV \
60+
PKG_CONFIG="pkg-config --static" \
61+
PLATFORM="linux-sse2-x64" \
62+
FLAGS="-march=x86-64" \
63+
RUSTFLAGS="-Zlocation-detail=none -Zfmt-debug=none" \
64+
MESON="--cross-file=/root/meson.ini"
65+
66+
COPY Toolchain.cmake /root/
67+
COPY meson.ini /root/

0 commit comments

Comments
 (0)