1{ lib, stdenv, fetchurl, qtbase, qtx11extras, ncurses5, xorg, zlib, python27Packages }:
2stdenv.mkDerivation {
3 pname = "fdr";
4 version = "4.2.7";
5 src = fetchurl {
6 url = "https://dl.cocotec.io/fdr/fdr-3814-linux-x86_64.tar.gz";
7 sha256 = "0cajz1gz4slq9nfhm8dqdgxl0kc950838n0lrf8jw4vl54gv6chh";
8 };
9
10 libPath = lib.makeLibraryPath [
11 stdenv.cc.cc
12 python27Packages.python
13 qtbase
14 qtx11extras
15 ncurses5
16 xorg.libX11
17 xorg.libXft
18 zlib
19 ];
20
21 dontConfigure = true;
22 installPhase = ''
23 mkdir -p "$out"
24
25 # shipped Qt is buggy
26 rm lib/libQt*
27 rm -r lib/qt_plugins
28
29 cp -r * "$out"
30 ln -s ${ncurses5.out}/lib/libtinfo.so.5 $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 lib; {
63 homepage = "https://cocotec.io/fdr/";
64 description = "The CSP refinement checker";
65 license = licenses.unfreeRedistributable;
66 platforms = platforms.linux;
67 maintainers = with maintainers; [ nickhu ];
68 };
69}