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