Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plex-desktop: remove version number from name #345754

Merged
merged 2 commits into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 70 additions & 65 deletions pkgs/by-name/pl/plex-desktop/package.nix
detroyejr marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
{ alsa-lib
, autoPatchelfHook
, buildFHSEnv
, dbus
, elfutils
, expat
, extraEnv ? { }
, fetchFromGitLab
, fetchurl
, glib
, glibc
, lib
, libGL
, libapparmor
, libbsd
, libedit
, libffi_3_3
, libgcrypt
, libglvnd
, makeShellWrapper
, sqlite
, squashfsTools
, stdenv
, tcp_wrappers
, udev
, waylandpp
, writeShellScript
, xkeyboard_config
, xorg
, xz
, zstd
{
alsa-lib,
autoPatchelfHook,
buildFHSEnv,
dbus,
elfutils,
expat,
extraEnv ? { },
fetchFromGitLab,
fetchurl,
glib,
glibc,
lib,
libGL,
libapparmor,
libbsd,
libedit,
libffi_3_3,
libgcrypt,
libglvnd,
makeShellWrapper,
sqlite,
squashfsTools,
stdenv,
tcp_wrappers,
udev,
waylandpp,
writeShellScript,
xkeyboard_config,
xorg,
xz,
zstd,
}:
let
pname = "plex-desktop";
Expand Down Expand Up @@ -104,48 +105,52 @@ let

dontWrapQtApps = true;

installPhase =
''
runHook preInstall
installPhase = ''
runHook preInstall

cp -r . $out
cp -r . $out

ln -s ${libedit}/lib/libedit.so.0 $out/lib/libedit.so.2
rm $out/usr/lib/x86_64-linux-gnu/libasound.so.2
ln -s ${alsa-lib}/lib/libasound.so.2 $out/usr/lib/x86_64-linux-gnu/libasound.so.2
rm $out/usr/lib/x86_64-linux-gnu/libasound.so.2.0.0
ln -s ${alsa-lib}/lib/libasound.so.2.0.0 $out/usr/lib/x86_64-linux-gnu/libasound.so.2.0.0
ln -s ${libedit}/lib/libedit.so.0 $out/lib/libedit.so.2
rm $out/usr/lib/x86_64-linux-gnu/libasound.so.2
ln -s ${alsa-lib}/lib/libasound.so.2 $out/usr/lib/x86_64-linux-gnu/libasound.so.2
rm $out/usr/lib/x86_64-linux-gnu/libasound.so.2.0.0
ln -s ${alsa-lib}/lib/libasound.so.2.0.0 $out/usr/lib/x86_64-linux-gnu/libasound.so.2.0.0

runHook postInstall
'';
runHook postInstall
'';
};
in
buildFHSEnv {
name = "${pname}-${version}";
targetPkgs = pkgs: [ xkeyboard_config ];
inherit pname version meta;
targetPkgs = pkgs: [ xkeyboard_config ];

extraInstallCommands = ''
mkdir -p $out/share/applications $out/share/icons/hicolor/scalable/apps
install -m 444 -D ${plex-desktop}/meta/gui/plex-desktop.desktop $out/share/applications/plex-desktop.desktop
substituteInPlace $out/share/applications/plex-desktop.desktop \
--replace-fail \
'Icon=''${SNAP}/meta/gui/icon.png' \
'Icon=${plex-desktop}/meta/gui/icon.png' \
--replace-fail \
'Exec=plex-desktop' \
'Exec=plex-desktop-${version}'
'';
extraInstallCommands = ''
mkdir -p $out/share/applications $out/share/icons/hicolor/scalable/apps
install -m 444 -D ${plex-desktop}/meta/gui/plex-desktop.desktop $out/share/applications/plex-desktop.desktop
substituteInPlace $out/share/applications/plex-desktop.desktop \
--replace-fail \
'Icon=''${SNAP}/meta/gui/icon.png' \
'Icon=${plex-desktop}/meta/gui/icon.png' \
--replace-fail \
'Exec=plex-desktop' \
'Exec=plex-desktop-${version}'
'';

runScript = writeShellScript "plex-desktop.sh" ''
# Widevine won't download unless this directory exists.
mkdir -p $HOME/.cache/plex/
PLEX_USR_PATH=${lib.makeSearchPath "usr/lib/x86_64-linux-gnu" [ plex-desktop ]}
runScript = writeShellScript "plex-desktop.sh" ''
# Widevine won't download unless this directory exists.
mkdir -p $HOME/.cache/plex/
PLEX_USR_PATH=${lib.makeSearchPath "usr/lib/x86_64-linux-gnu" [ plex-desktop ]}

set -o allexport
LD_LIBRARY_PATH=${lib.makeLibraryPath [ plex-desktop libglvnd-1_4_0 ]}:$PLEX_USR_PATH
LIBGL_DRIVERS_PATH=$PLEX_USR_PATH/dri
${lib.toShellVars extraEnv}
exec ${plex-desktop}/Plex.sh
set -o allexport
LD_LIBRARY_PATH=${
lib.makeLibraryPath [
plex-desktop
libglvnd-1_4_0
]
}:$PLEX_USR_PATH
LIBGL_DRIVERS_PATH=$PLEX_USR_PATH/dri
${lib.toShellVars extraEnv}
exec ${plex-desktop}/Plex.sh
'';
passthru.updateScript = ./update.sh;
detroyejr marked this conversation as resolved.
Show resolved Hide resolved
}

1 change: 1 addition & 0 deletions pkgs/by-name/pl/plex-desktop/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ sed --regexp-extended \
# try to build the updated version
#

export NIXPKGS_ALLOW_UNFREE=1
detroyejr marked this conversation as resolved.
Show resolved Hide resolved
if ! nix-build -A plex-desktop "$nixpkgs"; then
echo "The updated plex-desktop failed to build."
exit 1
Expand Down