1{ lib, stdenv, fetchFromGitHub, bzip2, zlib, autoconf, automake, cmake, help2man, texinfo, libtool, cppzmq
2, libarchive, avro-cpp_llvm, boost, jansson, zeromq, openssl, pam, libiodbc, libkrb5, gcc, libcxx, which, catch2
3, nanodbc_llvm, fmt, nlohmann_json, spdlog }:
4
5let
6 avro-cpp = avro-cpp_llvm;
7 nanodbc = nanodbc_llvm;
8in
9let
10 common = import ./common.nix {
11 inherit lib stdenv bzip2 zlib autoconf automake cmake
12 help2man texinfo libtool cppzmq libarchive jansson
13 zeromq openssl pam libiodbc libkrb5 gcc libcxx
14 boost avro-cpp which catch2 nanodbc fmt nlohmann_json
15 spdlog;
16 };
17in
18rec {
19
20 # irods: libs and server package
21 irods = stdenv.mkDerivation (common // rec {
22 version = "4.2.11";
23 pname = "irods";
24
25 src = fetchFromGitHub {
26 owner = "irods";
27 repo = "irods";
28 rev = version;
29 sha256 = "0prcsiddk8n3h515jjapgfz1d6hjqywhrkcf6giqd7xc7b0slz44";
30 fetchSubmodules = true;
31 };
32
33 # Patches:
34 # irods_root_path.patch : the root path is obtained by stripping 3 items of the path,
35 # but we don't use /usr with nix, so remove only 2 items.
36 patches = [ ./irods_root_path.patch ];
37
38 # fix build with recent llvm versions
39 env.NIX_CFLAGS_COMPILE = "-Wno-deprecated-register -Wno-deprecated-declarations";
40
41 postPatch = common.postPatch + ''
42 patchShebangs ./test
43 substituteInPlace plugins/database/CMakeLists.txt --replace "COMMAND cpp" "COMMAND ${gcc.cc}/bin/cpp"
44 substituteInPlace cmake/server.cmake --replace "DESTINATION usr/sbin" "DESTINATION sbin"
45 substituteInPlace cmake/server.cmake --replace "IRODS_DOC_DIR usr/share" "IRODS_DOC_DIR share"
46 substituteInPlace cmake/runtime_library.cmake --replace "DESTINATION usr/lib" "DESTINATION lib"
47 substituteInPlace cmake/development_library.cmake --replace "DESTINATION usr/lib" "DESTINATION lib"
48 substituteInPlace cmake/development_library.cmake --replace "DESTINATION usr/include" "DESTINATION include"
49 for file in unit_tests/cmake/test_config/*.cmake
50 do
51 substituteInPlace $file --replace "CATCH2}/include" "CATCH2}/include/catch2"
52 done
53 export cmakeFlags="$cmakeFlags
54 -DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath,$out/lib
55 -DCMAKE_MODULE_LINKER_FLAGS=-Wl,-rpath,$out/lib
56 -DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath,$out/lib
57 "
58
59 substituteInPlace cmake/server.cmake --replace SETUID ""
60 '';
61
62 meta = common.meta // {
63 longDescription = common.meta.longDescription + "This package provides the servers and libraries.";
64 };
65 });
66
67
68 # icommands (CLI) package, depends on the irods package
69 irods-icommands = stdenv.mkDerivation (common // rec {
70 version = "4.2.11";
71 pname = "irods-icommands";
72
73 src = fetchFromGitHub {
74 owner = "irods";
75 repo = "irods_client_icommands";
76 rev = version;
77 sha256 = "0wgs585j2lp820py2pbizsk54xgz5id96fhxwwk9lqhbzxhfjhcg";
78 };
79
80 patches = [ ./zmqcpp-deprecated-send_recv.patch ];
81
82 buildInputs = common.buildInputs ++ [ irods ];
83
84 postPatch = common.postPatch + ''
85 patchShebangs ./bin
86 '';
87
88 cmakeFlags = common.cmakeFlags ++ [
89 "-DCMAKE_INSTALL_PREFIX=${stdenv.out}"
90 "-DIRODS_DIR=${irods}/lib/irods/cmake"
91 "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath,${irods}/lib"
92 "-DCMAKE_MODULE_LINKER_FLAGS=-Wl,-rpath,${irods}/lib"
93 "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath,${irods}/lib"
94 ];
95
96 meta = common.meta // {
97 description = common.meta.description + " CLI clients";
98 longDescription = common.meta.longDescription + "This package provides the CLI clients, called 'icommands'.";
99 };
100 });
101}