From 02e32740adfb79cde3c92e074d90e01d250248c9 Mon Sep 17 00:00:00 2001 From: Srikanth Kotagiri Date: Mon, 8 Jul 2024 14:48:30 +0000 Subject: [PATCH] Adding support for shared build from descripinc/ffmpeg-build-script for lix --- .github/workflows/prebuild.yml | 14 ++++++++++---- binding.gyp | 13 +------------ install_ffmpeg.js | 3 +++ package.json | 2 +- 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/.github/workflows/prebuild.yml b/.github/workflows/prebuild.yml index c3f6d87..31790ff 100644 --- a/.github/workflows/prebuild.yml +++ b/.github/workflows/prebuild.yml @@ -5,26 +5,32 @@ jobs: linux-package: runs-on: ubuntu-24.04 container: - image: node:16.20.2-bookworm + image: ubuntu:24.04 steps: - uses: actions/checkout@v2 with: lfs: true + - name: check Linux dependencies + shell: bash + run: | + apt update + DEBIAN_FRONTEND=noninteractive apt install --no-install-recommends --no-install-suggests -y libxcb1 unzip nodejs curl nodejs npm + DEBIAN_FRONTEND=noninteractive apt install --no-install-recommends --no-install-suggests -y python3-setuptools build-essential + - name: npm install run: npm install env: PREBUILD: true - - name: check Linux dependencies run: node ./install_ffmpeg.js - name: prebuild for Linux (x64) run: npx prebuild --runtime napi --arch x64 --include-regex '(\.node|\.dylib|ffmpeg|ffprobe)$' --upload ${{ secrets.GITHUB_TOKEN }} - - name: prebuild for Linux (arm64) - run: npx prebuild --runtime napi --arch arm64 --include-regex '(\.node|\.dylib|ffmpeg|ffprobe)$' --upload ${{ secrets.GITHUB_TOKEN }} + # - name: prebuild for Linux (arm64) + # run: npx prebuild --runtime napi --arch arm64 --include-regex '(\.node|\.dylib|ffmpeg|ffprobe)$' --upload ${{ secrets.GITHUB_TOKEN }} package: runs-on: ${{ matrix.os }} diff --git a/binding.gyp b/binding.gyp index c3f90a5..bd50b5a 100644 --- a/binding.gyp +++ b/binding.gyp @@ -34,19 +34,8 @@ ], "link_settings": { - "library_dirs": [ - "<(module_root_dir)/ffmpeg/ffmpeg-ffprobe-shared-linux-<(target_arch_override).<(ffmpeg_version)/" - ], "libraries": [ - "-lavcodec", - "-lavdevice", - "-lavfilter", - "-lavformat", - "-lavutil", - "-lpostproc", - "-lswresample", - "-lswscale", - "-lzimg" + "-L<(module_root_dir)/ffmpeg/ffmpeg-ffprobe-shared-linux-<(target_arch_override).<(ffmpeg_version)/" ] }, "copies": [ diff --git a/install_ffmpeg.js b/install_ffmpeg.js index 0f41b7f..31c0d7b 100755 --- a/install_ffmpeg.js +++ b/install_ffmpeg.js @@ -176,7 +176,10 @@ async function linux() { }); await exec(`unzip ffmpeg/${ffmpegFilename}.zip -d ffmpeg/${ffmpegFilename}/`); + + console.log('Adding path "$PWD/ffmpeg/${ffmpegFilename}/" to ldconfig path'); await exec(`echo "$PWD/ffmpeg/${ffmpegFilename}/" | tee -a /etc/ld.so.conf.d/ffmpeg.conf`) + console.log('Running LDCONFIG'); await exec(`ldconfig`) }); diff --git a/package.json b/package.json index 614fb03..bd1b862 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "beamcoder-prebuild", - "version": "0.7.1-rc.6", + "version": "0.7.1-rc.7", "description": "Node.js native bindings to FFmpeg.", "main": "index.js", "types": "index.d.ts",