2015-11-08 22:39:57 +03:00
{ stdenv
2017-10-23 19:53:11 +03:00
, lib
2018-06-29 23:24:04 +03:00
, fetchurl
2015-11-08 22:39:57 +03:00
, requireFile
, makeWrapper
, libredirect
, busybox
, file
, makeDesktopItem
, tzdata
, cacert
, glib
2016-09-12 00:24:51 +03:00
, gtk2
2015-11-08 22:39:57 +03:00
, atk
, gdk_pixbuf
, cairo
, pango
, gnome3
2018-03-13 13:16:03 +03:00
, xorg
2015-11-08 22:39:57 +03:00
, libpng12
, freetype
, fontconfig
, gtk_engines
, alsaLib
2017-10-02 22:29:33 +03:00
, libidn
, zlib
2018-06-29 23:26:24 +03:00
, version ? " 1 3 . 1 0 . 0 "
2015-11-08 22:39:57 +03:00
} :
2017-10-23 19:53:11 +03:00
let
2018-06-29 23:24:04 +03:00
# In 56e1bdc7f9c (libidn: 1.34 -> 1.35), libidn.so.11 became libidn.so.12.
# Citrix looks for the former so we build version 1.34 to please the binary
libidn_134 = libidn . overrideDerivation ( _ : rec {
name = " l i b i d n - 1 . 3 4 " ;
src = fetchurl {
url = " m i r r o r : / / g n u / l i b i d n / ${ name } . t a r . g z " ;
sha256 = " 0 g 3 f z y p p 0 x j c g r 9 0 c 5 c y j 5 7 a p x 1 c m y 0 c 6 y 9 l v w 2 q d c i g b y b y 4 6 9 p " ;
} ;
} ) ;
2017-10-23 19:53:11 +03:00
versionInfo = {
2018-01-07 10:51:30 +03:00
" 1 3 . 8 . 0 " = {
2018-03-08 22:15:30 +03:00
major = " 1 3 " ;
minor = " 8 " ;
patch = " 0 " ;
x64hash = " F D F 5 9 9 1 C C D 5 2 B 2 B 9 8 2 8 9 D 7 B 2 F B 4 6 D 4 9 2 D 3 E 4 0 3 2 8 4 6 D 4 A F A 5 2 C A A 0 F 8 A C 0 5 7 8 9 3 1 " ;
x86hash = " E 0 C F B 4 3 3 1 2 B F 7 9 F 7 5 3 5 1 4 B 1 1 F 7 B 8 D E 4 5 2 9 8 2 3 A E 4 C 9 2 D 1 B 0 1 E 8 A 2 C 3 4 F 2 6 A C 5 7 E 7 " ;
2018-01-07 10:51:30 +03:00
x64suffix = " 1 0 2 9 9 7 2 9 " ;
x86suffix = " 1 0 2 9 9 7 2 9 " ;
2018-03-08 22:15:30 +03:00
homepage = https://www.citrix.com/downloads/citrix-receiver/legacy-receiver-for-linux/receiver-for-linux-138.html ;
} ;
" 1 3 . 9 . 0 " = {
major = " 1 3 " ;
minor = " 9 " ;
patch = " 0 " ;
x64hash = " 0 0 l 1 8 s 7 i 9 y k y 3 d d a b w l j w s f 7 f x 4 c j g j n 9 h f d 7 4 j 0 x 1 v 4 g l 0 7 8 n l 9 " ;
x86hash = " 1 1 7 f w y n p x f n r w 9 8 9 3 3 y 8 z 8 v 2 q 4 g 6 y c s 1 s n g v p b k i 2 q j 0 9 b j k w m a g " ;
x64suffix = " 1 0 2 " ;
x86suffix = " 1 0 2 " ;
2018-05-12 16:03:05 +03:00
homepage = https://www.citrix.com/downloads/citrix-receiver/linux/receiver-for-linux-latest.html ; # This version has disappeared from Citrix's website... *sigh*
} ;
" 1 3 . 9 . 1 " = {
major = " 1 3 " ;
minor = " 9 " ;
patch = " 1 " ;
x64hash = " A 9 A 9 1 5 7 C E 8 C 2 8 7 E 8 A A 1 1 4 4 7 A 0 E 3 C 3 A B 7 C 2 2 7 3 3 0 E 9 D 8 8 8 2 C 6 F 7 B 9 3 8 A 4 D D 5 9 2 5 B C " ;
x86hash = " A 9 3 E 9 7 7 0 F D 1 0 F D D 3 5 8 6 A 2 D 4 7 4 4 8 5 5 9 E A 0 3 7 2 6 5 7 1 7 A 7 0 0 0 B 9 B D 2 B 1 D C C E 7 B 0 A 4 8 3 " ;
x64suffix = " 6 " ;
x86suffix = " 6 " ;
2018-06-29 23:26:24 +03:00
homepage = https://www.citrix.com/downloads/citrix-receiver/legacy-receiver-for-linux/receiver-for-linux-1391.html ;
} ;
" 1 3 . 1 0 . 0 " = {
major = " 1 3 " ;
minor = " 1 0 " ;
patch = " 0 " ;
x64hash = " 7 0 2 5 6 8 8 C 7 8 9 1 3 7 4 C D A 1 1 C 9 2 F C 0 B A 2 F A 8 1 5 1 A E B 4 C 4 D 3 1 5 8 9 A D 1 8 7 4 7 F A E 9 4 3 F 6 E A " ;
x86hash = " 2 D C A 3 C 8 E D E D 1 1 C 5 D 8 2 4 D 5 7 9 B C 3 A 6 B 7 D 5 3 1 E A E D D C B F B 1 6 E 9 1 B 5 7 0 2 C 7 2 C A E 9 D E E 4 " ;
x64suffix = " 2 0 " ;
x86suffix = " 2 0 " ;
2018-03-08 22:15:30 +03:00
homepage = https://www.citrix.com/downloads/citrix-receiver/linux/receiver-for-linux-latest.html ;
2017-10-23 19:53:11 +03:00
} ;
2015-11-08 22:39:57 +03:00
} ;
2017-10-23 19:53:11 +03:00
citrixReceiverForVersion = { major , minor , patch , x86hash , x64hash , x86suffix , x64suffix , homepage }:
stdenv . mkDerivation rec {
name = " c i t r i x - r e c e i v e r - ${ version } " ;
version = " ${ major } . ${ minor } . ${ patch } " ;
inherit homepage ;
prefixWithBitness = if stdenv . is64bit then " l i n u x x 6 4 " else " l i n u x x 8 6 " ;
src = requireFile rec {
name = if stdenv . is64bit then " ${ prefixWithBitness } - ${ version } . ${ x64suffix } . t a r . g z " else " ${ prefixWithBitness } - ${ version } . ${ x86suffix } . t a r . g z " ;
sha256 = if stdenv . is64bit then x64hash else x86hash ;
message = ''
In order to use Citrix Receiver , you need to comply with the Citrix EULA and download
the $ { if stdenv . is64bit then " 6 4 - b i t " else " 3 2 - b i t " } binaries , . tar . gz from :
$ { homepage }
( if you do not find version $ { version } there , try at
https://www.citrix.com/downloads/citrix-receiver/legacy-receiver-for-linux/
or at https://www.citrix.com/downloads/citrix-receiver/ under " E a r l i e r V e r s i o n s o f R e c e i v e r f o r L i n u x " )
Once you have downloaded the file , please use the following command and re-run the
installation :
nix-prefetch-url file:// \ $ PWD / $ { name }
'' ;
} ;
2018-08-05 23:57:38 +03:00
dontBuild = true ;
2017-10-23 19:53:11 +03:00
sourceRoot = " . " ;
buildInputs = [
makeWrapper
busybox
file
gtk2
gdk_pixbuf
] ;
libPath = stdenv . lib . makeLibraryPath [
glib
gtk2
atk
gdk_pixbuf
cairo
pango
gnome3 . dconf
2018-03-13 13:16:03 +03:00
xorg . libX11
xorg . libXext
xorg . libXrender
xorg . libXinerama
xorg . libXfixes
2017-10-23 19:53:11 +03:00
libpng12
2018-06-29 23:24:04 +03:00
libidn_134
2017-10-23 19:53:11 +03:00
zlib
gtk_engines
freetype
fontconfig
alsaLib
stdenv . cc . cc # Fixes: Can not load [..]/opt/citrix-icaclient/lib/ctxh264_fb.so:(null)
] ;
desktopItem = makeDesktopItem {
name = " w f i c a " ;
desktopName = " C i t r i x R e c e i v e r " ;
genericName = " C i t r i x R e c e i v e r " ;
exec = " w f i c a " ;
icon = " w f i c a " ;
comment = " C o n n e c t t o r e m o t e C i t r i x s e r v e r " ;
categories = " G T K ; G N O M E ; X - G N O M E - N e t w o r k S e t t i n g s ; N e t w o r k ; " ;
mimeType = " a p p l i c a t i o n / x - i c a " ;
} ;
installPhase = ''
2018-08-05 23:57:38 +03:00
runHook preInstall
2017-10-23 19:53:11 +03:00
export ICAInstDir = " $ o u t / o p t / c i t r i x - i c a c l i e n t "
sed - i \
- e ' s , ^ main_install_menu $ , install_ICA_client , g' \
- e ' s , ^ integrate_ICA_client ( ) , alias integrate_ICA_client = true \ nintegrate_ICA_client_old ( ) , g' \
- e ' s , ^ ANSWER = " " $ , ANSWER = " $ I N S T A L L E R _ Y E S " , ' \
- e ' s , /bin/true , true , g' \
. / $ { prefixWithBitness } /hinst
# Run the installer...
2018-02-24 15:45:47 +03:00
bash . / $ { prefixWithBitness } /hinst CDROM " ` p w d ` "
2017-10-23 19:53:11 +03:00
echo " D e l e t i n g b r o k e n l i n k s . . . "
for link in ` find $ ICAInstDir - type l `
do
[ - f " $ l i n k " ] || rm - v " $ l i n k "
done
echo " E x p a n d i n g c e r t i f i c a t e s . . . "
# As explained in https://wiki.archlinux.org/index.php/Citrix#Security_Certificates
pushd " $ I C A I n s t D i r / k e y s t o r e / c a c e r t s "
awk ' BEGIN { c = 0 ; } /BEGIN CERT / { c ++ } { print > " c e r t . " c " . p e m " } ' < $ { cacert } /etc/ssl/certs/ca-bundle.crt
popd
echo " P a t c h i n g e x e c u t a b l e s . . . "
find $ ICAInstDir - type f - exec file { } \ ; |
grep ' ELF . * executable' |
cut - f 1 - d : |
2018-06-09 17:11:19 +03:00
grep - vi ' \ ( . dll \ | . so \ ) $ ' | # added as a workaround to https://github.com/NixOS/nixpkgs/issues/41729
2017-10-23 19:53:11 +03:00
while read f
do
echo " P a t c h i n g E L F i n t r e p r e t e r a n d r p a t h f o r $ f "
chmod u + w " $ f "
patchelf \
- - set-interpreter $ ( cat $ NIX_CC/nix-support/dynamic-linker ) \
- - set-rpath " $ I C A I n s t D i r : $ l i b P a t h " " $ f "
done
echo " W r a p p i n g w f i c a . . . "
mkdir " $ o u t / b i n "
makeWrapper " $ I C A I n s t D i r / w f i c a " " $ o u t / b i n / w f i c a " \
- - add-flags " - i c a r o o t $ I C A I n s t D i r " \
- - set ICAROOT " $ I C A I n s t D i r " \
2018-07-22 05:03:24 +03:00
- - set GTK_PATH " ${ gtk2 . out } / l i b / g t k - 2 . 0 : ${ gnome3 . gnome-themes-extra } / l i b / g t k - 2 . 0 " \
2017-10-23 19:53:11 +03:00
- - set GDK_PIXBUF_MODULE_FILE " $ G D K _ P I X B U F _ M O D U L E _ F I L E " \
- - set LD_PRELOAD " ${ libredirect } / l i b / l i b r e d i r e c t . s o " \
- - set LD_LIBRARY_PATH " $ l i b P a t h " \
- - set NIX_REDIRECTS " / u s r / s h a r e / z o n e i n f o = ${ tzdata } / s h a r e / z o n e i n f o : / e t c / z o n e i n f o = ${ tzdata } / s h a r e / z o n e i n f o : / e t c / t i m e z o n e = $ I C A I n s t D i r / t i m e z o n e "
echo " W e a r b i t r a r i l y s e t t h e t i m e z o n e t o U T C . N o k n o w n c o n s e q u e n c e s a t t h i s p o i n t . "
echo UTC > " $ I C A I n s t D i r / t i m e z o n e "
echo " I n s t a l l i n g d e s k t o p i t e m . . . "
mkdir - p $ out/share/applications
cp $ { desktopItem } /share/applications /* $ o u t / s h a r e / a p p l i c a t i o n s
# We introduce a dependency on the source file so that it need not be redownloaded everytime
echo $ src > > " $ o u t / s h a r e / n i x _ d e p e n d e n c i e s . p i n "
2018-08-05 23:57:38 +03:00
runHook postInstall
2017-10-23 19:53:11 +03:00
'' ;
meta = with stdenv . lib ; {
license = stdenv . lib . licenses . unfree ;
inherit homepage ;
description = " C i t r i x R e c e i v e r " ;
2018-08-05 23:57:38 +03:00
maintainers = with maintainers ; [ obadz a1russell ma27 ] ;
2017-10-23 19:53:11 +03:00
platforms = platforms . linux ;
} ;
} ;
in citrixReceiverForVersion ( lib . getAttr version versionInfo )