Change:
<del> { stdenv , lib , fetchurl , requireFile , makeWrapper , libredirect , busybox , file , makeDesktopItem , tzdata , cacert , dconf , glib , gtk2 , atk , gdk-pixbuf , cairo , pango , gnome3 , xorg , libpng12 , freetype , fontconfig , gtk_engines , alsaLib , zlib , version ? "20.06.0" }: </del> <ins> { lib, callPackage }: </ins> <del> let versionInfo = let supportedVersions = { "19.12.0" = { major     = "19"; minor     = "12"; patch     = "0"; x64hash   = "1si5mkxbgb8m99bkvgc3l80idjfdp0kby6pv47s07nn43dbr1j7a"; x86hash   = "07rfp90ksnvr8zv7ix7f0z6a59n48s7bd4kqbzilfwxgs4ddqmcy"; x64suffix = "19"; x86suffix = "19"; homepage  = "https://www.citrix.com/downloads/workspace-app/legacy-workspace-app-for-linux/workspace-app-for-linux-1912.html"; }; "20.04.0" = { major     = "20"; minor     = "04"; patch     = "0"; x64hash   = "E923592216F9541173846F932784E6C062CB09C9E8858219C7489607BF82A0FB"; x86hash   = "A2E2E1882723DA6796E68916B3BB2B44DD575A83DEB03CA90A262F6C81B1A53F"; x64suffix = "21"; x86suffix = "21"; homepage  = "https://www.citrix.com/de-de/downloads/workspace-app/legacy-workspace-app-for-linux/workspace-app-for-linux-2004.html"; }; "20.06.0" = { major     = "20"; minor     = "06"; patch     = "0"; x64hash   = "1kpfcfg95mpprlca6cccnjlsqbj3xvv77cn3fc5msd304nsi9x1v"; x86hash   = "1di29hrimbw3myjnf2nn26a14klidhdwvjqla6yxhwd3s6lil194"; x64suffix = "15"; x86suffix = "15"; homepage  = "https://www.citrix.com/de-de/downloads/workspace-app/linux/workspace-app-for-linux-latest.html"; }; }; # The lifespans of Citrix products can be found here: # https://www.citrix.com/support/product-lifecycle/milestones/receiver.html deprecatedVersions = let versions = [ "19.6.0" "19.8.0" "19.10.0" ]; in lib.listToAttrs (lib.forEach versions (v: lib.nameValuePair v (throw '' Unsupported citrix_workspace version: ${v} Actively supported releases are listed here: https://www.citrix.com/en-gb/support/product-lifecycle/milestones/receiver.html ''))); in deprecatedVersions // supportedVersions; citrixWorkspaceForVersion = { major, minor, patch, x64hash, x86hash, x64suffix, x86suffix, homepage }: stdenv.mkDerivation rec { pname = "citrix-workspace"; version  = "${major}.${minor}.${patch}"; inherit homepage; prefixWithBitness = if stdenv.is64bit then "linuxx64" else "linuxx86"; preferLocalBuild = true; src = requireFile rec { name    = if stdenv.is64bit then "${prefixWithBitness}-${version}.${x64suffix}.tar.gz" else "${prefixWithBitness}-${version}.${x86suffix}.tar.gz"; sha256  = if stdenv.is64bit then x64hash else x86hash; message = '' In order to use Citrix Workspace, you need to comply with the Citrix EULA and download the ${if stdenv.is64bit then "64-bit" else "32-bit"} binaries, .tar.gz from: ${homepage} (if you do not find version ${version} there, try at https://www.citrix.com/downloads/workspace-app/ Once you have downloaded the file, please use the following command and re-run the installation: nix-prefetch-url file://$PWD/${name} ''; }; dontBuild = true; sourceRoot = "."; </del> <ins> # For detailed information about the Citrix source-tarball, please refer to the OEM # reference guide: https://developer-docs.citrix.com/projects/workspace-app-for-linux-oem-guide/en/latest/ </ins> <del> buildInputs = [ makeWrapper busybox file gtk2 gdk-pixbuf ]; libPath = stdenv.lib.makeLibraryPath [ glib gtk2 atk gdk-pixbuf cairo pango dconf xorg.libX11 xorg.libXext xorg.libXrender xorg.libXinerama xorg.libXfixes libpng12 zlib gtk_engines freetype fontconfig alsaLib stdenv.cc.cc # Fixes: Can not load [..]/opt/citrix-icaclient/lib/ctxh264_fb.so:(null) ]; desktopItem = makeDesktopItem { name        = "wfica"; desktopName = "Citrix Workspace"; genericName = "Citrix Workspace"; exec        = "wfica"; icon        = "wfica"; comment     = "Connect to remote Citrix server"; categories  = "GTK;GNOME;X-GNOME-NetworkSettings;Network;"; mimeType    = "application/x-ica"; }; installPhase = '' runHook preInstall export ICAInstDir="$out/opt/citrix-icaclient" sed -i  -e 's,^main_install_menu$,install_ICA_client,g'  -e 's,^integrate_ICA_client(),alias integrate_ICA_client=truenintegrate_ICA_client_old(),g'  -e 's,^ANSWER=""$,ANSWER="$INSTALLER_YES",'  -e 's,/bin/true,true,g'  ./${prefixWithBitness}/hinst # Run the installer... bash ./${prefixWithBitness}/hinst CDROM "`pwd`" echo "Deleting broken links..." for link in `find $ICAInstDir -type l ` do [ -f "$link" ] || rm -v "$link" done echo "Expanding certificates..." # As explained in https://wiki.archlinux.org/index.php/Citrix#Security_Certificates pushd "$ICAInstDir/keystore/cacerts" awk 'BEGIN {c=0;} /BEGIN CERT/{c++} { print > "cert." c ".pem"}' < ${cacert}/etc/ssl/certs/ca-bundle.crt popd echo "Patching executables..." find $ICAInstDir -type f -exec file {} ; | grep 'ELF.*executable' | cut -f 1 -d : | grep -vi '(.dll|.so)$' | # added as a workaround to https://github.com/NixOS/nixpkgs/issues/41729 while read f do echo "Patching ELF intrepreter and rpath for $f" chmod u+w "$f" patchelf  --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker)  --set-rpath "$ICAInstDir:$libPath" "$f" done echo "Wrapping wfica..." mkdir "$out/bin" makeWrapper "$ICAInstDir/wfica" "$out/bin/wfica"  --add-flags "-icaroot $ICAInstDir"  --set ICAROOT "$ICAInstDir"  --set GTK_PATH "${gtk2.out}/lib/gtk-2.0:${gnome3.gnome-themes-extra}/lib/gtk-2.0"  --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE"  --set LD_PRELOAD "${libredirect}/lib/libredirect.so"  --set LD_LIBRARY_PATH "$libPath"  --set NIX_REDIRECTS "/usr/share/zoneinfo=${tzdata}/share/zoneinfo:/etc/zoneinfo=${tzdata}/share/zoneinfo:/etc/timezone=$ICAInstDir/timezone" echo "We arbitrarily set the timezone to UTC. No known consequences at this point." echo UTC > "$ICAInstDir/timezone" echo "Installing desktop item..." mkdir -p $out/share/applications cp ${desktopItem}/share/applications/* $out/share/applications </del> <ins> let inherit (callPackage ./sources.nix { }) supportedVersions unsupportedVersions; mkCitrix = callPackage ./generic.nix { }; </ins> <del> # We introduce a dependency on the source file so that it need not be redownloaded everytime echo $src >> "$out/share/workspace_dependencies.pin" </del> <ins> toAttrName = x: "citrix_workspace_${builtins.replaceStrings [ "." ] [ "_" ] x}"; </ins> <del> runHook postInstall ''; </del> <ins> unsupported = lib.listToAttrs ( map (x: lib.nameValuePair (toAttrName x) (throw '' Citrix Workspace at version ${x} is not supported anymore! </ins> <del> meta = with stdenv.lib; { license     = stdenv.lib.licenses.unfree; inherit homepage; description = "Citrix Workspace"; platforms   = platforms.linux; maintainers = with maintainers; [ ma27 ]; }; }; </del> <ins> Actively supported releases are listed here: https://www.citrix.com/en-gb/support/product-lifecycle/milestones/receiver.html '')) unsupportedVersions ); </ins> <del> in citrixWorkspaceForVersion (lib.getAttr version versionInfo) </del> <ins> supported = lib.mapAttrs' ( attr: versionInfo: lib.nameValuePair (toAttrName attr) (callPackage ./generic.nix versionInfo) ) supportedVersions; in supported // unsupported </ins>

