Skip to content

Commit

Permalink
Add infrastructure to re-publish release tarballs as npm packages
Browse files Browse the repository at this point in the history
  • Loading branch information
lovell committed Nov 4, 2023
1 parent 061bcf4 commit c74b5ff
Show file tree
Hide file tree
Showing 15 changed files with 535 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ libvips*
*.log
deps/
target/
npm/*/*
!npm/*/package.json
npm/img-sharp-libvips-*.tgz
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@
libvips and its dependencies are provided as pre-compiled shared libraries
for the most common operating systems and CPU architectures.

During `npm install`, these binaries are fetched as tarballs from
this repository via HTTPS and stored locally within `node_modules/sharp/vendor`.

The base URL can be overridden using the
`npm_config_sharp_libvips_binary_host` environment variable.

https://sharp.pixelplumbing.com/install#custom-prebuilt-binaries
These are [packaged](npm) and published to the npm registry under the
[@img](https://www.npmjs.com/org/img) organisation.

## Creating a tarball

Expand Down
42 changes: 42 additions & 0 deletions npm/darwin-arm64/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "@img/sharp-libvips-darwin-arm64",
"version": "0.0.3",
"description": "Prebuilt libvips and dependencies for use with sharp on macOS 64-bit ARM",
"author": "Lovell Fuller <[email protected]>",
"homepage": "https://sharp.pixelplumbing.com",
"repository": {
"type": "git",
"url": "git+https://github.com/lovell/sharp-libvips.git",
"directory": "npm/darwin-arm64"
},
"license": "LGPL-3.0-or-later",
"funding": {
"url": "https://opencollective.com/libvips"
},
"preferUnplugged": true,
"publishConfig": {
"access": "public"
},
"files": [
"lib",
"versions.json"
],
"type": "commonjs",
"exports": {
"./lib": "./lib/index.js",
"./package": "./package.json",
"./versions": "./versions.json"
},
"engines": {
"npm": ">=9.6.5",
"yarn": ">=3.2.0",
"pnpm": ">=7.1.0",
"macos": ">=11"
},
"os": [
"darwin"
],
"cpu": [
"arm64"
]
}
42 changes: 42 additions & 0 deletions npm/darwin-x64/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "@img/sharp-libvips-darwin-x64",
"version": "0.0.3",
"description": "Prebuilt libvips and dependencies for use with sharp on macOS x64",
"author": "Lovell Fuller <[email protected]>",
"homepage": "https://sharp.pixelplumbing.com",
"repository": {
"type": "git",
"url": "git+https://github.com/lovell/sharp-libvips.git",
"directory": "npm/darwin-x64"
},
"license": "LGPL-3.0-or-later",
"funding": {
"url": "https://opencollective.com/libvips"
},
"preferUnplugged": true,
"publishConfig": {
"access": "public"
},
"files": [
"lib",
"versions.json"
],
"type": "commonjs",
"exports": {
"./lib": "./lib/index.js",
"./package": "./package.json",
"./versions": "./versions.json"
},
"engines": {
"npm": ">=9.6.5",
"yarn": ">=3.2.0",
"pnpm": ">=7.1.0",
"macos": ">=10.13"
},
"os": [
"darwin"
],
"cpu": [
"x64"
]
}
30 changes: 30 additions & 0 deletions npm/dev/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "@img/sharp-libvips-dev",
"version": "0.0.3",
"description": "Header files and C++ sources for libvips and dependencies required when compiling sharp from source",
"author": "Lovell Fuller <[email protected]>",
"homepage": "https://sharp.pixelplumbing.com",
"repository": {
"type": "git",
"url": "git+https://github.com/lovell/sharp-libvips.git",
"directory": "npm/dev"
},
"license": "LGPL-3.0-or-later",
"funding": {
"url": "https://opencollective.com/libvips"
},
"preferUnplugged": true,
"publishConfig": {
"access": "public"
},
"files": [
"include",
"cplusplus",
"versions.json"
],
"type": "commonjs",
"exports": {
"./include": "./include/index.js",
"./cplusplus": "./cplusplus/index.js"
}
}
45 changes: 45 additions & 0 deletions npm/linux-arm/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "@img/sharp-libvips-linux-arm",
"version": "0.0.3",
"description": "Prebuilt libvips and dependencies for use with sharp on Linux (glibc) 32-bit ARM",
"author": "Lovell Fuller <[email protected]>",
"homepage": "https://sharp.pixelplumbing.com",
"repository": {
"type": "git",
"url": "git+https://github.com/lovell/sharp-libvips.git",
"directory": "npm/linux-arm"
},
"license": "LGPL-3.0-or-later",
"funding": {
"url": "https://opencollective.com/libvips"
},
"preferUnplugged": true,
"publishConfig": {
"access": "public"
},
"files": [
"lib",
"versions.json"
],
"exports": {
"./lib": "./lib/index.js",
"./package": "./package.json",
"./versions": "./versions.json"
},
"type": "commonjs",
"engines": {
"npm": ">=9.6.5",
"yarn": ">=3.2.0",
"pnpm": ">=7.1.0",
"glibc": ">=2.28"
},
"os": [
"linux"
],
"libc": [
"glibc"
],
"cpu": [
"arm"
]
}
45 changes: 45 additions & 0 deletions npm/linux-arm64/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "@img/sharp-libvips-linux-arm64",
"version": "0.0.3",
"description": "Prebuilt libvips and dependencies for use with sharp on Linux (glibc) 64-bit ARM",
"author": "Lovell Fuller <[email protected]>",
"homepage": "https://sharp.pixelplumbing.com",
"repository": {
"type": "git",
"url": "git+https://github.com/lovell/sharp-libvips.git",
"directory": "npm/linux-arm64"
},
"license": "LGPL-3.0-or-later",
"funding": {
"url": "https://opencollective.com/libvips"
},
"preferUnplugged": true,
"publishConfig": {
"access": "public"
},
"files": [
"lib",
"versions.json"
],
"type": "commonjs",
"exports": {
"./lib": "./lib/index.js",
"./package": "./package.json",
"./versions": "./versions.json"
},
"engines": {
"npm": ">=9.6.5",
"yarn": ">=3.2.0",
"pnpm": ">=7.1.0",
"glibc": ">=2.26"
},
"os": [
"linux"
],
"libc": [
"glibc"
],
"cpu": [
"arm64"
]
}
45 changes: 45 additions & 0 deletions npm/linux-s390x/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "@img/sharp-libvips-linux-s390x",
"version": "0.0.3",
"description": "Prebuilt libvips and dependencies for use with sharp on Linux (glibc) s390x",
"author": "Lovell Fuller <[email protected]>",
"homepage": "https://sharp.pixelplumbing.com",
"repository": {
"type": "git",
"url": "git+https://github.com/lovell/sharp-libvips.git",
"directory": "npm/linux-s390x"
},
"license": "LGPL-3.0-or-later",
"funding": {
"url": "https://opencollective.com/libvips"
},
"preferUnplugged": true,
"publishConfig": {
"access": "public"
},
"files": [
"lib",
"versions.json"
],
"exports": {
"./lib": "./lib/index.js",
"./package": "./package.json",
"./versions": "./versions.json"
},
"type": "commonjs",
"engines": {
"npm": ">=9.6.5",
"yarn": ">=3.2.0",
"pnpm": ">=7.1.0",
"glibc": ">=2.28"
},
"os": [
"linux"
],
"libc": [
"glibc"
],
"cpu": [
"s390x"
]
}
45 changes: 45 additions & 0 deletions npm/linux-x64/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "@img/sharp-libvips-linux-x64",
"version": "0.0.3",
"description": "Prebuilt libvips and dependencies for use with sharp on Linux (glibc) x64",
"author": "Lovell Fuller <[email protected]>",
"homepage": "https://sharp.pixelplumbing.com",
"repository": {
"type": "git",
"url": "git+https://github.com/lovell/sharp-libvips.git",
"directory": "npm/linux-x64"
},
"license": "LGPL-3.0-or-later",
"funding": {
"url": "https://opencollective.com/libvips"
},
"preferUnplugged": true,
"publishConfig": {
"access": "public"
},
"files": [
"lib",
"versions.json"
],
"type": "commonjs",
"exports": {
"./lib": "./lib/index.js",
"./package": "./package.json",
"./versions": "./versions.json"
},
"engines": {
"npm": ">=9.6.5",
"yarn": ">=3.2.0",
"pnpm": ">=7.1.0",
"glibc": ">=2.26"
},
"os": [
"linux"
],
"libc": [
"glibc"
],
"cpu": [
"x64"
]
}
45 changes: 45 additions & 0 deletions npm/linuxmusl-arm64/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "@img/sharp-libvips-linuxmusl-arm64",
"version": "0.0.3",
"description": "Prebuilt libvips and dependencies for use with sharp on Linux (musl) 64-bit ARM",
"author": "Lovell Fuller <[email protected]>",
"homepage": "https://sharp.pixelplumbing.com",
"repository": {
"type": "git",
"url": "git+https://github.com/lovell/sharp-libvips.git",
"directory": "npm/linuxmusl-arm64"
},
"license": "LGPL-3.0-or-later",
"funding": {
"url": "https://opencollective.com/libvips"
},
"preferUnplugged": true,
"publishConfig": {
"access": "public"
},
"files": [
"lib",
"versions.json"
],
"type": "commonjs",
"exports": {
"./lib": "./lib/index.js",
"./package": "./package.json",
"./versions": "./versions.json"
},
"engines": {
"npm": ">=9.6.5",
"yarn": ">=3.2.0",
"pnpm": ">=7.1.0",
"musl": ">=1.2.2"
},
"os": [
"linux"
],
"libc": [
"musl"
],
"cpu": [
"arm64"
]
}
Loading

0 comments on commit c74b5ff

Please sign in to comment.