1{stdenv, fetchurl, qtbase, qtx11extras, ncurses, xorg, zlib, python27Packages}:
2stdenv.mkDerivation {
3 name = "fdr-4.2.3";
4 src = fetchurl {
5 url = https://www.cs.ox.ac.uk/projects/fdr/downloads/fdr-3789-linux-x86_64.tar.gz;
6 sha256 = "0n2yqichym5xdawlgk3r7yha88k7ycnx6585jfrcm7043sls1i88";
7 };
8
9 libPath = stdenv.lib.makeLibraryPath [
10 stdenv.cc.cc
11 python27Packages.python
12 qtbase
13 qtx11extras
14 ncurses
15 xorg.libX11
16 xorg.libXft
17 zlib
18 ];
19
20 phases = [ "unpackPhase" "installPhase" ];
21 installPhase = ''
22 mkdir -p "$out"
23
24 # shipped Qt is buggy
25 rm lib/libQt*
26 rm -r lib/qt_plugins
27
28 cp -r * "$out"
29 # Hack around lack of libtinfo in NixOS
30 ln -s ${ncurses.out}/lib/libncursesw.so.6 $out/lib/libtinfo.so.5
31 ln -s ${qtbase.bin}/${qtbase.qtPluginPrefix} $out/lib/qt_plugins
32 ln -s ${zlib.out}/lib/libz.so.1 $out/lib/libz.so.1
33
34 for b in fdr4 _fdr4 refines _refines cspmprofiler cspmexplorerprof
35 do
36 patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
37 --set-rpath "$libPath:$out/lib" \
38 "$out/bin/$b"
39 done
40
41 for l in corei7/librefines.so \
42 libcspm_process_compiler.so \
43 libcsp_operators.so \
44 _fdr.so \
45 libfdr.so \
46 libfdr_java.so \
47 libprocess_compiler.so \
48 librefines_gui.so \
49 librefines_licensing.so \
50 libboost_date_time.so.1.60.0 \
51 libboost_filesystem.so.1.60.0 \
52 libboost_iostreams.so.1.60.0 \
53 libboost_program_options.so.1.60.0 \
54 libboost_serialization.so.1.60.0 \
55 libboost_system.so.1.60.0
56 do
57 patchelf --set-rpath "$libPath:$out/lib" \
58 "$out/lib/$l"
59 done
60 '';
61
62 meta = with stdenv.lib; {
63 homepage = https://www.cs.ox.ac.uk/projects/fdr/;
64 description = "The CSP refinement checker";
65 license = licenses.unfreeRedistributable;
66 platforms = platforms.linux;
67 maintainers = with maintainers; [ nickhu ];
68 };
69}