Discussion:
Describe the bug citrixworkspace: Makes only , not other apps from the suite, avalibale on Manually running other apps (such as ) fails due to missing libraries Other applications in the suite (e.g. ) have similar linking issues To Reproduce Steps to reproduce the behavior: via and that from the package is not on the directly from /nix/store path produces: running . It starts, but some actions (e.g. adding the account) fail due to similar linking issues Expected behavior Other apps from the suite (, ) should be able to start. Additional context I don't have access to the system right now to paste the below information, but if something is essential, please let me know and I'll try my best to get it into the issue. Note that having seems like it's not enough in some situations. In my case, the browser doesn't even download the file, it launches the Citrix Receiver for Web / HTML5 in another tab. on the other hand launches it as a native desktop app, so for me looks like I need working at the minimum, likely as well and other apps from the suite might be needed underneath. More details here: The poster in the link above is using version , on my end I worked with the latest . The post in the link above has this issue: which happens on my end as well. Adding to and doing what doronbehar suggested , i.e. solves the above, but then it complains about . The version I have in my /nix/store is 2.6 and I was not sure how to install 2.4 as well. On my end, this: is not an issue - I'm able to start fine. However I cannot test due to not having to test with (see above). Since other apps (e.g. ) are able to start, but break later, I cannot confirm is actually fully working. Notify maintainers Metadata I don't have access to the system right now to paste the below information, but if something is essential, please let me know and I'll try my best to get it into the issue. Please run and paste the result.

