Skip to content

Commit

Permalink
Revert some changes and add a patch for borked DLL
Browse files Browse the repository at this point in the history
  • Loading branch information
LHLaurini committed Oct 21, 2021
1 parent 196bbab commit 2ec7e6c
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/avcodec-fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--- avcodec-58.dll.txt 2021-05-02 21:56:52.069320800 -0300
+++ avcodec-58.dll.fixed.txt 2021-05-02 21:57:07.464984700 -0300
@@ -841388,7 +841388,7 @@
00cd6ab0: 6176 315f 6478 5f61 6c67 6f00 2000 616f av1_dx_algo. .ao
00cd6ac0: 6d5f 636f 6465 635f 6275 696c 645f 636f m_codec_build_co
00cd6ad0: 6e66 6967 0000 0000 2100 616f 6d5f 636f nfig....!.aom_co
-00cd6ae0: 6465 635f 636f 6e74 726f 6c5f 0000 0000 dec_control_....
+00cd6ae0: 6465 635f 636f 6e74 726f 6c00 0000 0000 dec_control.....
00cd6af0: 2200 616f 6d5f 636f 6465 635f 6465 635f ".aom_codec_dec_
00cd6b00: 696e 6974 5f76 6572 0000 0000 2300 616f init_ver....#.ao
00cd6b10: 6d5f 636f 6465 635f 6465 636f 6465 0000 m_codec_decode..
@@ -841808,7 +841808,7 @@
00cd84f0: 3634 5f70 6172 616d 5f70 6172 7365 0000 64_param_parse..
00cd8500: 2e00 7832 3634 5f70 6963 7475 7265 5f69 ..x264_picture_i
00cd8510: 6e69 7400 0100 7832 3635 5f61 7069 5f67 nit...x265_api_g
-00cd8520: 6574 5f31 3838 0000 0500 636f 6d70 7265 et_188....compre
+00cd8520: 6574 5f31 3932 0000 0500 636f 6d70 7265 et_192....compre
00cd8530: 7373 0000 0600 636f 6d70 7265 7373 3200 ss....compress2.
00cd8540: 0c00 6465 666c 6174 6500 0000 0d00 6465 ..deflate.....de
00cd8550: 666c 6174 6542 6f75 6e64 0000 0f00 6465 flateBound....de
21 changes: 17 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,34 @@
FROM archlinux

# Install system packages
# NOTE: some packages in ownstuff seem to be borked, or at least out-of-date

RUN echo 'Server = http://mirror.rackspace.com/archlinux/$repo/os/$arch' > /etc/pacman.d/mirrorlist && \
echo -e '\n\
[multilib]\n\
Include = /etc/pacman.d/mirrorlist\n\
\n\
[ownstuff]\n\
Server = http://martchus.no-ip.biz/repo/arch/$repo/os/$arch\n\
Server = https://ftp.f3l.de/~martchus/$repo/os/$arch\n\
\n\
[pkgbuilder]\n\
Server = https://pkgbuilder-repo.chriswarrick.com/\n\
\n\
' >> /etc/pacman.conf && \
pacman -Syu --noconfirm android-tools base-devel git jdk8-openjdk unzip wget && \
pacman-key --init && \
pacman-key --recv-keys B9E36A7275FC61B464B67907E06FE8F53CDC6A4C && \
pacman-key --lsign-key B9E36A7275FC61B464B67907E06FE8F53CDC6A4C && \
pacman-key --recv-keys 5EAAEA16 && \
pacman-key --lsign-key 5EAAEA16 && \
pacman -Syu --noconfirm android-tools base-devel jdk8-openjdk {,mingw-w64-}{ffmpeg,meson} pkgbuilder unzip wget xxd && \
useradd -m user && \
echo 'user ALL=(ALL:ALL) NOPASSWD: ALL' >> /etc/sudoers && \
echo 'Defaults env_keep += "ftp_proxy http_proxy https_proxy no_proxy"' >> /etc/sudoers

# Install AUR packages

WORKDIR /tmp
RUN su user -c 'git clone https://aur.archlinux.org/yay.git && cd yay && makepkg -si --noconfirm'
RUN su user -c 'yay -S --noconfirm android-sdk android-sdk-build-tools-29.0.2 android-platform-30 {,mingw-w64-}{ffmpeg,meson}'
RUN su user -c 'pkgbuilder --noconfirm android-sdk android-sdk-build-tools-29.0.2 android-platform-30'

# Build scrcpy

Expand All @@ -44,6 +54,9 @@ RUN DIST=dist/scrcpy-win64; \
cp platform-tools/{AdbWin{,Usb}Api.dll,adb.exe} ${DIST} && \
cp build-win64/server/scrcpy-server ${DIST} && \
scripts/copy-libs.sh build-win64/app/scrcpy.exe ${DIST} && \
xxd ${DIST}/avcodec-58.dll > avcodec-58.dll.txt && \
patch -i /scrcpy/.github/workflows/avcodec-fix.patch avcodec-58.dll.txt && \
xxd -r avcodec-58.dll.txt > ${DIST}/avcodec-58.dll && \
cd dist && \
tar -cJf scrcpy-win64.tar.xz scrcpy-win64 && \
rm -r scrcpy-win64
Expand Down

0 comments on commit 2ec7e6c

Please sign in to comment.