From 3f3b2e62a999b8ecfb57034be016f8079988e96a Mon Sep 17 00:00:00 2001 From: Zach Bjornson Date: Wed, 19 Jun 2024 14:14:23 -0700 Subject: [PATCH] rm prebuild files from master branch Prebuilds are built using the prebuilds branch. These files are unused and confusing. --- .github/workflows/prebuild.yaml | 233 +------------------------------- prebuild/Linux/Dockerfile | 43 ------ prebuild/Linux/binding.gyp | 53 -------- prebuild/Linux/bundle.sh | 5 - prebuild/Linux/preinstall.sh | 8 -- prebuild/Windows/binding.gyp | 79 ----------- prebuild/Windows/bundle.sh | 23 ---- prebuild/Windows/preinstall.sh | 38 ------ prebuild/macOS/binding.gyp | 51 ------- prebuild/macOS/bundle.sh | 4 - prebuild/macOS/preinstall.sh | 4 - prebuild/tarball.sh | 18 --- 12 files changed, 5 insertions(+), 554 deletions(-) delete mode 100644 prebuild/Linux/Dockerfile delete mode 100644 prebuild/Linux/binding.gyp delete mode 100644 prebuild/Linux/bundle.sh delete mode 100644 prebuild/Linux/preinstall.sh delete mode 100644 prebuild/Windows/binding.gyp delete mode 100644 prebuild/Windows/bundle.sh delete mode 100644 prebuild/Windows/preinstall.sh delete mode 100644 prebuild/macOS/binding.gyp delete mode 100644 prebuild/macOS/bundle.sh delete mode 100644 prebuild/macOS/preinstall.sh delete mode 100644 prebuild/tarball.sh diff --git a/.github/workflows/prebuild.yaml b/.github/workflows/prebuild.yaml index 036e115e3..88b6288bf 100644 --- a/.github/workflows/prebuild.yaml +++ b/.github/workflows/prebuild.yaml @@ -1,236 +1,13 @@ -# Triggering prebuilds: -# 1. Create a draft release manually using the GitHub UI. -# 2. Set the `jobs.*.strategy.matrix.node` arrays to the set of Node.js versions -# to build for. -# 3. Set the `jobs.*.strategy.matrix.canvas_tag` arrays to the set of Canvas -# tags to build. (Usually this is a single tag, but can be an array when a -# new version of Node.js is released and older versions of Canvas need to be -# built.) -# 4. Commit and push this file to master. -# 5. In the Actions tab, navigate to the "Make Prebuilds" workflow and click -# "Run workflow". -# 6. Once the builds succeed, promote the draft release to a full release. +# This is a dummy file so that this workflow shows up in the Actions tab. +# Prebuilds are actually run using the prebuilds branch. name: Make Prebuilds on: workflow_dispatch -# UPLOAD_TO can be specified to upload the release assets under a different tag -# name (e.g. for testing). If omitted, the assets are published under the same -# release tag as the canvas version being built. -# env: -# UPLOAD_TO: "v0.0.1" - jobs: Linux: - strategy: - matrix: - node: [18.12.0, 20.9.0] - canvas_tag: [] # e.g. "v2.6.1" - name: ${{ matrix.canvas_tag}}, Node.js ${{ matrix.node }}, Linux + name: Nothing runs-on: ubuntu-latest - container: - image: chearon/canvas-prebuilt:7 - env: - CANVAS_VERSION_TO_BUILD: ${{ matrix.canvas_tag }} - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ matrix.canvas_tag }} - - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - - - name: Build - run: | - npm install -g node-gyp - npm install --ignore-scripts - . prebuild/Linux/preinstall.sh - cp prebuild/Linux/binding.gyp binding.gyp - node-gyp rebuild -j 2 - . prebuild/Linux/bundle.sh - - - name: Test binary - run: | - cd /root/harfbuzz-* && make uninstall - cd /root/cairo-* && make uninstall - cd /root/pango-* && make uninstall - cd /root/libpng-* && make uninstall - cd /root/libjpeg-* && make uninstall - cd /root/giflib-* && make uninstall - cd $GITHUB_WORKSPACE && npm test - - - name: Make bundle - id: make_bundle - run: . prebuild/tarball.sh - - - name: Upload - uses: actions/github-script@0.9.0 - with: - script: | - const fs = require("fs"); - const assetName = "${{ steps.make_bundle.outputs.asset_name }}"; - const tagName = process.env.UPLOAD_TO || process.env.CANVAS_VERSION_TO_BUILD; - const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/"); - - const releases = await github.repos.listReleases({owner, repo}); - const release = releases.data.find(r => r.tag_name === tagName); - if (!release) - throw new Error(`Tag ${tagName} not found. Did you make the GitHub release?`); - - const oldAsset = release.assets.find(a => a.name === assetName); - if (oldAsset) - await github.repos.deleteReleaseAsset({owner, repo, asset_id: oldAsset.id}); - - // (This is equivalent to actions/upload-release-asset. We're - // already in a script, so might as well do it here.) - const r = await github.repos.uploadReleaseAsset({ - url: release.upload_url, - headers: { - "content-type": "application/x-gzip", - "content-length": `${fs.statSync(assetName).size}` - }, - name: assetName, - data: fs.readFileSync(assetName) - }); - - macOS: - strategy: - matrix: - node: [18.12.0, 20.9.0] - canvas_tag: [] # e.g. "v2.6.1" - name: ${{ matrix.canvas_tag}}, Node.js ${{ matrix.node }}, macOS - runs-on: macos-latest - env: - CANVAS_VERSION_TO_BUILD: ${{ matrix.canvas_tag }} steps: - - uses: actions/checkout@v4 - with: - ref: ${{ matrix.canvas_tag }} - - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - - - name: Build - run: | - npm install -g node-gyp - npm install --ignore-scripts - . prebuild/macOS/preinstall.sh - cp prebuild/macOS/binding.gyp binding.gyp - node-gyp rebuild -j 2 - . prebuild/macOS/bundle.sh - - - name: Test binary - run: | - brew uninstall --force cairo pango librsvg giflib harfbuzz - npm test - - - name: Make bundle - id: make_bundle - run: . prebuild/tarball.sh - - - name: Upload - uses: actions/github-script@0.9.0 - with: - script: | - const fs = require("fs"); - const assetName = "${{ steps.make_bundle.outputs.asset_name }}"; - const tagName = process.env.UPLOAD_TO || process.env.CANVAS_VERSION_TO_BUILD; - const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/"); - - const releases = await github.repos.listReleases({owner, repo}); - const release = releases.data.find(r => r.tag_name === tagName); - if (!release) - throw new Error(`Tag ${tagName} not found. Did you make the GitHub release?`); - - const oldAsset = release.assets.find(a => a.name === assetName); - if (oldAsset) - await github.repos.deleteReleaseAsset({owner, repo, asset_id: oldAsset.id}); - - // (This is equivalent to actions/upload-release-asset. We're - // already in a script, so might as well do it here.) - const r = await github.repos.uploadReleaseAsset({ - url: release.upload_url, - headers: { - "content-type": "application/x-gzip", - "content-length": `${fs.statSync(assetName).size}` - }, - name: assetName, - data: fs.readFileSync(assetName) - }); - - Win: - strategy: - matrix: - node: [18.12.0, 20.9.0] - canvas_tag: [] # e.g. "v2.6.1" - name: ${{ matrix.canvas_tag}}, Node.js ${{ matrix.node }}, Windows - runs-on: windows-latest - env: - CANVAS_VERSION_TO_BUILD: ${{ matrix.canvas_tag }} - steps: - # TODO drop when https://github.com/actions/virtual-environments/pull/632 lands - - uses: numworks/setup-msys2@v1 - with: - update: true - path-type: inherit - - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - - - uses: actions/checkout@v4 - with: - ref: ${{ matrix.canvas_tag }} - - - name: Build - run: | - npm install -g node-gyp - npm install --ignore-scripts - msys2do . prebuild/Windows/preinstall.sh - msys2do cp prebuild/Windows/binding.gyp binding.gyp - msys2do node-gyp configure - msys2do node-gyp rebuild -j 2 - - - name: Bundle - run: msys2do . prebuild/Windows/bundle.sh - - - name: Test binary - # By not running in msys2, this doesn't have access to the msys2 libs - run: npm test - - - name: Make asset - id: make_bundle - # I can't figure out why this isn't an env var already. It shows up with `env`. - run: msys2do UPLOAD_TO=${{ env.UPLOAD_TO }} CANVAS_VERSION_TO_BUILD=${{ env.CANVAS_VERSION_TO_BUILD}} . prebuild/tarball.sh - - - name: Upload - uses: actions/github-script@0.9.0 - with: - script: | - const fs = require("fs"); - const assetName = "${{ steps.make_bundle.outputs.asset_name }}"; - const tagName = process.env.UPLOAD_TO || process.env.CANVAS_VERSION_TO_BUILD; - const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/"); - - const releases = await github.repos.listReleases({owner, repo}); - const release = releases.data.find(r => r.tag_name === tagName); - if (!release) - throw new Error(`Tag ${tagName} not found. Did you make the GitHub release?`); - - const oldAsset = release.assets.find(a => a.name === assetName); - if (oldAsset) - await github.repos.deleteReleaseAsset({owner, repo, asset_id: oldAsset.id}); - - // (This is equivalent to actions/upload-release-asset. We're - // already in a script, so might as well do it here.) - const r = await github.repos.uploadReleaseAsset({ - url: release.upload_url, - headers: { - "content-type": "application/x-gzip", - "content-length": `${fs.statSync(assetName).size}` - }, - name: assetName, - data: fs.readFileSync(assetName) - }); + - name: Nothing + run: echo "Nothing to do here" diff --git a/prebuild/Linux/Dockerfile b/prebuild/Linux/Dockerfile deleted file mode 100644 index be68e5b5e..000000000 --- a/prebuild/Linux/Dockerfile +++ /dev/null @@ -1,43 +0,0 @@ -FROM debian:stretch -RUN apt-get update && apt-get -y install curl git cmake make gcc g++ nasm wget gperf bzip2 meson uuid-dev perl libxml-parser-perl - -RUN bash -c 'cd; curl -LO https://pkg-config.freedesktop.org/releases/pkg-config-0.29.2.tar.gz; tar -xvf pkg-config-0.29.2.tar.gz; cd pkg-config-0.29.2; ./configure --with-internal-glib; make; make install' -RUN bash -c 'cd; curl -O https://zlib.net/fossils/zlib-1.2.11.tar.gz; tar -xvf zlib-1.2.11.tar.gz; cd zlib-1.2.11; ./configure; make; make install' -RUN bash -c 'cd; curl -LO https://github.com/libffi/libffi/releases/download/v3.3/libffi-3.3.tar.gz; tar -xvf libffi-3.3.tar.gz; cd libffi-3.3; ./configure; make; make install' -RUN bash -c 'cd; curl -O https://www.openssl.org/source/openssl-1.1.1i.tar.gz; tar -xvf openssl-1.1.1i.tar.gz; cd openssl-1.1.1i; ./config; make; make install' -RUN ldconfig -RUN bash -c 'cd; curl -O https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tgz; tar -xvf Python-3.9.1.tgz; cd Python-3.9.1; ./configure --enable-shared --with-ensurepip=yes; make; make install' -RUN ldconfig -RUN pip3 install meson -RUN bash -c 'cd; curl -LO https://download.sourceforge.net/giflib/giflib-5.2.1.tar.gz; tar -xvf giflib-5.2.1.tar.gz; cd giflib-5.2.1; ./configure; make; make install' -RUN bash -c 'cd; curl -LO https://download.sourceforge.net/libpng/libpng-1.6.37.tar.gz; tar -xvf libpng-1.6.37.tar.gz; cd libpng-1.6.37; ./configure; make; make install' -RUN bash -c 'cd; curl -LO https://github.com/libjpeg-turbo/libjpeg-turbo/archive/2.0.6.tar.gz; tar -xvf 2.0.6.tar.gz; cd libjpeg-turbo-2.0.6; mkdir b; cd b; cmake -G"Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr/local ..; make; make install' -RUN bash -c 'cd; curl -O https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.bz2; tar -xvf pcre-8.44.tar.bz2; cd pcre-8.44; ./configure --enable-pcre16 --enable-pcre32 --enable-utf --enable-unicode-properties; make; make install ' -RUN ldconfig -RUN bash -c 'cd; curl -LO https://download.gnome.org/sources/glib/2.67/glib-2.67.1.tar.xz; tar -xvf glib-2.67.1.tar.xz; cd glib-2.67.1; meson _build; cd _build; ninja; ninja install' -RUN ldconfig -RUN bash -c 'cd; curl -LO https://download.sourceforge.net/freetype/freetype-2.10.4.tar.gz; tar -xvf freetype-2.10.4.tar.gz; cd freetype-2.10.4; ./configure; make; make install' -RUN bash -c 'cd; curl -LO https://github.com/harfbuzz/harfbuzz/releases/download/2.7.4/harfbuzz-2.7.4.tar.xz; tar -xvf harfbuzz-2.7.4.tar.xz; cd harfbuzz-2.7.4; ./configure; make; make install;' -RUN bash -c 'cd; curl -LO https://github.com/libexpat/libexpat/releases/download/R_2_2_10/expat-2.2.10.tar.gz; tar -xvf expat-2.2.10.tar.gz; cd expat-2.2.10; ./configure; make; make install' -RUN ldconfig -RUN ls -l /usr/include -RUN bash -c 'cd; curl -O https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.13.1.tar.bz2; tar -xvf fontconfig-2.13.1.tar.bz2; cd fontconfig-2.13.1; UUID_LIBS="-L/lib/x86_64-linux-gnu -luuid" UUID_CFLAGS="-I/include" ./configure --enable-static --sysconfdir=/etc --localstatedir=/var; make; make install' -RUN bash -c 'cd; curl -O https://www.cairographics.org/releases/pixman-0.40.0.tar.gz; tar -xvf pixman-0.40.0.tar.gz; cd pixman-0.40.0; ./configure; make; make install' -RUN bash -c 'cd; curl -O https://cairographics.org/releases/cairo-1.16.0.tar.xz; tar -xvf cairo-1.16.0.tar.xz; cd cairo-1.16.0; ./configure; make; make install' -RUN bash -c 'cd; curl -LO https://github.com/fribidi/fribidi/releases/download/v1.0.10/fribidi-1.0.10.tar.xz; tar -xvf fribidi-1.0.10.tar.xz; cd fribidi-1.0.10; ./configure; make; make install' -RUN bash -c 'cd; curl -LO https://download.gnome.org/sources/pango/1.48/pango-1.48.0.tar.xz; tar -xvf pango-1.48.0.tar.xz; cd pango-1.48.0; meson -Dharfbuzz:docs=disabled -Dgtk_doc=false _build; cd _build; ninja; ninja install' -RUN ldconfig - -# librsvg -RUN bash -c 'curl https://sh.rustup.rs -sSf | sh -s -- -y'; -RUN bash -c 'curl -O http://xmlsoft.org/sources/libxml2-2.9.10.tar.gz; tar -xvf libxml2-2.9.10.tar.gz; cd libxml2-2.9.10; ./configure --without-python; make; make install' -RUN bash -c 'curl -O https://ftp.gnu.org/pub/gnu/gettext/gettext-0.21.tar.gz; tar -xvf gettext-0.21.tar.gz; cd gettext-0.21; ./configure; make; make install' -RUN ldconfig -RUN bash -c 'curl -LO https://launchpad.net/intltool/trunk/0.51.0/+download/intltool-0.51.0.tar.gz; tar -xvf intltool-0.51.0.tar.gz; cd intltool-0.51.0; ./configure; make; make install' -# using an old version of shared-mime-info because 2.1 has a ridiculous number of dependencies for what is essentially just a database -RUN bash -c 'curl -O https://people.freedesktop.org/~hadess/shared-mime-info-1.8.tar.xz; tar -xvf shared-mime-info-1.8.tar.xz; cd shared-mime-info-1.8; ./configure; make; make install' -RUN bash -c 'curl -LO https://download.gnome.org/sources/gdk-pixbuf/2.42/gdk-pixbuf-2.42.2.tar.xz; tar -xvf gdk-pixbuf-2.42.2.tar.xz; cd gdk-pixbuf-2.42.2; meson _build; cd _build; ninja install'; -RUN ldconfig -RUN bash -c 'curl -LO https://download.gnome.org/sources/libcroco/0.6/libcroco-0.6.13.tar.xz; tar -xvf libcroco-0.6.13.tar.xz; cd libcroco-0.6.13; ./configure; make; make install' -RUN bash -c 'cd; . .cargo/env; curl -LO https://download.gnome.org/sources/librsvg/2.50/librsvg-2.50.2.tar.xz; tar -xvf librsvg-2.50.2.tar.xz; cd librsvg-2.50.2; ./configure --enable-introspection=no; make; make install' -RUN ldconfig diff --git a/prebuild/Linux/binding.gyp b/prebuild/Linux/binding.gyp deleted file mode 100644 index 1a967667d..000000000 --- a/prebuild/Linux/binding.gyp +++ /dev/null @@ -1,53 +0,0 @@ -{ - 'targets': [ - { - 'target_name': 'canvas', - 'sources': [ - 'src/backend/Backend.cc', - 'src/backend/ImageBackend.cc', - 'src/backend/PdfBackend.cc', - 'src/backend/SvgBackend.cc', - 'src/bmp/BMPParser.cc', - 'src/Backends.cc', - 'src/Canvas.cc', - 'src/CanvasGradient.cc', - 'src/CanvasPattern.cc', - 'src/CanvasRenderingContext2d.cc', - 'src/closure.cc', - 'src/color.cc', - 'src/Image.cc', - 'src/ImageData.cc', - 'src/init.cc', - 'src/register_font.cc' - ], - 'defines': [ - 'HAVE_GIF', - 'HAVE_JPEG', - 'HAVE_RSVG' - ], - 'libraries': [ - ' /dev/null 2>&1 || { - echo "could not find lib$lib.dll, have to skip "; - continue; - } - - dlltool -d lib$lib.def -l /mingw64/lib/lib$lib.lib > /dev/null 2>&1 || { - echo "could not create dll for lib$lib.dll"; - continue; - } - - echo "created lib$lib.lib from lib$lib.dll"; - - rm lib$lib.def -done diff --git a/prebuild/macOS/binding.gyp b/prebuild/macOS/binding.gyp deleted file mode 100644 index 00ae2ccbc..000000000 --- a/prebuild/macOS/binding.gyp +++ /dev/null @@ -1,51 +0,0 @@ -{ - 'targets': [ - { - 'target_name': 'canvas', - 'sources': [ - 'src/backend/Backend.cc', - 'src/backend/ImageBackend.cc', - 'src/backend/PdfBackend.cc', - 'src/backend/SvgBackend.cc', - 'src/bmp/BMPParser.cc', - 'src/Backends.cc', - 'src/Canvas.cc', - 'src/CanvasGradient.cc', - 'src/CanvasPattern.cc', - 'src/CanvasRenderingContext2d.cc', - 'src/closure.cc', - 'src/color.cc', - 'src/Image.cc', - 'src/ImageData.cc', - 'src/init.cc', - 'src/register_font.cc' - ], - 'defines': [ - 'HAVE_GIF', - 'HAVE_JPEG', - 'HAVE_RSVG' - ], - 'libraries': [ - '