plex: Add aarch64 platform

This commit is contained in:
Samir Hafez 2020-11-26 08:45:16 +00:00
parent 7e26b5456d
commit d92396d06a
No known key found for this signature in database
GPG key ID: 95806A3539FE7066

View file

@ -1,6 +1,6 @@
{ stdenv
, fetchurl
, rpmextract
, dpkg
}:
# The raw package that fetches and extracts the Plex RPM. Override the source
@ -12,19 +12,22 @@ stdenv.mkDerivation rec {
pname = "plexmediaserver";
# Fetch the source
src = fetchurl {
url = "https://downloads.plex.tv/plex-media-server-new/${version}/redhat/plexmediaserver-${version}.x86_64.rpm";
sha256 = "0vqsmmgqcvvhxiqaw87qz9fdisyf9smp6ab069dz3nq39x7n9na0";
src = if stdenv.hostPlatform.system == "aarch64-linux" then fetchurl {
url = "https://downloads.plex.tv/plex-media-server-new/${version}/debian/plexmediaserver_${version}_arm64.deb";
sha256 = "18zj4baa085gbgc0y5gx7gnwzl131xyk34m5xcipfvfb434y98cp";
} else fetchurl {
url = "https://downloads.plex.tv/plex-media-server-new/${version}/debian/plexmediaserver_${version}_amd64.deb";
sha256 = "01rq2q6avjsvnns7jsd2a9vnmd4584fwdkp833gjgrrrqkf6h45y";
};
outputs = [ "out" "basedb" ];
nativeBuildInputs = [ rpmextract ];
nativeBuildInputs = [ dpkg ];
phases = [ "unpackPhase" "installPhase" "fixupPhase" "distPhase" ];
unpackPhase = ''
rpmextract $src
dpkg-deb -R $src .
'';
installPhase = ''
@ -52,7 +55,7 @@ stdenv.mkDerivation rec {
meta = with stdenv.lib; {
homepage = "https://plex.tv/";
license = licenses.unfree;
platforms = platforms.linux;
platforms = [ "x86_64-linux" "aarch64-linux" ];
maintainers = with maintainers; [
badmutex
colemickens