diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0211806d..b337e0bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -235,32 +235,40 @@ jobs: matrix: include: - platform: linux-arm - distro: bullseye - run_on_arch: armv6 + base_image: "balenalib/rpi-raspbian:bullseye" nodejs_arch: armv6l nodejs_hostname: unofficial-builds.nodejs.org nodejs_version: "18.17.0" nodejs_version_major: 18 - platform: linux-s390x - distro: bookworm - run_on_arch: s390x + base_image: "--platform=linux/s390x s390x/debian:bookworm" nodejs_arch: s390x nodejs_hostname: nodejs.org nodejs_version: "18.17.0" nodejs_version_major: 18 - platform: linux-ppc64 - distro: bookworm - run_on_arch: ppc64le + base_image: "--platform=linux/ppc64le ppc64le/debian:bookworm" nodejs_arch: ppc64le nodejs_hostname: nodejs.org nodejs_version: "18.17.0" nodejs_version_major: 18 + - platform: linux-riscv64 + base_image: "--platform=linux/riscv64 riscv64/debian:trixie" + compiler_flags: "-march=rv64gc" + nodejs_arch: riscv64 + nodejs_hostname: unofficial-builds.nodejs.org + nodejs_version: "20.19.5" + nodejs_version_major: 20 steps: - uses: actions/checkout@v4 - uses: uraimo/run-on-arch-action@v3 with: - arch: ${{ matrix.run_on_arch }} - distro: ${{ matrix.distro }} + arch: none + distro: none + base_image: ${{ matrix.base_image }} + env: | + CFLAGS: "${{ matrix.compiler_flags }}" + CXXFLAGS: "${{ matrix.compiler_flags }}" run: | apt-get update apt-get install -y curl g++ git libatomic1 make python3 xz-utils diff --git a/docs/src/content/docs/changelog/v0.34.5.md b/docs/src/content/docs/changelog/v0.34.5.md index 886932b8..0c4a936a 100644 --- a/docs/src/content/docs/changelog/v0.34.5.md +++ b/docs/src/content/docs/changelog/v0.34.5.md @@ -3,6 +3,8 @@ title: v0.34.5 - TBD slug: changelog/v0.34.5 --- +* Add experimental support for prebuilt Linux RISC-V 64-bit binaries. + * Support building from source with npm v12+, deprecate `--build-from-source` flag. [#4458](https://github.com/lovell/sharp/issues/4458) diff --git a/docs/src/content/docs/install.md b/docs/src/content/docs/install.md index d74d47a2..083db5cc 100644 --- a/docs/src/content/docs/install.md +++ b/docs/src/content/docs/install.md @@ -49,6 +49,7 @@ Ready-compiled sharp and libvips binaries are provided for use on the most commo * macOS ARM64 * Linux ARM (glibc >= 2.31) * Linux ARM64 (glibc >= 2.26, musl >= 1.2.2) +* Linux RISC-V 64-bit (glibc >= 2.41) * Linux ppc64 (glibc >= 2.36) * Linux s390x (glibc >= 2.36) * Linux x64 (glibc >= 2.26, musl >= 1.2.2, CPU with SSE4.2) diff --git a/lib/libvips.js b/lib/libvips.js index 9c2917fc..dba1ab45 100644 --- a/lib/libvips.js +++ b/lib/libvips.js @@ -16,7 +16,7 @@ const minimumLibvipsVersion = semverCoerce(minimumLibvipsVersionLabelled).versio const prebuiltPlatforms = [ 'darwin-arm64', 'darwin-x64', - 'linux-arm', 'linux-arm64', 'linux-ppc64', 'linux-s390x', 'linux-x64', + 'linux-arm', 'linux-arm64', 'linux-ppc64', 'linux-riscv64', 'linux-s390x', 'linux-x64', 'linuxmusl-arm64', 'linuxmusl-x64', 'win32-arm64', 'win32-ia32', 'win32-x64' ]; diff --git a/npm/linux-riscv64/package.json b/npm/linux-riscv64/package.json new file mode 100644 index 00000000..dc367735 --- /dev/null +++ b/npm/linux-riscv64/package.json @@ -0,0 +1,46 @@ +{ + "name": "@img/sharp-linux-riscv64", + "version": "0.34.4", + "description": "Prebuilt sharp for use with Linux (glibc) RISC-V 64-bit", + "author": "Lovell Fuller ", + "homepage": "https://sharp.pixelplumbing.com", + "repository": { + "type": "git", + "url": "git+https://github.com/lovell/sharp.git", + "directory": "npm/linux-riscv64" + }, + "license": "Apache-2.0", + "funding": { + "url": "https://opencollective.com/libvips" + }, + "preferUnplugged": true, + "optionalDependencies": { + "@img/sharp-libvips-linux-riscv64": "1.2.3" + }, + "files": [ + "lib" + ], + "publishConfig": { + "access": "public" + }, + "type": "commonjs", + "exports": { + "./sharp.node": "./lib/sharp-linux-riscv64.node", + "./package": "./package.json" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "config": { + "glibc": ">=2.41" + }, + "os": [ + "linux" + ], + "libc": [ + "glibc" + ], + "cpu": [ + "riscv64" + ] +} diff --git a/package.json b/package.json index 0c3caf45..3f00bc09 100644 --- a/package.json +++ b/package.json @@ -151,6 +151,7 @@ "@img/sharp-libvips-linux-arm": "1.2.3", "@img/sharp-libvips-linux-arm64": "1.2.3", "@img/sharp-libvips-linux-ppc64": "1.2.3", + "@img/sharp-libvips-linux-riscv64": "1.2.3", "@img/sharp-libvips-linux-s390x": "1.2.3", "@img/sharp-libvips-linux-x64": "1.2.3", "@img/sharp-libvips-linuxmusl-arm64": "1.2.3", @@ -158,6 +159,7 @@ "@img/sharp-linux-arm": "0.34.4", "@img/sharp-linux-arm64": "0.34.4", "@img/sharp-linux-ppc64": "0.34.4", + "@img/sharp-linux-riscv64": "0.34.4", "@img/sharp-linux-s390x": "0.34.4", "@img/sharp-linux-x64": "0.34.4", "@img/sharp-linuxmusl-arm64": "0.34.4",