Skip to content

Commit

Permalink
Adding support for shared build from descripinc/ffmpeg-build-script f…
Browse files Browse the repository at this point in the history
…or lix
  • Loading branch information
Srikanth Kotagiri committed Jul 8, 2024
1 parent 0ec8a28 commit 02e3274
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 17 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/prebuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
13 changes: 1 addition & 12 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
3 changes: 3 additions & 0 deletions install_ffmpeg.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
});

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 02e3274

Please sign in to comment.