diff --git a/.github/workflows/prebuild.yml b/.github/workflows/prebuild.yml index 15aebcf..8540442 100644 --- a/.github/workflows/prebuild.yml +++ b/.github/workflows/prebuild.yml @@ -16,8 +16,8 @@ jobs: shell: bash run: | apt update - DEBIAN_FRONTEND=noninteractive apt install --no-install-recommends --no-install-suggests -y git git-lfs libxcb1 unzip nodejs curl nodejs npm - DEBIAN_FRONTEND=noninteractive apt install --no-install-recommends --no-install-suggests -y python3-setuptools build-essential + DEBIAN_FRONTEND=noninteractive apt install --no-install-recommends --no-install-suggests -y git git-lfs \ + libxcb1 unzip nodejs curl nodejs npm python3-setuptools build-essential - uses: actions/checkout@v2 with: @@ -34,9 +34,6 @@ jobs: - 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 }} - windows-package: permissions: contents: write diff --git a/binding.gyp b/binding.gyp index bd50b5a..8be8832 100644 --- a/binding.gyp +++ b/binding.gyp @@ -34,8 +34,21 @@ ], "link_settings": { + "ldflags": [ + "--verbose" + ], "libraries": [ - "-L<(module_root_dir)/ffmpeg/ffmpeg-ffprobe-shared-linux-<(target_arch_override).<(ffmpeg_version)/" + "-Wl,-rpath,./build/Release/ " + "-L<(module_root_dir)/ffmpeg/ffmpeg-ffprobe-shared-linux-<(target_arch_override).<(ffmpeg_version)/ " + "-lavcodec", + "-lavdevice", + "-lavfilter", + "-lavformat", + "-lavutil", + "-lpostproc", + "-lswresample", + "-lswscale", + "-lzimg" ] }, "copies": [ diff --git a/install_ffmpeg.js b/install_ffmpeg.js index 31c0d7b..e6b7b7f 100755 --- a/install_ffmpeg.js +++ b/install_ffmpeg.js @@ -158,26 +158,31 @@ async function linux() { const tag = `v${version}`; await access(`ffmpeg/${ffmpegFilename}`, fs.constants.R_OK).catch(async () => { - const ws = fs.createWriteStream(`ffmpeg/${ffmpegFilename}.zip`); - const url = `https://github.com/descriptinc/ffmpeg-build-script/releases/download/${tag}/${ffmpegFilename}.zip` + const ws = fs.createWriteStream(`ffmpeg/${ffmpegFilename}.tar.gz`); + const url = `https://github.com/descriptinc/ffmpeg-build-script/releases/download/${tag}/${ffmpegFilename}.tar.gz` console.log(url); await get( ws, url, - `${ffmpegFilename}.zip` + `${ffmpegFilename}.tar.gz` ).catch(async (err) => { if (err.name === 'RedirectError') { const redirectURL = err.message; - await get(ws, redirectURL, `${ffmpegFilename}.zip`); + await get(ws, redirectURL, `${ffmpegFilename}.tar.gz`); } else { console.error(err); throw err; } }); - await exec(`unzip ffmpeg/${ffmpegFilename}.zip -d ffmpeg/${ffmpegFilename}/`); + await mkdir(`ffmpeg/${ffmpegFilename}`).catch(e => { + if (e.code === 'EEXIST') return; + else throw e; + }); + + await exec(`tar xvzf ffmpeg/${ffmpegFilename}.tar.gz -C ffmpeg/${ffmpegFilename}/`); - console.log('Adding path "$PWD/ffmpeg/${ffmpegFilename}/" to ldconfig path'); + 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-lock.json b/package-lock.json index 45fc499..f0e372c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "beamcoder-prebuild", - "version": "0.7.1-rc.6", + "version": "0.7.1-rc.7", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "beamcoder-prebuild", - "version": "0.7.1-rc.3", + "version": "0.7.1-rc.7", "hasInstallScript": true, "license": "GPL-3.0-or-later", "dependencies": {