diff options
Diffstat (limited to 'pkgs/by-name/pl')
-rw-r--r-- | pkgs/by-name/pl/plandex-server/package.nix | 40 | ||||
-rw-r--r-- | pkgs/by-name/pl/plandex/package.nix | 28 | ||||
-rw-r--r-- | pkgs/by-name/pl/plasma-panel-colorizer/package.nix | 36 | ||||
-rw-r--r-- | pkgs/by-name/pl/plasma-plugin-blurredwallpaper/package.nix | 39 | ||||
-rw-r--r-- | pkgs/by-name/pl/plasmusic-toolbar/package.nix | 35 | ||||
-rw-r--r-- | pkgs/by-name/pl/plasticity/package.nix | 4 | ||||
-rw-r--r-- | pkgs/by-name/pl/platformsh/package.nix | 37 | ||||
-rwxr-xr-x | pkgs/by-name/pl/platformsh/update.sh | 29 | ||||
-rw-r--r-- | pkgs/by-name/pl/platformsh/versions.json | 19 | ||||
-rw-r--r-- | pkgs/by-name/pl/plemoljp-hs/package.nix | 8 | ||||
-rw-r--r-- | pkgs/by-name/pl/plemoljp-nf/package.nix | 4 | ||||
-rw-r--r-- | pkgs/by-name/pl/plemoljp/package.nix | 8 | ||||
-rw-r--r-- | pkgs/by-name/pl/plex-desktop/package.nix | 151 | ||||
-rwxr-xr-x | pkgs/by-name/pl/plex-desktop/update.sh | 83 | ||||
-rw-r--r-- | pkgs/by-name/pl/pls/package.nix | 6 |
15 files changed, 490 insertions, 37 deletions
diff --git a/pkgs/by-name/pl/plandex-server/package.nix b/pkgs/by-name/pl/plandex-server/package.nix new file mode 100644 index 0000000000000..a1d0c846eb588 --- /dev/null +++ b/pkgs/by-name/pl/plandex-server/package.nix @@ -0,0 +1,40 @@ +{ + lib, + buildGoModule, + fetchFromGitHub, + git, +}: +buildGoModule rec { + pname = "plandex-server"; + version = "1.1.1"; + + src = fetchFromGitHub { + owner = "plandex-ai"; + repo = "plandex"; + rev = "server/v${version}"; + hash = "sha256-RVvgnQtb/asOjVpSZ3WndimsJ6foERMWS/YD20sghVE="; + }; + + postPatch = '' + substituteInPlace db/db.go \ + --replace-fail "file://migrations" "file://$out/migrations" + ''; + + postInstall = '' + cp -r migrations $out/migrations + ''; + + nativeCheckInputs = [ git ]; + + sourceRoot = "${src.name}/app/server"; + + vendorHash = "sha256-uarTWteOoAjzEHSnbZo+fEPELerpuL7UNA5pdGP5CMY="; + + meta = { + mainProgram = "plandex-server"; + description = "AI driven development in your terminal. Designed for large, real-world tasks. The server part"; + homepage = "https://plandex.ai/"; + license = lib.licenses.agpl3Only; + maintainers = with lib.maintainers; [ viraptor ]; + }; +} diff --git a/pkgs/by-name/pl/plandex/package.nix b/pkgs/by-name/pl/plandex/package.nix new file mode 100644 index 0000000000000..e0652aa8470fa --- /dev/null +++ b/pkgs/by-name/pl/plandex/package.nix @@ -0,0 +1,28 @@ +{ + lib, + buildGoModule, + fetchFromGitHub, +}: +buildGoModule rec { + pname = "plandex"; + version = "1.1.1"; + + src = fetchFromGitHub { + owner = "plandex-ai"; + repo = "plandex"; + rev = "cli/v${version}"; + hash = "sha256-q3DBkYmZxgrdlEUdGgFCf5IR17lKmYp7U5BD/4GXxjo="; + }; + + sourceRoot = "${src.name}/app/cli"; + + vendorHash = "sha256-aFfgXGRnsqS7Ik5geQ6yXL+8X0BfNhHGzF7GKIDC4iE="; + + meta = { + mainProgram = "plandex"; + description = "AI driven development in your terminal. Designed for large, real-world tasks. The sli part"; + homepage = "https://plandex.ai/"; + license = lib.licenses.agpl3Only; + maintainers = with lib.maintainers; [ viraptor ]; + }; +} diff --git a/pkgs/by-name/pl/plasma-panel-colorizer/package.nix b/pkgs/by-name/pl/plasma-panel-colorizer/package.nix new file mode 100644 index 0000000000000..2ee82abcf42af --- /dev/null +++ b/pkgs/by-name/pl/plasma-panel-colorizer/package.nix @@ -0,0 +1,36 @@ +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + kdePackages, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "plasma-panel-colorizer"; + version = "0.5.2"; + + src = fetchFromGitHub { + owner = "luisbocanegra"; + repo = "plasma-panel-colorizer"; + rev = "refs/tags/v${finalAttrs.version}"; + hash = "sha256-+JweNB+zjbXh6Htyvu2vgogAr5Fl5wDPCpm6GV18NJ0="; + }; + + nativeBuildInputs = [ + cmake + kdePackages.extra-cmake-modules + kdePackages.plasma-desktop + ]; + + dontWrapQtApps = true; + + meta = { + description = "Fully-featured widget to bring Latte-Dock and WM status bar customization features to the default KDE Plasma panel"; + homepage = "https://github.com/luisbocanegra/plasma-panel-colorizer"; + changelog = "https://github.com/luisbocanegra/plasma-panel-colorizer/blob/main/CHANGELOG.md"; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ HeitorAugustoLN ]; + inherit (kdePackages.kwindowsystem.meta) platforms; + }; +}) diff --git a/pkgs/by-name/pl/plasma-plugin-blurredwallpaper/package.nix b/pkgs/by-name/pl/plasma-plugin-blurredwallpaper/package.nix new file mode 100644 index 0000000000000..b6fc12d6484a3 --- /dev/null +++ b/pkgs/by-name/pl/plasma-plugin-blurredwallpaper/package.nix @@ -0,0 +1,39 @@ +{ + lib, + stdenvNoCC, + fetchFromGitHub, + nix-update-script, +}: +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "plasma-plugin-blurredwallpaper"; + version = "3.1.0"; + + src = fetchFromGitHub { + owner = "bouteillerAlan"; + repo = "blurredwallpaper"; + rev = "v${finalAttrs.version}"; + hash = "sha256-+MjnVsGHqitQytxiAH39Kx9SXuTEFfIC14Ayzu4yE4I="; + }; + + installPhase = '' + runHook preInstall + install -d $out/share/plasma/wallpapers/a2n.blur{,.plasma5} + cp -r a2n.blur{,.plasma5} $out/share/plasma/wallpapers/ + runHook postInstall + ''; + + passthru = { + updateScript = nix-update-script { }; + }; + + meta = { + description = "Plasma 6 wallpaper plugin to blur the wallpaper of active window"; + homepage = "https://github.com/bouteillerAlan/blurredwallpaper"; + license = lib.licenses.gpl3; + maintainers = with lib.maintainers; [ + dr460nf1r3 + johnrtitor + ]; + platforms = lib.platforms.linux; + }; +}) diff --git a/pkgs/by-name/pl/plasmusic-toolbar/package.nix b/pkgs/by-name/pl/plasmusic-toolbar/package.nix new file mode 100644 index 0000000000000..73afe152d627d --- /dev/null +++ b/pkgs/by-name/pl/plasmusic-toolbar/package.nix @@ -0,0 +1,35 @@ +{ lib +, stdenv +, fetchFromGitHub +, kdePackages +, nix-update-script +}: +stdenv.mkDerivation (finalAttrs: { + pname = "plasmusic-toolbar"; + version = "1.5.0"; + + src = fetchFromGitHub { + owner = "ccatterina"; + repo = "plasmusic-toolbar"; + rev = "v${finalAttrs.version}"; + hash = "sha256-22eSrvigJHmwVB396APkDtiJjavpijUMuZ4mqQGVwf4="; + }; + + installPhase = '' + runHook preInstall + mkdir -p $out/share/plasma/plasmoids/plasmusic-toolbar + cp -r src/* $out/share/plasma/plasmoids/plasmusic-toolbar + runHook postInstall + ''; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "KDE Plasma widget that shows currently playing song information and provide playback controls."; + homepage = "https://github.com/ccatterina/plasmusic-toolbar"; + changelog = "https://github.com/ccatterina/plasmusic-toolbar/releases/tag/${finalAttrs.src.rev}"; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ HeitorAugustoLN ]; + inherit (kdePackages.kwindowsystem.meta) platforms; + }; +}) diff --git a/pkgs/by-name/pl/plasticity/package.nix b/pkgs/by-name/pl/plasticity/package.nix index 84584bf421885..dcc33000da72a 100644 --- a/pkgs/by-name/pl/plasticity/package.nix +++ b/pkgs/by-name/pl/plasticity/package.nix @@ -33,11 +33,11 @@ }: stdenv.mkDerivation rec { pname = "plasticity"; - version = "24.1.6"; + version = "24.1.8"; src = fetchurl { url = "https://github.com/nkallen/plasticity/releases/download/v${version}/Plasticity-${version}-1.x86_64.rpm"; - hash = "sha256-gGfDsAqg0PkORrOEvBWLpKgLv5a+M9Rj+oC+jF1gYqA="; + hash = "sha256-Hh1yf3JqzMEvorWztLvoTcnDAk48cNe7NcCLrvNQCzo="; }; passthru.updateScript = ./update.sh; diff --git a/pkgs/by-name/pl/platformsh/package.nix b/pkgs/by-name/pl/platformsh/package.nix index 2b0387ad1b89d..683e34a87a0b5 100644 --- a/pkgs/by-name/pl/platformsh/package.nix +++ b/pkgs/by-name/pl/platformsh/package.nix @@ -7,33 +7,25 @@ platformsh }: +let versions = lib.importJSON ./versions.json; + arch = if stdenvNoCC.isx86_64 then "amd64" + else if stdenvNoCC.isAarch64 then "arm64" + else throw "Unsupported architecture"; + os = if stdenvNoCC.isLinux then "linux" + else if stdenvNoCC.isDarwin then "darwin" + else throw "Unsupported os"; + versionInfo = versions."${os}-${arch}"; + inherit (versionInfo) hash url; + +in stdenvNoCC.mkDerivation (finalAttrs: { pname = "platformsh"; - version = "5.0.13"; + inherit (versions) version; nativeBuildInputs = [ installShellFiles ]; - src = - { - x86_64-darwin = fetchurl { - url = "https://github.com/platformsh/cli/releases/download/${finalAttrs.version}/platform_${finalAttrs.version}_darwin_all.tar.gz"; - hash = "sha256-dCo5+de+9hXxrv+uPn0UoAh4UfSv+PyR2z/ytpfby0g="; - }; - aarch64-darwin = fetchurl { - url = "https://github.com/platformsh/cli/releases/download/${finalAttrs.version}/platform_${finalAttrs.version}_darwin_all.tar.gz"; - hash = "sha256-dCo5+de+9hXxrv+uPn0UoAh4UfSv+PyR2z/ytpfby0g="; - }; - x86_64-linux = fetchurl { - url = "https://github.com/platformsh/cli/releases/download/${finalAttrs.version}/platform_${finalAttrs.version}_linux_amd64.tar.gz"; - hash = "sha256-JP0RCqNQ8V4sFP3645MW+Pd9QfPFRAuTbVPIK6WD6PQ="; - }; - aarch64-linux = fetchurl { - url = "https://github.com/platformsh/cli/releases/download/${finalAttrs.version}/platform_${finalAttrs.version}_linux_arm64.tar.gz"; - hash = "sha256-vpk093kpGAmMevd4SVr3KSIjUXUqt3yWDZFHOVxu9rw="; - }; - } - .${stdenvNoCC.system} - or (throw "${finalAttrs.pname}-${finalAttrs.version}: ${stdenvNoCC.system} is unsupported."); + # run ./update + src = fetchurl { inherit hash url; }; dontConfigure = true; dontBuild = true; @@ -51,6 +43,7 @@ stdenvNoCC.mkDerivation (finalAttrs: { ''; passthru = { + updateScript = ./update.sh; tests.version = testers.testVersion { inherit (finalAttrs) version; package = platformsh; diff --git a/pkgs/by-name/pl/platformsh/update.sh b/pkgs/by-name/pl/platformsh/update.sh new file mode 100755 index 0000000000000..a5df69f2970b2 --- /dev/null +++ b/pkgs/by-name/pl/platformsh/update.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p curl jq +#shellcheck shell=bash + +set -eu -o pipefail + +version=$(curl -s ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \ + https://api.github.com/repos/platformsh/cli/releases/latest | jq -e -r ".tag_name") + +linux_arm64_url=https://github.com/platformsh/cli/releases/download/$version/platform_${version}_linux_arm64.tar.gz +linux_amd64_url=https://github.com/platformsh/cli/releases/download/$version/platform_${version}_linux_amd64.tar.gz +darwin_all_url=https://github.com/platformsh/cli/releases/download/$version/platform_${version}_darwin_all.tar.gz +linux_arm64_hash=$(nix hash to-sri --type sha256 $(nix-prefetch-url --type sha256 "$linux_arm64_url")) +linux_amd64_hash=$(nix hash to-sri --type sha256 $(nix-prefetch-url --type sha256 "$linux_amd64_url")) +darwin_all_hash=$(nix hash to-sri --type sha256 $(nix-prefetch-url --type sha256 "$darwin_all_url")) +jq -n \ + --arg version "$version" \ + --arg darwin_all_hash "$darwin_all_hash" \ + --arg darwin_all_url "$darwin_all_url" \ + --arg linux_amd64_hash "$linux_amd64_hash" \ + --arg linux_amd64_url "$linux_amd64_url" \ + --arg linux_arm64_hash "$linux_arm64_hash" \ + --arg linux_arm64_url "$linux_arm64_url" \ + '{ "version": $version, + "darwin-amd64": { "hash": $darwin_all_hash, "url": $darwin_all_url }, + "darwin-arm64": { "hash": $darwin_all_hash, "url": $darwin_all_url }, + "linux-amd64": { "hash": $linux_amd64_hash, "url": $linux_amd64_url }, + "linux-arm64": { "hash": $linux_arm64_hash, "url": $linux_arm64_url } +}' > pkgs/by-name/pl/platformsh/versions.json diff --git a/pkgs/by-name/pl/platformsh/versions.json b/pkgs/by-name/pl/platformsh/versions.json new file mode 100644 index 0000000000000..9fcf186237981 --- /dev/null +++ b/pkgs/by-name/pl/platformsh/versions.json @@ -0,0 +1,19 @@ +{ + "version": "5.0.19", + "darwin-amd64": { + "hash": "sha256-PGld4gvUnB5I++vPQjEFWp7XRowi4fRfLL6wSzdyaAY=", + "url": "https://github.com/platformsh/cli/releases/download/5.0.19/platform_5.0.19_darwin_all.tar.gz" + }, + "darwin-arm64": { + "hash": "sha256-PGld4gvUnB5I++vPQjEFWp7XRowi4fRfLL6wSzdyaAY=", + "url": "https://github.com/platformsh/cli/releases/download/5.0.19/platform_5.0.19_darwin_all.tar.gz" + }, + "linux-amd64": { + "hash": "sha256-UtyN/0UolohIVtrxGcKieHZfoRDJhjRApq+Mm44LjSo=", + "url": "https://github.com/platformsh/cli/releases/download/5.0.19/platform_5.0.19_linux_amd64.tar.gz" + }, + "linux-arm64": { + "hash": "sha256-upMEN/c3hxuFlocelC1hX/Nia02Jeg3+VWPsA48kjhs=", + "url": "https://github.com/platformsh/cli/releases/download/5.0.19/platform_5.0.19_linux_arm64.tar.gz" + } +} diff --git a/pkgs/by-name/pl/plemoljp-hs/package.nix b/pkgs/by-name/pl/plemoljp-hs/package.nix index fe94bdc0a1479..e96b554726374 100644 --- a/pkgs/by-name/pl/plemoljp-hs/package.nix +++ b/pkgs/by-name/pl/plemoljp-hs/package.nix @@ -12,10 +12,10 @@ stdenvNoCC.mkDerivation rec { installPhase = '' runHook preInstall - install -Dm444 PlemolJP_HS/*.ttf -t $out/share/fonts/truetype/${pname} - install -Dm444 PlemolJP35_HS/*.ttf -t $out/share/fonts/truetype/${pname}-35 - install -Dm444 PlemolJPConsole_HS/*.ttf -t $out/share/fonts/truetype/${pname}-console - install -Dm444 PlemolJP35Console_HS/*.ttf -t $out/share/fonts/truetype/${pname}-35console + install -Dm444 PlemolJP_HS/*.ttf -t $out/share/fonts/truetype/plemoljp-hs + install -Dm444 PlemolJP35_HS/*.ttf -t $out/share/fonts/truetype/plemoljp-hs-35 + install -Dm444 PlemolJPConsole_HS/*.ttf -t $out/share/fonts/truetype/plemoljp-hs-console + install -Dm444 PlemolJP35Console_HS/*.ttf -t $out/share/fonts/truetype/plemoljp-hs-35console runHook postInstall ''; diff --git a/pkgs/by-name/pl/plemoljp-nf/package.nix b/pkgs/by-name/pl/plemoljp-nf/package.nix index 40687bb720f9c..c4675319ec0e6 100644 --- a/pkgs/by-name/pl/plemoljp-nf/package.nix +++ b/pkgs/by-name/pl/plemoljp-nf/package.nix @@ -12,8 +12,8 @@ stdenvNoCC.mkDerivation rec { installPhase = '' runHook preInstall - install -Dm444 PlemolJPConsole_NF/*.ttf -t $out/share/fonts/truetype/${pname}-console - install -Dm444 PlemolJP35Console_NF/*.ttf -t $out/share/fonts/truetype/${pname}-35console + install -Dm444 PlemolJPConsole_NF/*.ttf -t $out/share/fonts/truetype/plemoljp-nf-console + install -Dm444 PlemolJP35Console_NF/*.ttf -t $out/share/fonts/truetype/plemoljp-nf-35console runHook postInstall ''; diff --git a/pkgs/by-name/pl/plemoljp/package.nix b/pkgs/by-name/pl/plemoljp/package.nix index 43472cb743e0c..8f7f092de310c 100644 --- a/pkgs/by-name/pl/plemoljp/package.nix +++ b/pkgs/by-name/pl/plemoljp/package.nix @@ -12,10 +12,10 @@ stdenvNoCC.mkDerivation rec { installPhase = '' runHook preInstall - install -Dm444 PlemolJP/*.ttf -t $out/share/fonts/truetype/${pname} - install -Dm444 PlemolJP35/*.ttf -t $out/share/fonts/truetype/${pname}-35 - install -Dm444 PlemolJPConsole/*.ttf -t $out/share/fonts/truetype/${pname}-console - install -Dm444 PlemolJP35Console/*.ttf -t $out/share/fonts/truetype/${pname}-35console + install -Dm444 PlemolJP/*.ttf -t $out/share/fonts/truetype/plemoljp + install -Dm444 PlemolJP35/*.ttf -t $out/share/fonts/truetype/plemoljp-35 + install -Dm444 PlemolJPConsole/*.ttf -t $out/share/fonts/truetype/plemoljp-console + install -Dm444 PlemolJP35Console/*.ttf -t $out/share/fonts/truetype/plemoljp-35console runHook postInstall ''; diff --git a/pkgs/by-name/pl/plex-desktop/package.nix b/pkgs/by-name/pl/plex-desktop/package.nix new file mode 100644 index 0000000000000..50080c0153c96 --- /dev/null +++ b/pkgs/by-name/pl/plex-desktop/package.nix @@ -0,0 +1,151 @@ +{ 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"; + version = "1.96.0"; + rev = "69"; + meta = { + homepage = "https://plex.tv/"; + description = "Streaming media player for Plex"; + longDescription = '' + Plex for Linux is your client for playback on the Linux + desktop. It features the point and click interface you see in your browser + but uses a more powerful playback engine as well as + some other advance features. + ''; + maintainers = with lib.maintainers; [ detroyejr ]; + license = lib.licenses.unfree; + platforms = [ "x86_64-linux" ]; + mainProgram = "plex-desktop"; + }; + + # The latest unstable version isn't compatible with libraries that ship in the snap. + libglvnd-1_4_0 = libglvnd.overrideAttrs { + src = fetchFromGitLab { + domain = "gitlab.freedesktop.org"; + owner = "glvnd"; + repo = "libglvnd"; + rev = "v1.4.0"; + sha256 = "sha256-Y6JHRygXcZtnrdnqi1Lzyvh/635gwZWnMeW9aRCpxxs"; + }; + }; + plex-desktop = stdenv.mkDerivation { + inherit pname version meta; + + src = fetchurl { + url = "https://api.snapcraft.io/api/v1/snaps/download/qc6MFRM433ZhI1XjVzErdHivhSOhlpf0_${rev}.snap"; + hash = "sha512-rECc8rK1ENAL5mXdabO8ynudCaSzz0yygOyg4gMbCtddgqwSOanP24/oguzPLr3zdRMC3VSf9B3hr2BGQ54tzg=="; + }; + + nativeBuildInputs = [ squashfsTools ]; + + buildInputs = [ + alsa-lib + autoPatchelfHook + dbus + elfutils + expat + glib + glibc + libGL + libapparmor + libbsd + libedit + libffi_3_3 + libgcrypt + makeShellWrapper + sqlite + squashfsTools + stdenv.cc.cc + tcp_wrappers + udev + waylandpp + xorg.libXinerama + xz + zstd + ]; + + unpackPhase = '' + runHook preUnpack + unsquashfs "$src" + cd squashfs-root + runHook postUnpack + ''; + + dontWrapQtApps = true; + + installPhase = + '' + runHook preInstall + + 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 + + runHook postInstall + ''; + }; +in +buildFHSEnv { + name = "${pname}-${version}"; + 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}' + ''; + + 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 + ''; +} + diff --git a/pkgs/by-name/pl/plex-desktop/update.sh b/pkgs/by-name/pl/plex-desktop/update.sh new file mode 100755 index 0000000000000..0cc509fb2b729 --- /dev/null +++ b/pkgs/by-name/pl/plex-desktop/update.sh @@ -0,0 +1,83 @@ +#!/usr/bin/env nix-shell +#! nix-shell -i bash -p curl jq git gnused gnugrep + + +# executing this script without arguments will +# - find the newest stable plex-desktop version avaiable on snapcraft (https://snapcraft.io/plex-desktop) +# - read the current plex-desktop version from the current nix expression +# - update the nix expression if the versions differ +# - try to build the updated version, exit if that fails +# - give instructions for upstreaming + +# As an optional argument you can specify the snapcraft channel to update to. +# Default is `stable` and only stable updates should be pushed to nixpkgs. For +# testing you may specify `candidate` or `edge`. + + +channel="${1:-stable}" # stable/candidate/edge +nixpkgs="$(git rev-parse --show-toplevel)" +plex_nix="$nixpkgs/pkgs/by-name/pl/plex-desktop/package.nix" + + +# +# find the newest stable plex-desktop version avaiable on snapcraft +# + +# create bash array from snap info +snap_info=($( + curl -s -H 'X-Ubuntu-Series: 16' \ + "https://api.snapcraft.io/api/v1/snaps/details/plex-desktop?channel=$channel" \ + | jq --raw-output \ + '.revision,.download_sha512,.version,.last_updated' +)) + +# "revision" is the actual version identifier on snapcraft, the "version" is +# just for human consumption. Revision is just an integer that gets increased +# by one every (stable or unstable) release. +revision="${snap_info[0]}" +# We need to escape the slashes +hash="$(nix-hash --to-sri --type sha512 ${snap_info[1]} | sed 's|/|\\/|g')" +upstream_version="${snap_info[2]}" +last_updated="${snap_info[3]}" +echo "Latest $channel release is $upstream_version from $last_updated." +# +# read the current plex-desktop version from the currently *committed* nix expression +# + +current_version=$( + grep 'version\s*=' "$plex_nix" \ + | sed -Ene 's/.*"(.*)".*/\1/p' +) + +echo "Current version: $current_version" + +# +# update the nix expression if the versions differ +# + +if [[ "$current_version" == "$upstream_version" ]]; then + echo "Plex is already up-to-date" + exit 0 +fi + +echo "Updating from ${current_version} to ${upstream_version}, released on ${last_updated}" + +# search-and-replace revision, hash and version +sed --regexp-extended \ + -e 's/rev\s*=\s*"[0-9]+"\s*;/rev = "'"${revision}"'";/' \ + -e 's/hash\s*=\s*"[^"]*"\s*;/hash = "'"${hash}"'";/' \ + -e 's/version\s*=\s*".*"\s*;/version = "'"${upstream_version}"'";/' \ + -i "$plex_nix" + +# +# try to build the updated version +# + +if ! nix-build -A plex-desktop "$nixpkgs"; then + echo "The updated plex-desktop failed to build." + exit 1 +fi + +# Commit changes +git add "$plex_nix" +git commit -m "plex-desktop: ${current_version} -> ${upstream_version}" diff --git a/pkgs/by-name/pl/pls/package.nix b/pkgs/by-name/pl/pls/package.nix index eca50c8c7a5bf..1db958dcf6be4 100644 --- a/pkgs/by-name/pl/pls/package.nix +++ b/pkgs/by-name/pl/pls/package.nix @@ -7,16 +7,16 @@ rustPlatform.buildRustPackage rec { pname = "pls"; - version = "0.0.1-beta.6"; + version = "0.0.1-beta.7"; src = fetchFromGitHub { owner = "pls-rs"; repo = "pls"; rev = "v${version}"; - hash = "sha256-T+OUvupPXg9dEV9GJozEyDLKqBkeH6UFYuSxX2BTZkM="; + hash = "sha256-X4HGVwBZdDXH5RuBiugEd4I+aXRqZvXoRDZnm8GY3cM="; }; - cargoHash = "sha256-bo6tySTgGYO+TedBLGwvk+HZmO0KvJEal/eHGSZlp7c="; + cargoHash = "sha256-d6HfIEROudINn2Jbnc3EEDZCD833FFFeUk6mvlu0ErA="; buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security |