1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 bzip2,
6 zlib,
7 autoconf,
8 automake,
9 cmake,
10 help2man,
11 texinfo,
12 libtool,
13 cppzmq,
14 libarchive,
15 avro-cpp_llvm,
16 boost,
17 zeromq,
18 openssl,
19 pam,
20 libiodbc,
21 libkrb5,
22 gcc,
23 libcxx,
24 which,
25 catch2,
26 nanodbc_llvm,
27 fmt,
28 nlohmann_json,
29 spdlog_llvm,
30 curl,
31 bison,
32 flex,
33}:
34
35let
36 spdlog_rods = spdlog_llvm.overrideAttrs (attrs: {
37 inherit stdenv;
38 version = "1.10.0";
39 src = attrs.src.override {
40 rev = "v1.10.0";
41 hash = "sha256-c6s27lQCXKx6S1FhZ/LiKh14GnXMhZtD1doltU4Avws=";
42 };
43 postPatch = ''
44 substituteInPlace cmake/spdlog.pc.in \
45 --replace-fail '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@
46 '';
47 });
48in
49let
50 avro-cpp = avro-cpp_llvm;
51 nanodbc = nanodbc_llvm;
52
53 common = import ./common.nix {
54 inherit
55 lib
56 stdenv
57 bzip2
58 zlib
59 autoconf
60 automake
61 cmake
62 help2man
63 texinfo
64 libtool
65 cppzmq
66 libarchive
67 zeromq
68 openssl
69 pam
70 libiodbc
71 libkrb5
72 gcc
73 libcxx
74 boost
75 avro-cpp
76 which
77 catch2
78 nanodbc
79 fmt
80 nlohmann_json
81 curl
82 spdlog_rods
83 bison
84 flex
85 ;
86 };
87in
88rec {
89
90 # irods: libs and server package
91 irods = stdenv.mkDerivation (
92 finalAttrs:
93 common
94 // {
95 version = "4.3.3";
96 pname = "irods";
97
98 src = fetchFromGitHub {
99 owner = "irods";
100 repo = "irods";
101 rev = finalAttrs.version;
102 hash = "sha256-SmN2FzeoA2/gjiDfGs2oifOVj0mK2WdQCgiSdIlENfk=";
103 fetchSubmodules = true;
104 };
105
106 # fix build with recent llvm versions
107 env.NIX_CFLAGS_COMPILE = "-Wno-deprecated-register -Wno-deprecated-declarations";
108
109 cmakeFlags = common.cmakeFlags or [ ] ++ [
110 "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath,${placeholder "out"}/lib -D_GLIBCXX_USE_CXX11_ABI=0"
111 "-DCMAKE_MODULE_LINKER_FLAGS=-Wl,-rpath,${placeholder "out"}/lib"
112 "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath,${placeholder "out"}/lib"
113 ];
114
115 postPatch = common.postPatch + ''
116 patchShebangs ./test
117 substituteInPlace plugins/database/CMakeLists.txt --replace-fail "COMMAND cpp" "COMMAND ${gcc.cc}/bin/cpp"
118 for file in unit_tests/cmake/test_config/*.cmake
119 do
120 substituteInPlace $file --replace-quiet "CATCH2}/include" "CATCH2}/include/catch2"
121 done
122
123 substituteInPlace server/auth/CMakeLists.txt --replace-fail SETUID ""
124 '';
125
126 meta = common.meta // {
127 longDescription = common.meta.longDescription + "This package provides the servers and libraries.";
128 mainProgram = "irodsServer";
129 };
130 }
131 );
132
133 # icommands (CLI) package, depends on the irods package
134 irods-icommands = stdenv.mkDerivation (
135 finalAttrs:
136 common
137 // {
138 version = "4.3.3";
139 pname = "irods-icommands";
140
141 src = fetchFromGitHub {
142 owner = "irods";
143 repo = "irods_client_icommands";
144 rev = finalAttrs.version;
145 hash = "sha256-cc0V6BztJk3njobWt27VeJNmQUXyH6aBJkvYIDFEzWY=";
146 };
147
148 buildInputs = common.buildInputs ++ [ irods ];
149
150 postPatch = common.postPatch + ''
151 patchShebangs ./bin
152 '';
153
154 cmakeFlags = common.cmakeFlags ++ [
155 "-DCMAKE_INSTALL_PREFIX=${stdenv.out}"
156 "-DIRODS_DIR=${irods}/lib/irods/cmake"
157 "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath,${irods}/lib"
158 "-DCMAKE_MODULE_LINKER_FLAGS=-Wl,-rpath,${irods}/lib"
159 "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath,${irods}/lib"
160 ];
161
162 meta = common.meta // {
163 description = common.meta.description + " CLI clients";
164 longDescription =
165 common.meta.longDescription + "This package provides the CLI clients, called 'icommands'.";
166 };
167 }
168 );
169}