···1+{ stdenv, bzip2, zlib, autoconf, automake, cmake, gnumake, help2man , texinfo, libtool , cppzmq , libarchive, avro-cpp, boost, jansson, zeromq, openssl, pam, libiodbc, kerberos, gcc, libcxx, which }:
2+3+# Common attributes of irods packages
4+5+with stdenv;
6+7+{
8+ enableParallelBuilding = true;
9+10+ buildInputs = [ bzip2 zlib autoconf automake cmake gnumake help2man texinfo libtool cppzmq libarchive avro-cpp jansson zeromq openssl pam libiodbc kerberos gcc boost libcxx which ];
11+12+ propagateBuildInputs = [ boost ];
13+14+ cmakeFlags = [
15+ "-DIRODS_EXTERNALS_FULLPATH_CLANG=${stdenv.cc}"
16+ "-DIRODS_EXTERNALS_FULLPATH_CLANG_RUNTIME=${stdenv.cc}"
17+ "-DIRODS_EXTERNALS_FULLPATH_ARCHIVE=${libarchive.lib}"
18+ "-DIRODS_EXTERNALS_FULLPATH_AVRO=${avro-cpp}"
19+ "-DIRODS_EXTERNALS_FULLPATH_BOOST=${boost}"
20+ "-DIRODS_EXTERNALS_FULLPATH_JANSSON=${jansson}"
21+ "-DIRODS_EXTERNALS_FULLPATH_ZMQ=${zeromq}"
22+ "-DIRODS_EXTERNALS_FULLPATH_CPPZMQ=${cppzmq}"
23+ "-DIRODS_LINUX_DISTRIBUTION_NAME=nix"
24+ "-DIRODS_LINUX_DISTRIBUTION_VERSION_MAJOR=${builtins.nixVersion}"
25+ "-DCPACK_GENERATOR=TGZ"
26+ "-DCMAKE_CXX_FLAGS=-I${libcxx}/include/c++/v1"
27+ ];
28+29+ preConfigure = ''
30+ patchShebangs ./packaging
31+ patchShebangs ./scripts
32+ substituteInPlace CMakeLists.txt --replace "DESTINATION usr/bin" "DESTINATION bin"
33+ substituteInPlace CMakeLists.txt --replace "INCLUDE_DIRS usr/include/" "INCLUDE_DIRS include/"
34+ substituteInPlace CMakeLists.txt --replace "DESTINATION usr/lib/" "DESTINATION lib/"
35+ export cmakeFlags="$cmakeFlags
36+ -DCMAKE_INSTALL_PREFIX=$out
37+ "
38+ '';
39+40+ meta = {
41+ description = "Integrated Rule-Oriented Data System (iRODS)";
42+ longDescription = ''
43+ The Integrated Rule-Oriented Data System (iRODS) is open source data management
44+ software used by research organizations and government agencies worldwide.
45+ iRODS is released as a production-level distribution aimed at deployment in mission
46+ critical environments. It virtualizes data storage resources, so users can take
47+ control of their data, regardless of where and on what device the data is stored.
48+ As data volumes grow and data services become more complex, iRODS is increasingly
49+ important in data management. The development infrastructure supports exhaustive
50+ testing on supported platforms; plug-in support for microservices, storage resources,
51+ drivers, and databases; and extensive documentation, training and support services.'';
52+ homepage = http://irods.org;
53+ license = stdenv.lib.licenses.bsd3;
54+ maintainers = [ stdenv.lib.maintainers.bzizou ];
55+ platforms = stdenv.lib.platforms.all;
56+ };
57+}
···1+--- a/lib/core/src/irods_default_paths.cpp 2016-10-24 17:09:02.955889536 +0200
2++++ b/lib/core/src/irods_default_paths.cpp 2016-10-24 17:09:43.178722157 +0200
3+@@ -18,7 +18,7 @@
4+ try {
5+ boost::filesystem::path path{dl_info.dli_fname};
6+ path = boost::filesystem::canonical(path);
7+- path.remove_filename().remove_filename().remove_filename(); // Removes filename and the two directories (usr and lib) between libirods_common.so and base of irods install
8++ path.remove_filename().remove_filename(); // Removes filename and the two directories (usr and lib) between libirods_common.so and base of irods install
9+ return path;
10+ } catch(const boost::filesystem::filesystem_error& e) {
11+ THROW(-1, e.what());