You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
2.3KB

  1. SHELL:=/bin/bash
  2. UBUNTU_VERSION ?= 2404
  3. CODENAME ?= noble
  4. VERSION:=7.1
  5. build: $(CODENAME)/cppse-ffmpeg_$(VERSION)_amd64.deb
  6. $(CODENAME)/cppse-ffmpeg_$(VERSION)_amd64.deb:
  7. mkdir -p $(CODENAME)
  8. make ubuntu$(UBUNTU_VERSION)
  9. ubuntu$(UBUNTU_VERSION):
  10. git clone -b stable https://code.videolan.org/videolan/x264 || true
  11. git clone -b n$(VERSION) https://github.com/FFmpeg/FFmpeg ffmpeg || true
  12. bash ../ubuntu$(UBUNTU_VERSION).sh make ffmpeg_impl
  13. make package-ubuntu$(UBUNTU_VERSION)
  14. bash ../ubuntu$(UBUNTU_VERSION).sh chown $$(id -u):$$(id -g) . -R # fix permissions
  15. ffmpeg_impl:
  16. # see issue https://exerror.com/fatal-detected-dubious-ownership-in-repository/
  17. git config --global --add safe.directory '*'
  18. apt-get update
  19. sudo apt-get install -y yasm
  20. sudo apt-get install -y nasm # apparently x264 switched to this
  21. mkdir -p x264_out
  22. mkdir -p ffmpeg_out
  23. cp -prv 5.1-0004-fix-binutils.patch ffmpeg/
  24. pushd x264 && \
  25. echo pass
  26. pushd x264 && \
  27. ./configure --cxx=$$(which c++) --enable-static --enable-shared --prefix=$$(realpath $$PWD/../x264_out) && \
  28. make -j $$(nproc) && \
  29. make install
  30. pushd x264 && \
  31. ./configure --cxx=$$(which c++) --enable-static --enable-shared && \
  32. make -j $$(nproc) && \
  33. make install
  34. pushd ffmpeg && git checkout n7.1
  35. pushd ffmpeg && \
  36. ./configure --cxx=$$(which c++) --enable-static --enable-shared --enable-libx264 --enable-gpl --enable-swresample --disable-libdrm --prefix=$$(realpath $$PWD/../ffmpeg_out) && \
  37. make -j $$(nproc) && \
  38. make install
  39. package-ubuntu$(UBUNTU_VERSION):
  40. rm -rf out
  41. mkdir -p out/opt/cppse/build/x264
  42. mkdir -p out/opt/cppse/build/ffmpeg
  43. cp -prv ./x264_out/* out/opt/cppse/build/x264/
  44. cp -prv ./ffmpeg_out/* out/opt/cppse/build/ffmpeg/
  45. rm -rf $(CODENAME)/cppse-ffmpeg_*_amd64.deb
  46. docker run -v "$$(pwd):/src/" rayburgemeestre/fpm-ubuntu:24.04 fpm -f -v $(VERSION) --iteration $(CODENAME) -s dir -t deb -n cppse-ffmpeg --license MPL2 --maintainer "Ray Burgemeestre <ray@cppse.nl>" --description "ffmpeg - build dependency" --url "https://gitea.cppse.nl/rayburgemeestre/build-config/src/branch/master/ffmpeg" --deb-generate-changes -C /src/out
  47. cp -prv cppse-ffmpeg_*_amd64.deb $(CODENAME)/
  48. clean:
  49. rm -rf x264
  50. rm -rf ffmpeg
  51. rm -rf out
  52. rm -rf x264_out
  53. rm -rf ffmpeg_out
  54. shell:
  55. FLAGS="-i --privileged" bash ../ubuntu$(UBUNTU_VERSION).sh /bin/bash