github-desktop: switch to finalAttrs pattern

This commit is contained in:
Pol Dellaiera 2023-07-28 11:27:18 +02:00
parent 8cacc05fbf
commit f3615998ac
No known key found for this signature in database
GPG Key ID: D476DFE9C67467CA

View File

@ -19,12 +19,12 @@
, openssl , openssl
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation (finalAttrs: {
pname = "github-desktop"; pname = "github-desktop";
version = "3.2.1"; version = "3.2.1";
src = fetchurl { src = fetchurl {
url = "https://github.com/shiftkey/desktop/releases/download/release-${version}-linux1/GitHubDesktop-linux-${version}-linux1.deb"; url = "https://github.com/shiftkey/desktop/releases/download/release-${finalAttrs.version}-linux1/GitHubDesktop-linux-${finalAttrs.version}-linux1.deb";
hash = "sha256-OdvebRvOTyadgNjzrv6CGDPkljfpo4RVvVAc+X9hjSo="; hash = "sha256-OdvebRvOTyadgNjzrv6CGDPkljfpo4RVvVAc+X9hjSo=";
}; };
@ -50,16 +50,16 @@ stdenv.mkDerivation rec {
]; ];
unpackPhase = '' unpackPhase = ''
mkdir -p $TMP/${pname} $out/{opt,bin} mkdir -p $TMP/${finalAttrs.pname} $out/{opt,bin}
cp $src $TMP/${pname}.deb cp $src $TMP/${finalAttrs.pname}.deb
ar vx ${pname}.deb ar vx ${finalAttrs.pname}.deb
tar --no-overwrite-dir -xvf data.tar.xz -C $TMP/${pname}/ tar --no-overwrite-dir -xvf data.tar.xz -C $TMP/${finalAttrs.pname}/
''; '';
installPhase = '' installPhase = ''
cp -R $TMP/${pname}/usr/share $out/ cp -R $TMP/${finalAttrs.pname}/usr/share $out/
cp -R $TMP/${pname}/usr/lib/${pname}/* $out/opt/ cp -R $TMP/${finalAttrs.pname}/usr/lib/${finalAttrs.pname}/* $out/opt/
ln -sf $out/opt/${pname} $out/bin/${pname} ln -sf $out/opt/${finalAttrs.pname} $out/bin/${finalAttrs.pname}
''; '';
preFixup = '' preFixup = ''
@ -72,12 +72,12 @@ stdenv.mkDerivation rec {
(lib.getLib systemd) (lib.getLib systemd)
]; ];
meta = with lib; { meta = {
description = "GUI for managing Git and GitHub."; description = "GUI for managing Git and GitHub.";
homepage = "https://desktop.github.com/"; homepage = "https://desktop.github.com/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ]; sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
license = licenses.mit; license = lib.licenses.mit;
maintainers = with maintainers; [ dan4ik605743 ]; maintainers = with lib.maintainers; [ dan4ik605743 ];
platforms = platforms.linux; platforms = lib.platforms.linux;
}; };
} })