35 url = "https://code.x2go.org/releases/source/${pname}/${pname}-${version}.tar.gz";
36 sha256 = "Z3aqo1T1pE40nws8F21JiMiKYYwu30bJijeuicBp3NA=";
39 x2go-perl = perlPackages.buildPerlPackage rec {
47 substituteInPlace X2Go/Config.pm --replace '/etc/x2go' '/var/lib/x2go/conf'
48 substituteInPlace X2Go/Server/DB.pm \
49 --replace '$x2go_lib_path/libx2go-server-db-sqlite3-wrapper' \
50 '/run/wrappers/bin/x2gosqliteWrapper'
51 substituteInPlace X2Go/Server/DB/SQLite3.pm --replace "user='x2gouser'" "user='x2go'"
55 perlEnv = perl.withPackages (
99 stdenv.mkDerivation rec {
100 inherit pname version src;
107 nativeBuildInputs = [ makeWrapper ];
111 sed -i '/Makefile.PL\|Makefile.perl/d' Makefile
112 for i in */Makefile; do
113 substituteInPlace "$i" --replace "-o root -g root " ""
115 substituteInPlace libx2go-server-db-perl/Makefile --replace "chmod 2755" "chmod 755"
116 for i in x2goserver/sbin/x2godbadmin x2goserver/bin/x2go*
118 substituteInPlace $i --replace '/etc/x2go' '/var/lib/x2go/conf'
120 substituteInPlace x2goserver/sbin/x2gocleansessions \
121 --replace '/var/run/x2goserver.pid' '/var/run/x2go/x2goserver.pid'
122 substituteInPlace x2goserver/sbin/x2godbadmin --replace 'user="x2gouser"' 'user="x2go"'
123 substituteInPlace x2goserver-xsession/etc/Xsession \
124 --replace "SSH_AGENT /bin/bash -c" "SSH_AGENT ${bash}/bin/bash -c" \
125 --replace "[ -f /etc/redhat-release ]" "[ -d /etc/nix ] || [ -f /etc/redhat-release ]"
130 "NXLIBDIR=${nx-libs}/lib/nx"
133 installFlags = [ "DESTDIR=$(out)" ];
136 mv $out/etc/x2go/x2goserver.conf{,.example}
137 mv $out/etc/x2go/x2goagent.options{,.example}
138 ln -sf ${nx-libs}/bin/nxagent $out/bin/x2goagent
139 for i in $out/sbin/x2go* $(find $out/bin -type f) \
140 $(ls $out/lib/x2go/x2go* | grep -v x2gocheckport)
142 wrapProgram $i --prefix PATH : ${lib.makeBinPath binaryDeps}:$out
144 # We're patching @INC of the setgid wrapper, because we can't mix
145 # the perl wrapper (for PERL5LIB) with security.wrappers (for setgid)
146 sed -i -e "s,.\+bin/perl,#!${perl}/bin/perl -I ${perlEnv}/lib/perl5/site_perl," \
147 $out/lib/x2go/libx2go-server-db-sqlite3-wrapper.pl
150 enableParallelBuilding = true;
153 description = "Remote desktop application, server component";
154 homepage = "http://x2go.org/";
155 platforms = lib.platforms.linux;
156 license = licenses.gpl2;
157 maintainers = with maintainers; [ averelld ];