sc0ty / subsync

Subtitle Speech Synchronizer
GNU General Public License v3.0
1.24k stars 53 forks source link

Build error on ArchLinux #141

Closed tyhawk closed 2 years ago

tyhawk commented 2 years ago

I'm getting this build error on ArchLinux which I haven't been able to figure out:

gizmo/media/audiodec.cpp: In member function ‘virtual bool AudioDec::feed(const AVPacket*)’:
gizmo/media/audiodec.cpp:105:35: error: ‘av_get_default_channel_layout’ was not declared in this scope
  105 |                                 = av_get_default_channel_layout(m_frame->channels);
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gizmo/media/audiodec.cpp: In member function ‘virtual void AudioDec::flush()’:
gizmo/media/audiodec.cpp:117:23: warning: ‘void av_init_packet(AVPacket*)’ is deprecated [-Wdeprecated-declarations]
  117 |         av_init_packet(&packet);
      |         ~~~~~~~~~~~~~~^~~~~~~~~
In file included from /usr/include/libavcodec/avcodec.h:45,
                 from gizmo/media/decoder.h:9,
                 from gizmo/media/audiodec.h:4,
                 from gizmo/media/audiodec.cpp:1:
/usr/include/libavcodec/packet.h:506:6: note: declared here
  506 | void av_init_packet(AVPacket *pkt);
      |      ^~~~~~~~~~~~~~
error: command '/usr/bin/gcc' failed with exit code 1

Version 0.16 builds just fine with the same method. The package dependencies also didn't seem to change.

This is my PKGBUILD file:

pkgname="subsync"
pkgver=0.17
pkgrel=0
pkgdesc='An automatic movie subtitle synchronization tool'
arch=('x86_64')
url="https://subsync.online"
license=('GPL3')
provides=('subsync')
source=("https://github.com/sc0ty/${pkgname}/archive/${pkgver}.tar.gz")
sha256sums=('9c0d1a6bcbdf6736517ba173b4d844412f8badd32d45e7e85edcfe542625781c')
depends=(
    'python>=3.6'
    'python-wxpython'
    'python-pysubs2>=0.2.4'
    'python-certifi'
    'python-cryptography>=2.8'
    'python-pyaml'
    'pybind11>=2.4'
    'python-requests>=2.0'
    'sphinxbase'
    'pocketsphinx'
)

build() {
    cd ${srcdir}/${pkgname}-${pkgver}
    python setup.py build
}

package() {
    cd ${srcdir}/${pkgname}-${pkgver}
    python setup.py install --root="${pkgdir}" --optimize=1
    mkdir -p "$pkgdir/usr/share/applications"
    mkdir -p "$pkgdir/usr/share/icons/hicolor/scalable/apps"
    install -Dm644 "resources/subsync.desktop" "$pkgdir/usr/share/applications/"
    install -Dm644 "resources/subsync.svg" "$pkgdir/usr/share/icons/hicolor/scalable/apps/"
}
tyhawk commented 2 years ago

I retried this with 0.16 and I am getting the same error. That means it isn't an issue with subsync, but my libraries & packages. It might be an issue with the ffmpeg version I have installed, according to some Googled bugs with the same error.

extra/ffmpeg 2:5.0-5 [installed]
    Complete solution to record, convert and stream audio and video
extra/ffmpeg4.4 4.4.1-4 [installed]
    Complete solution to record, convert and stream audio and video