plex-media-player: 2.40.0.1007 -> 2.55.0.1069 + update script (#68938)
This commit is contained in:
parent
2f0ee4bd0b
commit
41582c7a02
@ -5,45 +5,20 @@ let
|
|||||||
# During compilation, a CMake bundle is downloaded from `artifacts.plex.tv`,
|
# During compilation, a CMake bundle is downloaded from `artifacts.plex.tv`,
|
||||||
# which then downloads a handful of web client-related files. To enable
|
# which then downloads a handful of web client-related files. To enable
|
||||||
# sandboxed builds, we manually download them and save them so these files
|
# sandboxed builds, we manually download them and save them so these files
|
||||||
# are fetched ahead-of-time instead of during the CMake build. Whenever
|
# are fetched ahead-of-time instead of during the CMake build. To update
|
||||||
# plex-media-player is updated, the versions for these files are changed,
|
# plex-media-player use the update.sh script, so the versions and hashes
|
||||||
# so the build IDs (and SHAs) below will need to be updated!
|
# for these files are are also updated!
|
||||||
depSrcs = rec {
|
depSrcs = import ./deps.nix { inherit fetchurl; };
|
||||||
webClientBuildId = "141-4af71961b12c68";
|
|
||||||
webClientDesktopBuildId = "3.104.2-1b12c68";
|
|
||||||
webClientTvBuildId = "4.3.0-4af7196";
|
|
||||||
|
|
||||||
webClient = fetchurl {
|
|
||||||
url = "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/buildid.cmake";
|
|
||||||
sha256 = "0fpkd1s49dbiqqlijxbillqd71a78p8y2sc23mwp0lvcmxrg265p";
|
|
||||||
};
|
|
||||||
webClientDesktopHash = fetchurl {
|
|
||||||
url = "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/web-client-desktop-${webClientDesktopBuildId}.tar.xz.sha1";
|
|
||||||
sha256 = "0sb0j44lwqz9zbm98nba4x6c1jxdzvs36ynwfg527avkxxna0f8f";
|
|
||||||
};
|
|
||||||
webClientDesktop = fetchurl {
|
|
||||||
url = "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/web-client-desktop-${webClientDesktopBuildId}.tar.xz";
|
|
||||||
sha256 = "0dxa0ka0igfsryzda4r5clwdl47ah78nmlmgj9d5pgsvyvzjp87z";
|
|
||||||
};
|
|
||||||
webClientTvHash = fetchurl {
|
|
||||||
url = "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/web-client-tv-${webClientTvBuildId}.tar.xz.sha1";
|
|
||||||
sha256 = "086w1bavk2aqsyhv9zi5fynk31zf61sl91r6gjrdrz656wfk5bxa";
|
|
||||||
};
|
|
||||||
webClientTv = fetchurl {
|
|
||||||
url = "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/web-client-tv-${webClientTvBuildId}.tar.xz";
|
|
||||||
sha256 = "12vbgsfnj0j2y5jd73dpi08hqsr9888sma41nvd4ydsd7qblm455";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in mkDerivation rec {
|
in mkDerivation rec {
|
||||||
pname = "plex-media-player";
|
pname = "plex-media-player";
|
||||||
version = "2.40.0.1007";
|
version = "2.55.0.1069";
|
||||||
vsnHash = "5482132c";
|
vsnHash = "2369bed9";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "plexinc";
|
owner = "plexinc";
|
||||||
repo = "plex-media-player";
|
repo = "plex-media-player";
|
||||||
rev = "v${version}-${vsnHash}";
|
rev = "v${version}-${vsnHash}";
|
||||||
sha256 = "0ibdh5g8x32iy74q97jfsmxd08wnyrzs3gfiwjfgc10vaa1qdhli";
|
sha256 = "1jq4592sgaia0xy2h7n3vh5i7c84sdh4l64fdc774r4i0bmg66qi";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgconfig cmake python3 ];
|
nativeBuildInputs = [ pkgconfig cmake python3 ];
|
||||||
@ -61,6 +36,8 @@ in mkDerivation rec {
|
|||||||
|
|
||||||
cmakeFlags = [ "-DCMAKE_BUILD_TYPE=RelWithDebInfo" "-DQTROOT=${qtbase}" ];
|
cmakeFlags = [ "-DCMAKE_BUILD_TYPE=RelWithDebInfo" "-DQTROOT=${qtbase}" ];
|
||||||
|
|
||||||
|
passthru.updateScript = ./update.sh;
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "Streaming media player for Plex";
|
description = "Streaming media player for Plex";
|
||||||
license = licenses.gpl2;
|
license = licenses.gpl2;
|
||||||
|
28
pkgs/applications/video/plex-media-player/deps.nix
generated
Normal file
28
pkgs/applications/video/plex-media-player/deps.nix
generated
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
{ fetchurl }:
|
||||||
|
|
||||||
|
rec {
|
||||||
|
webClientBuildId = "180-afec74de50e175";
|
||||||
|
webClientDesktopBuildId = "4.29.2-e50e175";
|
||||||
|
webClientTvBuildId = "4.29.3-afec74d";
|
||||||
|
|
||||||
|
webClient = fetchurl {
|
||||||
|
url = "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/buildid.cmake";
|
||||||
|
sha256 = "0rabrg3lk9vgpswk8npa54hzqf2v8ghqqnysxpwn12wrp1pc2rr9";
|
||||||
|
};
|
||||||
|
webClientDesktopHash = fetchurl {
|
||||||
|
url = "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/web-client-desktop-${webClientDesktopBuildId}.tar.xz.sha1";
|
||||||
|
sha256 = "02b5yq4yc411qlg2dkw5j9lrr3cn2y4d27sin0skf6qza180473g";
|
||||||
|
};
|
||||||
|
webClientDesktop = fetchurl {
|
||||||
|
url = "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/web-client-desktop-${webClientDesktopBuildId}.tar.xz";
|
||||||
|
sha256 = "0l3xv48kr2rx878a40zrgwif2ga2ikv6fdcbq9pylycnmm41pxmh";
|
||||||
|
};
|
||||||
|
webClientTvHash = fetchurl {
|
||||||
|
url = "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/web-client-tv-${webClientTvBuildId}.tar.xz.sha1";
|
||||||
|
sha256 = "0wq115y2xrgwqrzr43nhkq8ba237z20yfp426ki2kdypsq8fjqka";
|
||||||
|
};
|
||||||
|
webClientTv = fetchurl {
|
||||||
|
url = "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/web-client-tv-${webClientTvBuildId}.tar.xz";
|
||||||
|
sha256 = "1wax1qslm226l2w53m2fnl849jw349qhg3rjghx7vip5pmb43vw9";
|
||||||
|
};
|
||||||
|
}
|
71
pkgs/applications/video/plex-media-player/update.sh
Executable file
71
pkgs/applications/video/plex-media-player/update.sh
Executable file
@ -0,0 +1,71 @@
|
|||||||
|
#!/usr/bin/env nix-shell
|
||||||
|
#!nix-shell -i bash -p curl common-updater-scripts nix-prefetch-scripts jq
|
||||||
|
|
||||||
|
set -xeuo pipefail
|
||||||
|
|
||||||
|
nixpkgs="$(git rev-parse --show-toplevel)"
|
||||||
|
|
||||||
|
oldVersion="$(nix-instantiate --eval -E "with import $nixpkgs {}; plex-media-player.version or (builtins.parseDrvName plex-media-player.name).version" | tr -d '"')"
|
||||||
|
latestTag="$(curl -s https://api.github.com/repos/plexinc/plex-media-player/tags | jq -r '.[] | .name' | sort --version-sort | tail -1)"
|
||||||
|
latestVersion="$(expr $latestTag : 'v\(.*\)-.*')"
|
||||||
|
latestHash="$(expr $latestTag : 'v.*-\(.*\)')"
|
||||||
|
|
||||||
|
if [ ! "$oldVersion" = "$latestVersion" ]; then
|
||||||
|
# update default.nix with the new version and hash
|
||||||
|
expectedHash=$(nix-prefetch-git --url https://github.com/plexinc/plex-media-player.git --rev $latestTag --quiet | jq -r '.sha256')
|
||||||
|
update-source-version plex-media-player --version-key=vsnHash "${latestHash}" 0000
|
||||||
|
update-source-version plex-media-player "${latestVersion}" $expectedHash
|
||||||
|
|
||||||
|
# extract the webClientBuildId from the source folder
|
||||||
|
src="$(nix-build --no-out-link $nixpkgs -A plex-media-player.src)"
|
||||||
|
webClientBuildId="$(grep 'set(WEB_CLIENT_BUILD_ID' $src/CMakeModules/WebClient.cmake | cut -d' ' -f2 | tr -d ')')"
|
||||||
|
|
||||||
|
# retreive the included cmake file and hash
|
||||||
|
{ read -r webClientBuildIdHash; read -r webClientBuildIdPath; } < \
|
||||||
|
<(nix-prefetch-url --print-path "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/buildid.cmake")
|
||||||
|
webClientDesktopBuildId="$(grep 'set(DESKTOP_VERSION' $webClientBuildIdPath | cut -d' ' -f2 | tr -d ')')"
|
||||||
|
webClientTvBuildId="$(grep 'set(TV_VERSION' $webClientBuildIdPath | cut -d' ' -f2 | tr -d ')')"
|
||||||
|
|
||||||
|
# get the hashes for the other files
|
||||||
|
webClientDesktopHash="$(nix-prefetch-url "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/web-client-desktop-${webClientDesktopBuildId}.tar.xz.sha1")"
|
||||||
|
webClientDesktop="$(nix-prefetch-url "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/web-client-desktop-${webClientDesktopBuildId}.tar.xz")"
|
||||||
|
webClientTvHash="$(nix-prefetch-url "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/web-client-tv-${webClientTvBuildId}.tar.xz.sha1")"
|
||||||
|
webClientTv="$(nix-prefetch-url "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/web-client-tv-${webClientTvBuildId}.tar.xz")"
|
||||||
|
|
||||||
|
# update deps.nix
|
||||||
|
cat > $nixpkgs/pkgs/applications/video/plex-media-player/deps.nix <<EOF
|
||||||
|
{ fetchurl }:
|
||||||
|
|
||||||
|
rec {
|
||||||
|
webClientBuildId = "${webClientBuildId}";
|
||||||
|
webClientDesktopBuildId = "${webClientDesktopBuildId}";
|
||||||
|
webClientTvBuildId = "${webClientTvBuildId}";
|
||||||
|
|
||||||
|
webClient = fetchurl {
|
||||||
|
url = "https://artifacts.plex.tv/web-client-pmp/\${webClientBuildId}/buildid.cmake";
|
||||||
|
sha256 = "${webClientBuildIdHash}";
|
||||||
|
};
|
||||||
|
webClientDesktopHash = fetchurl {
|
||||||
|
url = "https://artifacts.plex.tv/web-client-pmp/\${webClientBuildId}/web-client-desktop-\${webClientDesktopBuildId}.tar.xz.sha1";
|
||||||
|
sha256 = "${webClientDesktopHash}";
|
||||||
|
};
|
||||||
|
webClientDesktop = fetchurl {
|
||||||
|
url = "https://artifacts.plex.tv/web-client-pmp/\${webClientBuildId}/web-client-desktop-\${webClientDesktopBuildId}.tar.xz";
|
||||||
|
sha256 = "${webClientDesktop}";
|
||||||
|
};
|
||||||
|
webClientTvHash = fetchurl {
|
||||||
|
url = "https://artifacts.plex.tv/web-client-pmp/\${webClientBuildId}/web-client-tv-\${webClientTvBuildId}.tar.xz.sha1";
|
||||||
|
sha256 = "${webClientTvHash}";
|
||||||
|
};
|
||||||
|
webClientTv = fetchurl {
|
||||||
|
url = "https://artifacts.plex.tv/web-client-pmp/\${webClientBuildId}/web-client-tv-\${webClientTvBuildId}.tar.xz";
|
||||||
|
sha256 = "${webClientTv}";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
git add "$nixpkgs"/pkgs/applications/video/plex-media-player/{default,deps}.nix
|
||||||
|
git commit -m "plex-media-player: ${oldVersion} -> ${latestVersion}"
|
||||||
|
else
|
||||||
|
echo "plex-media-player is already up-to-date"
|
||||||
|
fi
|
Loading…
x
Reference in New Issue
Block a user