Maintainer information:
Yes, this is an expected error, before this executable is usable on NixOS, we have to modify the ELF header accordingly: I use with a file almost daily and didn't encounter any issues btw. I'll try to fix it soon, but I can't promise that I can test everything properly, so before we'll push this fix to master, I'll probably need your help with testing :)
Thanks for a quick reply Yep, figured as much. The only thing is I saw the seems to be finding all executables, so I was not sure why only was touched instead of all executables in the suite. Unless the issue is that doesn't have the necessary dependencies, so patchelf doesn't replace all. New and not very familiar with NixOs and patchelf, so obviously I'm missing something :) I'll try my best to help with this. Let me know what the best way to proceed is when you get a chance.
No worries. isn't the friendliest thing when learning packaging with Nix(OS) :) Yes. Will ping you as soon as the PR is ready.
would you mind testing ?
Sure, should I follow docs to do that? I.e. something along the lines of:
Probably not: you don't want to rebuild your system on a slightly outdated master branch. Just check out my branch, build citrix locally and test it :)
OK, so something like: Or did you mean something like Using nix-shell for package development 
I don't recommend to checkout another nixpkgs. How about something like this:
Thanks this seems to be mostly working. and work fine from what I see. starts, but runs into this issue: Let me know if I can help with troubleshooting this somehow. I've managed to connect in using , so at least there's a workable solution - maybe worth including this into as well.
Was there any output from the tool? Have you tried e.g. removing temporarily? And, from which dir and as which user did you run it?
Whenever I start it (without ), I just get this: The GUI is displayed, but it just displays "Citrix Receiver" and the spinner that spins forever after printing that in the console. Removing it did not help. Tried from these: Same outcome. Using my normal user ( in ).

Looking at the stacktrace, it looks like it's failing while trying to launch a WebKit browser. Not sure if there's anything else that WebKit requires on top of everything else.
:+1: This happened while you were just starting ? Can you remove again and check if any daemons (like the AuthDaemon) are running ()? If that's the case, please kill those processes first and then run again. Plesae note that this only works if this autodiscovery of your Netscaler Gateway is enabled (IIRC, may be wrong though). To test the selfservice you should(tm) be able to do something like this:
Yeah. I mean I set up the store beforehand with , but after it's set up I just start and it (potentially after asking me for credentials) just outputs the assert error and then spins there forever. Sure: results in the same error as before:
Hmm, that means that there's now window asking for your credentials? Did Citrix ask to accept the EULA on the startup (should happen whenver is removed)? Which desktop env are you on? While you're at it, you could try to check with WireShark whether there's some citrix-related traffic and check and for suspicious things. Btw, just in case, do you need some special certs to access the netscaler gateway in the browser?
Yeah. The error comes after the credentials are inputted. If I kill it after it starts spinning and re-run, it will not ask for credentials again since it caches them, but will still print the error and enter the spinning state. Yes. Xfce. Nothing in either or is output after starting . With , I can see DNS and HTTP requests every now and then towards the addresses in Beacons in . Nothing popped out as suspicious. When completely disabling the wired interface (), I get the error: but I still get the Glib error in console and GUI hangs spinning. No. I have a xubuntu installation where citrix is working fine. It's on the same box where I'm troubleshooting this. I'll try to see if there's something different there and report back. Perhaps the error is a red-herring and something else is going on.
Sorry, forgot to ask another question: is there anything interesting in ?

