Browse Source

installer: rewrite wheels config, fix pycountry

pull/4181/head
bastimeyer 2 months ago
committed by Sebastian Meyer
parent
commit
b19458c7be
  1. 2
      .github/workflows/main.yml
  2. 18
      script/makeinstaller-requirements.json
  3. 41
      script/makeinstaller.sh

2
.github/workflows/main.yml

@ -107,7 +107,7 @@ jobs:
- name: Install dependencies
run: |
./script/install-dependencies.sh
python -m pip install pynsist
python -m pip install pynsist wheel
sudo apt update
sudo apt install -y nsis imagemagick inkscape
- name: Installer file name

18
script/makeinstaller-requirements.json

@ -0,0 +1,18 @@
{
"build_wheels": {
"pycountry": "20.7.3 --hash=sha256:81084a53d3454344c0292deebc20fcd0a1488c136d4900312cbd465cf552cb42"
},
"wheels": {
"certifi": "2021.10.8 --hash=sha256:d62a0163eb4c2344ac042ab2bdf75399a71a2d8c7d47eac2e2ee91b9d6339569",
"charset-normalizer": "2.0.7 --hash=sha256:f7af805c321bfa1ce6714c51f254e0d5bb5e5834039bc17db7ebe3a4cec9492b",
"idna": "3.3 --hash=sha256:84d9dd047ffa80596e0f246e2eab0b391788b0503584e8945f2368256d2735ff",
"isodate": "0.6.0 --hash=sha256:aa4d33c06640f5352aca96e4b81afd8ab3b47337cc12089822d6f322ac772c81",
"lxml": "4.6.4 --hash=sha256:ee9e4b07b0eba4b6a521509e9e1877476729c1243246b6959de697ebea739643",
"pycryptodome": "3.11.0 --hash=sha256:6db1f9fa1f52226621905f004278ce7bd90c8f5363ffd5d7ab3755363d98549a",
"PySocks": "1.7.1 --hash=sha256:2725bd0a9925919b9b51739eea5f9e2bae91e83288108a9ad338b2e3a4435ee5",
"requests": "2.26.0 --hash=sha256:6c1246513ecd5ecd4528a0906f910e8f0f9c6b8ec72030dc9fd154dc1a6efd24",
"six": "1.16.0 --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254",
"urllib3": "1.26.7 --hash=sha256:c4fdf4019605b6e5423637e01bc9fe4daef873709a7973e195ceba0a62bbc844",
"websocket-client": "1.2.1 --hash=sha256:0133d2f784858e59959ce82ddac316634229da55b498aac311f1620567a710ec"
}
}

41
script/makeinstaller.sh

@ -12,6 +12,7 @@ err() {
declare -A DEPS=(
[pip]=pip
[makensis]=NSIS
[pynsist]=pynsist
[convert]=Imagemagick
@ -35,6 +36,7 @@ STREAMLINK_VERSION_PLAIN="${STREAMLINK_VERSION%%+*}"
STREAMLINK_INSTALLER="${1:-"streamlink-${STREAMLINK_VERSION/\+/_}"}"
STREAMLINK_PYTHON_VERSION=3.9.8
STREAMLINK_ASSETS_FILE="${ROOT}/script/makeinstaller-assets.json"
STREAMLINK_REQUIREMENTS_FILE="${ROOT}/script/makeinstaller-requirements.json"
CI_BUILD_NUMBER=${GITHUB_RUN_ID:-0}
STREAMLINK_VI_VERSION="${STREAMLINK_VERSION_PLAIN}.${CI_BUILD_NUMBER}"
@ -48,6 +50,7 @@ cache_dir="${build_dir}/cache"
nsis_dir="${build_dir}/nsis"
files_dir="${build_dir}/files"
icons_dir="${files_dir}/icons"
wheels_dir=$(mktemp -d) && trap "rm -rf '${wheels_dir}'" RETURN || exit 255
removed_plugins_file="${ROOT}/src/streamlink/plugins/.removed"
@ -73,6 +76,31 @@ done
convert "${icons_dir}"/icon-{16,32,48,256}.png "${icons_dir}/icon.ico" 2>/dev/null
log "Downloading dependency wheels"
pip download \
--disable-pip-version-check \
--progress-bar off \
--no-cache-dir \
--require-hashes \
--only-binary :all: \
--platform win32 \
--python-version "${STREAMLINK_PYTHON_VERSION}" \
--implementation cp \
--dest "${wheels_dir}" \
--requirement /dev/stdin \
< <(jq -r '.wheels | to_entries[] | "\(.key)==\(.value)"' "${STREAMLINK_REQUIREMENTS_FILE}")
log "Locally building missing dependency wheels"
pip wheel \
--disable-pip-version-check \
--progress-bar off \
--no-cache-dir \
--require-hashes \
--no-binary :all: \
--wheel-dir "${wheels_dir}" \
--requirement /dev/stdin \
< <(jq -r '.build_wheels | to_entries[] | "\(.key)==\(.value)"' "${STREAMLINK_REQUIREMENTS_FILE}")
log "Configuring installer"
cat > "${build_dir}/streamlink.cfg" <<EOF
@ -89,18 +117,7 @@ format=bundled
[Include]
packages=pkg_resources
pycountry
pypi_wheels=certifi==2021.5.30
charset-normalizer==2.0.4
idna==3.2
isodate==0.6.0
lxml==4.6.4
pycryptodome==3.10.1
PySocks==1.7.1
requests==2.26.0
six==1.16.0
urllib3==1.26.6
websocket-client==1.2.1
local_wheels=${wheels_dir}/*.whl
files=${ROOT}/build/lib/streamlink > \$INSTDIR\pkgs
${ROOT}/build/lib/streamlink_cli > \$INSTDIR\pkgs

Loading…
Cancel
Save