2024-04-21 15:54:59 +00:00
{ stdenvNoCC
, lib
, fetchurl
, autoPatchelfHook
2024-10-04 16:56:33 +00:00
, buildPackages
2024-07-27 06:49:29 +00:00
, gnome-keyring
2024-04-21 15:54:59 +00:00
, libsecret
, git
, curl
, nss
, nspr
, xorg
, libdrm
, alsa-lib
, cups
, mesa
, systemd
, openssl
2024-06-05 15:53:02 +00:00
, libglvnd
2024-04-21 15:54:59 +00:00
} :
let
2024-07-27 06:49:29 +00:00
rcversion = " 1 " ;
2024-04-21 15:54:59 +00:00
in
stdenvNoCC . mkDerivation ( finalAttrs : {
pname = " g i t h u b - d e s k t o p " ;
2024-07-27 06:49:29 +00:00
version = " 3 . 4 . 2 " ;
2024-04-21 15:54:59 +00:00
src =
let
urls = {
" x 8 6 _ 6 4 - l i n u x " = {
url = " h t t p s : / / g i t h u b . c o m / s h i f t k e y / d e s k t o p / r e l e a s e s / d o w n l o a d / r e l e a s e - ${ finalAttrs . version } - l i n u x ${ rcversion } / G i t H u b D e s k t o p - l i n u x - a m d 6 4 - ${ finalAttrs . version } - l i n u x ${ rcversion } . d e b " ;
2024-07-27 06:49:29 +00:00
hash = " s h a 2 5 6 - q Y 5 r C v O g f 1 / Z 0 0 X Z 6 y A n 6 z K d U Z + 6 l 4 P C t h P U 4 4 X L K h c = " ;
2024-04-21 15:54:59 +00:00
} ;
" a a r c h 6 4 - l i n u x " = {
url = " h t t p s : / / g i t h u b . c o m / s h i f t k e y / d e s k t o p / r e l e a s e s / d o w n l o a d / r e l e a s e - ${ finalAttrs . version } - l i n u x ${ rcversion } / G i t H u b D e s k t o p - l i n u x - a r m 6 4 - ${ finalAttrs . version } - l i n u x ${ rcversion } . d e b " ;
2024-07-27 06:49:29 +00:00
hash = " s h a 2 5 6 - V b P j T z 4 x Y G a V O 3 u O G 6 l Q N Q r V E m x 3 + H / + y 8 + r 0 O 5 5 a U g = " ;
2024-04-21 15:54:59 +00:00
} ;
} ;
in
fetchurl urls . " ${ stdenvNoCC . hostPlatform . system } " or ( throw " U n s u p p o r t e d s y s t e m : ${ stdenvNoCC . hostPlatform . system } " ) ;
nativeBuildInputs = [
autoPatchelfHook
2024-10-04 16:56:33 +00:00
# override doesn't preserve splicing https://github.com/NixOS/nixpkgs/issues/132651
# Has to use `makeShellWrapper` from `buildPackages` even though `makeShellWrapper` from the inputs is spliced because `propagatedBuildInputs` would pick the wrong one because of a different offset.
( buildPackages . wrapGAppsHook3 . override { makeWrapper = buildPackages . makeShellWrapper ; } )
2024-04-21 15:54:59 +00:00
] ;
buildInputs = [
2024-07-27 06:49:29 +00:00
gnome-keyring
2024-04-21 15:54:59 +00:00
xorg . libXdamage
xorg . libX11
libsecret
git
curl
nss
nspr
libdrm
alsa-lib
cups
mesa
openssl
] ;
unpackPhase = ''
runHook preUnpack
mkdir - p $ TMP/github-desktop $ out / { opt , bin }
cp $ src $ TMP/github-desktop.deb
ar vx github-desktop . deb
tar - - no-overwrite-dir - xvf data . tar . xz - C $ TMP/github-desktop /
runHook postUnpack
'' ;
installPhase = ''
runHook preInstall
cp - R $ TMP/github-desktop/usr/share $ out /
cp - R $ TMP/github-desktop/usr/lib/github-desktop /* $ o u t / o p t /
ln - sf $ out/opt/github-desktop $ out/bin/github-desktop
runHook postInstall
'' ;
preFixup = ''
gappsWrapperArgs + = (
- - add-flags " \' ' ${ NIXOS_OZONE_WL : + \ '' ${ WAYLAND_DISPLAY : + - - ozone-platform = wayland } } "
2024-06-05 15:53:02 +00:00
- - prefix LD_LIBRARY_PATH : $ { lib . makeLibraryPath [ libglvnd ] }
2024-04-21 15:54:59 +00:00
)
'' ;
runtimeDependencies = [
( lib . getLib systemd )
] ;
meta = {
2024-06-20 14:57:18 +00:00
description = " G U I f o r m a n a g i n g G i t a n d G i t H u b " ;
2024-04-21 15:54:59 +00:00
homepage = " h t t p s : / / d e s k t o p . g i t h u b . c o m / " ;
license = lib . licenses . mit ;
mainProgram = " g i t h u b - d e s k t o p " ;
maintainers = with lib . maintainers ; [ dan4ik605743 ] ;
platforms = lib . platforms . linux ;
sourceProvenance = with lib . sourceTypes ; [ binaryNativeCode ] ;
} ;
} )