biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / tools / filesystems / irods / default.nix
blobca5fe7fa7329c56847e52bc20a03c48f76769e81
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
35 let
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   });
49 let
50   avro-cpp = avro-cpp_llvm;
51   nanodbc = nanodbc_llvm;
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   };
88 rec {
90   # irods: libs and server package
91   irods = stdenv.mkDerivation (
92     finalAttrs:
93     common
94     // {
95       version = "4.3.3";
96       pname = "irods";
98       src = fetchFromGitHub {
99         owner = "irods";
100         repo = "irods";
101         rev = finalAttrs.version;
102         hash = "sha256-SmN2FzeoA2/gjiDfGs2oifOVj0mK2WdQCgiSdIlENfk=";
103         fetchSubmodules = true;
104       };
106       # fix build with recent llvm versions
107       env.NIX_CFLAGS_COMPILE = "-Wno-deprecated-register -Wno-deprecated-declarations";
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       ];
115       postPatch =
116         common.postPatch
117         + ''
118           patchShebangs ./test
119           substituteInPlace plugins/database/CMakeLists.txt --replace-fail "COMMAND cpp" "COMMAND ${gcc.cc}/bin/cpp"
120           for file in unit_tests/cmake/test_config/*.cmake
121           do
122             substituteInPlace $file --replace-quiet "CATCH2}/include" "CATCH2}/include/catch2"
123           done
125           substituteInPlace server/auth/CMakeLists.txt --replace-fail SETUID ""
126         '';
128       meta = common.meta // {
129         longDescription = common.meta.longDescription + "This package provides the servers and libraries.";
130          mainProgram = "irodsServer";
131       };
132     }
133   );
135   # icommands (CLI) package, depends on the irods package
136   irods-icommands = stdenv.mkDerivation (
137     finalAttrs:
138     common
139     // {
140       version = "4.3.3";
141       pname = "irods-icommands";
143       src = fetchFromGitHub {
144         owner = "irods";
145         repo = "irods_client_icommands";
146         rev = finalAttrs.version;
147         hash = "sha256-cc0V6BztJk3njobWt27VeJNmQUXyH6aBJkvYIDFEzWY=";
148       };
150       buildInputs = common.buildInputs ++ [ irods ];
152       postPatch =
153         common.postPatch
154         + ''
155           patchShebangs ./bin
156         '';
158       cmakeFlags = common.cmakeFlags ++ [
159         "-DCMAKE_INSTALL_PREFIX=${stdenv.out}"
160         "-DIRODS_DIR=${irods}/lib/irods/cmake"
161         "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath,${irods}/lib"
162         "-DCMAKE_MODULE_LINKER_FLAGS=-Wl,-rpath,${irods}/lib"
163         "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath,${irods}/lib"
164       ];
166       meta = common.meta // {
167         description = common.meta.description + " CLI clients";
168         longDescription =
169           common.meta.longDescription + "This package provides the CLI clients, called 'icommands'.";
170       };
171     }
172   );