A few data points: I've enabled tracing for selfservice and diffed the tracings between two versions (xubuntu that's working and nixos that's not). Aside from timing, they seem the same to me, so that did not yield anything useful. The xubuntu installation has citrix 19.10.0.15 (manually installed I think by just downloading official citrix build). However it's 1) working fine 2) not logging the GLib error in question. on the xubuntu version yields a much shorter list of libraries (29) than in this build (118). Notably, is absent in xubuntu version. I'll see if I can install the latest citrix on xubuntu and test with that, since it might not be related to this build at all (e.g. might be something I can reproduce in stock citrix 20.04).
First of all thanks a lot for your patience and the detailed information you provided! You may want to try out out then. So unless this is a 20.04 regression (which would be the case if from Nix works fine), we can be fairly sure that the GLib error is the culprit. I'll try to investigate during the next days after I got an answer from you :) This is probably due to the -hack. This was needed because some executables needed libraries that aren't loaded in the ELF (IIRC). I'll see if the error may be related to one of those. While you're at it, can you please check which version of OpenSSL is used (i.e. 1.0.2 or 1.1) for Citrix on XUbuntu?
Hey, I should be thanking you! :) This version is slightly worse: When run out of gdb, this is printed: and then it segfaults as per above. It doesn't even get to the GUI spinning part like 20.04 (though it briefly shows the GUI). For some reason, clearing out makes a difference the first time: it behaves like 20.04, i.e. it displays only the GLib error and the GUI just spins. On each subsequent start, it behaves as above. , and from this version work fine, so again it's only that seems to be the issue.

Note also that won't start due to: In 20.04 it was starting and behaving the same as . Well that's old...
Frankly, I'm not sure what's going on with glib here. didn't help either. IIRC you are fairly experienced with those desktop components. In case you have time to, it would be awesome if you could take a look at , the issues we have are reported in this issue, starting at . also CCing who may know something about this package I don't know.
Sorry, cannot debug further at the moment.
So, this is the backtrace with debugging symbols from : Indeed this is related to . However, I'm slightly confused, according to the upstream docs (https://developer-), the strings between their dialog lib and the application should(tm) be utf8-encoded. Unfortunately I couldn't retrieve any information about the argument-values from due to missing symbols. I guess that this is somehow related to missing debug symbols from all Citrix libraries (I locally declared to make sure that those would've been retained). I have to mention that I already went down several rabbit-holes in the past weeks because of that and debugging this is beginning to eat too much of my time, so I'll have to step down a bit from investigating this for now, sorry! In case someone else wants to take over, I'm totally fine with this (commiters can also push to my -branch), otherwise I'll restart working on this in a few days or weeks. the question is, how we want to proceed here. A few other features like and do work now, so if that's sufficient for you, we could merge the PR as-is and open an issue about the issue. Otherwise, the best solution for now would be to use a VM, unfortunately.
Does not look like the debug symbols are included. Did you install the packages having to ? relies on environment variable which sets to so you need to install the packages to be linked there.
In my particular case is a nice to have and not critical now that I have working, so if you are fine with that then yeah absolutely I'm all good with pushing this as-is to master and opening a separate issue for part - or even not opening an issue if you don't want to spend more time on it, totally understandable. Thanks for helping me so far, very grateful!

Especially since I'm just starting with NixOS, having help like this was really important, so kudos!
can you recheck with 20.06? I cannot reproduce the glib error there anymore.
Sorry for the delay - agreed, I've re-built using the latest you pushed to the branch and from Citrix Workspace 20.06 (Jun 30, 2020 release) seems to be working fine with that, so looks to me that all is resolved at this point. Thanks again for your help with this!
That's great to hear! I just updated the documentation to note that should only be used currently with . Unfortunately, I found another issue: (we need ) is deprecated (). I'm currently looking for a solution and will push this to the PR's branch. After that I'd ask you to do a final review to make sure we didn't miss anything and then we can finally merge this and resolve this issue.
So I've tested with the latest: is working as expected, however is not: Note that the previous version works fine (though there's no link in ): Both runs with cleaned-up . Not sure if anything changed related to that - are you able to repro on your end?
should be fixed now :)
Just built and tested , now all apps in are starting fine so !