Skip to content
This repository has been archived by the owner on Aug 9, 2024. It is now read-only.

Commit

Permalink
build(deps): Bump youtube-dl and add as a submodule (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher authored Dec 18, 2023
1 parent 848f8f4 commit 29deb15
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 38 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,24 @@ jobs:
uses: actions/checkout@v4
with:
path: PlexyGlass.bundle
submodules: recursive

- name: Set up Python
uses: LizardByte/[email protected]
with:
python-version: '2.7'

- name: Patch third-party deps
shell: bash
working-directory: PlexyGlass.bundle/third-party
run: |
patch_dir=${{ github.workspace }}/PlexyGlass.bundle/patches
# youtube-dl patches
pushd youtube-dl
git apply -v "${patch_dir}/youtube_dl-compat.patch"
popd
- name: Set up Python Dependencies
shell: bash
working-directory: PlexyGlass.bundle
Expand All @@ -73,14 +85,6 @@ jobs:
python -m pip install --upgrade --target=./Contents/Libraries/Shared -r \
requirements.txt --no-warn-script-location
- name: Patch python deps
shell: bash
working-directory: PlexyGlass.bundle/Contents/Libraries/Shared
run: |
patch_dir=${{ github.workspace }}/PlexyGlass.bundle/patches
patch -p1 < "${patch_dir}/youtube_dl-compat.patch"
patch -p1 < "${patch_dir}/youtube_dl-extractor.patch"
- name: Build plist
working-directory: PlexyGlass.bundle
env:
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "third-party/youtube-dl"]
path = third-party/youtube-dl
url = https://github.com/ytdl-org/youtube-dl.git
branch = master
5 changes: 5 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ build:
- rstcheck -r . # lint rst files
# - rstfmt --check --diff -w 120 . # check rst formatting

# submodules required to include youtube-dl
submodules:
include: all
recursive: true

# Build documentation in the docs/ directory with Sphinx
sphinx:
builder: html
Expand Down
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ RUN <<_DEPS
set -e
apt-get update -y
apt-get install -y --no-install-recommends \
patch \
python2=2.7.18* \
python-pip=20.3.4*
apt-get clean
Expand Down Expand Up @@ -47,6 +48,17 @@ python2 -m pip --no-python-version-warning --disable-pip-version-check install -
python2 ./scripts/build_plist.py
_BUILD

# patch youtube-dl, cannot use git apply because we don't pass in any git files
WORKDIR /build/Contents/Libraries/Shared
RUN <<_PATCH
#!/bin/bash
set -e
patch_dir=/build/patches
patch -p1 < "${patch_dir}/youtube_dl-compat.patch"
_PATCH

WORKDIR /build

# clean
RUN <<_CLEAN
#!/bin/bash
Expand Down
11 changes: 10 additions & 1 deletion docs/source/contributing/build.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,22 @@ Ensure `git <https://git-scm.com/>`__ is installed and run the following:

.. code-block:: bash
git clone https://github.com/lizardbyte/plexyglass.git plexyglass.bundle
git clone --recurse-submodules https://github.com/lizardbyte/plexyglass.git plexyglass.bundle
cd ./plexyglass.bundle
Setup venv
----------
It is recommended to setup and activate a `venv`_.

Apply Patches
-------------
Patch YouTube-DL
.. code-block:: bash
pushd ./third-party/youtube-dl
git apply -v ../../patches/youtube_dl-compat.patch
popd
Install Requirements
--------------------
Install Requirements
Expand Down
25 changes: 0 additions & 25 deletions patches/youtube_dl-extractor.patch

This file was deleted.

5 changes: 1 addition & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,4 @@ typing==3.10.0.0

# youtube_dl is not capable or willing to create a new release so have to install from git
# youtube_dl==2021.12.17
# dependabot cannot update this
# git+https://github.com/ytdl-org/youtube-dl.git@00ef748cc0e35ee60efd0f7a00e373ab8d1af86b#egg=youtube_dl
# do not use git as git in ubuntu 22.04 does not work with python 2.7
https://github.com/ytdl-org/youtube-dl/archive/00ef748cc0e35ee60efd0f7a00e373ab8d1af86b.zip#egg=youtube_dl
./third-party/youtube-dl
1 change: 1 addition & 0 deletions third-party/youtube-dl
Submodule youtube-dl added at be008e

0 comments on commit 29deb15

Please sign in to comment.