uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead

https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948
this can do it nicely.

Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
Anton Arapov 2021-04-03 12:58:10 +02:00 committed by Alan Daniels
commit 56de2bcd43
30691 changed files with 3076956 additions and 0 deletions

View file

@ -0,0 +1,51 @@
{ lib, fetchFromGitHub, fetchurl, pkg-config, cmake, python3, mkDerivation
, libX11, libXrandr, qtbase, qtwebchannel, qtwebengine, qtx11extras
, libvdpau, SDL2, mpv, libGL }:
let
# During compilation, a CMake bundle is downloaded from `artifacts.plex.tv`,
# which then downloads a handful of web client-related files. To enable
# sandboxed builds, we manually download them and save them so these files
# are fetched ahead-of-time instead of during the CMake build. To update
# plex-media-player use the update.sh script, so the versions and hashes
# for these files are are also updated!
depSrcs = import ./deps.nix { inherit fetchurl; };
in mkDerivation rec {
pname = "plex-media-player";
version = "2.58.1";
vsnHash = "ae73e074";
src = fetchFromGitHub {
owner = "plexinc";
repo = "plex-media-player";
rev = "v${version}-${vsnHash}";
sha256 = "1q20fdp5d0blb0q6p2357bwdc2g65cadkgdp4w533ij2nyaxydjd";
};
nativeBuildInputs = [ pkg-config cmake python3 ];
buildInputs = [ libX11 libXrandr qtbase qtwebchannel qtwebengine qtx11extras
libvdpau SDL2 mpv libGL ];
preConfigure = with depSrcs; ''
mkdir -p build/dependencies
ln -s ${webClient} build/dependencies/buildid-${webClientBuildId}.cmake
ln -s ${webClientDesktopHash} build/dependencies/web-client-desktop-${webClientDesktopBuildId}.tar.xz.sha1
ln -s ${webClientDesktop} build/dependencies/web-client-desktop-${webClientDesktopBuildId}.tar.xz
ln -s ${webClientTvHash} build/dependencies/web-client-tv-${webClientTvBuildId}.tar.xz.sha1
ln -s ${webClientTv} build/dependencies/web-client-tv-${webClientTvBuildId}.tar.xz
'';
cmakeFlags = [ "-DCMAKE_BUILD_TYPE=RelWithDebInfo" "-DQTROOT=${qtbase}" ];
# plexmediaplayer currently segfaults under wayland
qtWrapperArgs = [ "--set" "QT_QPA_PLATFORM" "xcb" ];
passthru.updateScript = ./update.sh;
meta = with lib; {
description = "Streaming media player for Plex";
license = licenses.gpl2;
maintainers = with maintainers; [ b4dm4n ];
homepage = "https://plex.tv";
mainProgram = "plexmediaplayer";
};
}

View file

@ -0,0 +1,28 @@
{ fetchurl }:
rec {
webClientBuildId = "183-045db5be50e175";
webClientDesktopBuildId = "4.29.2-e50e175";
webClientTvBuildId = "4.29.6-045db5b";
webClient = fetchurl {
url = "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/buildid.cmake";
sha256 = "1xsacy1xb8a9rfdrd7lvx7n3hd0cf2c3mgmg9wl18jvwnqxyac83";
};
webClientDesktopHash = fetchurl {
url = "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/web-client-desktop-${webClientDesktopBuildId}.tar.xz.sha1";
sha256 = "07spxyhrg45ppa2zjn3ri4qvi6qimlmq6wmh492r3jkrwd71rxgf";
};
webClientDesktop = fetchurl {
url = "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/web-client-desktop-${webClientDesktopBuildId}.tar.xz";
sha256 = "1zll79hpgx8fghx228li9qairfd637yf8rhvjzdgpq4dvn21fv65";
};
webClientTvHash = fetchurl {
url = "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/web-client-tv-${webClientTvBuildId}.tar.xz.sha1";
sha256 = "1zzfw2g76wqrxrx9kck5q79if78z91wn3awj703kz9sgxi4bkjsk";
};
webClientTv = fetchurl {
url = "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/web-client-tv-${webClientTvBuildId}.tar.xz";
sha256 = "1f1zvrr3c0w37gvl78blg9rgxxi64nc4iv5vd87qbysfh1vpsjz0";
};
}

View 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