diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8050f87..80ecb45c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -172,34 +172,41 @@ 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: bullseye - run_on_arch: s390x + base_image: "--platform=linux/s390x s390x/debian:bullseye" nodejs_arch: s390x nodejs_hostname: nodejs.org nodejs_version: "18.17.0" nodejs_version_major: 18 - platform: linux-ppc64 - distro: bullseye - run_on_arch: ppc64le + base_image: "--platform=linux/ppc64le ppc64le/debian:bullseye" 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.16.0" + 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: | prebuild_upload: "${{ startsWith(github.ref, 'refs/tags/') && secrets.GITHUB_TOKEN || '' }}" + 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.md b/docs/src/content/docs/changelog.md index 191a0a72..95d81039 100644 --- a/docs/src/content/docs/changelog.md +++ b/docs/src/content/docs/changelog.md @@ -10,6 +10,8 @@ Requires libvips v8.17.0 * Upgrade to libvips v8.17.0 for upstream bug fixes. +* Add experimental support for prebuilt Linux RISC-V 64-bit binaries. + * Support composite operation with non-sRGB pipeline colourspace. [#4412](https://github.com/lovell/sharp/pull/4412) [@kleisauke](https://github.com/kleisauke) diff --git a/docs/src/content/docs/install.md b/docs/src/content/docs/install.md index 69d1c106..985a7549 100644 --- a/docs/src/content/docs/install.md +++ b/docs/src/content/docs/install.md @@ -48,6 +48,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.31) * Linux s390x (glibc >= 2.31) * Linux x64 (glibc >= 2.26, musl >= 1.2.2, CPU with SSE4.2) diff --git a/lib/libvips.js b/lib/libvips.js index 1bab0ca5..283b0fa5 100644 --- a/lib/libvips.js +++ b/lib/libvips.js @@ -18,7 +18,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..225a2c3a --- /dev/null +++ b/npm/linux-riscv64/package.json @@ -0,0 +1,46 @@ +{ + "name": "@img/sharp-linux-riscv64", + "version": "0.34.2", + "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.0-rc.2" + }, + "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 93100990..979738ca 100644 --- a/package.json +++ b/package.json @@ -149,13 +149,16 @@ "@img/sharp-libvips-linux-arm": "1.2.0-rc.2", "@img/sharp-libvips-linux-arm64": "1.2.0-rc.2", "@img/sharp-libvips-linux-ppc64": "1.2.0-rc.2", + "@img/sharp-libvips-linux-riscv64": "1.2.0-rc.2", "@img/sharp-libvips-linux-s390x": "1.2.0-rc.2", "@img/sharp-libvips-linux-x64": "1.2.0-rc.2", "@img/sharp-libvips-linuxmusl-arm64": "1.2.0-rc.2", "@img/sharp-libvips-linuxmusl-x64": "1.2.0-rc.2", "@img/sharp-linux-arm": "0.34.2", "@img/sharp-linux-arm64": "0.34.2", + "@img/sharp-linux-ppc64": "0.34.2", "@img/sharp-linux-s390x": "0.34.2", + "@img/sharp-linux-riscv64": "0.34.2", "@img/sharp-linux-x64": "0.34.2", "@img/sharp-linuxmusl-arm64": "0.34.2", "@img/sharp-linuxmusl-x64": "0.34.2",