···11+{ stdenv, bzip2, zlib, autoconf, automake, cmake, gnumake, help2man , texinfo, libtool , cppzmq , libarchive, avro-cpp, boost, jansson, zeromq, openssl, pam, libiodbc, kerberos, gcc, libcxx, which }:
22+33+# Common attributes of irods packages
44+55+with stdenv;
66+77+{
88+ enableParallelBuilding = true;
99+1010+ buildInputs = [ bzip2 zlib autoconf automake cmake gnumake help2man texinfo libtool cppzmq libarchive avro-cpp jansson zeromq openssl pam libiodbc kerberos gcc boost libcxx which ];
1111+1212+ propagateBuildInputs = [ boost ];
1313+1414+ cmakeFlags = [
1515+ "-DIRODS_EXTERNALS_FULLPATH_CLANG=${stdenv.cc}"
1616+ "-DIRODS_EXTERNALS_FULLPATH_CLANG_RUNTIME=${stdenv.cc}"
1717+ "-DIRODS_EXTERNALS_FULLPATH_ARCHIVE=${libarchive.lib}"
1818+ "-DIRODS_EXTERNALS_FULLPATH_AVRO=${avro-cpp}"
1919+ "-DIRODS_EXTERNALS_FULLPATH_BOOST=${boost}"
2020+ "-DIRODS_EXTERNALS_FULLPATH_JANSSON=${jansson}"
2121+ "-DIRODS_EXTERNALS_FULLPATH_ZMQ=${zeromq}"
2222+ "-DIRODS_EXTERNALS_FULLPATH_CPPZMQ=${cppzmq}"
2323+ "-DIRODS_LINUX_DISTRIBUTION_NAME=nix"
2424+ "-DIRODS_LINUX_DISTRIBUTION_VERSION_MAJOR=${builtins.nixVersion}"
2525+ "-DCPACK_GENERATOR=TGZ"
2626+ "-DCMAKE_CXX_FLAGS=-I${libcxx}/include/c++/v1"
2727+ ];
2828+2929+ preConfigure = ''
3030+ patchShebangs ./packaging
3131+ patchShebangs ./scripts
3232+ substituteInPlace CMakeLists.txt --replace "DESTINATION usr/bin" "DESTINATION bin"
3333+ substituteInPlace CMakeLists.txt --replace "INCLUDE_DIRS usr/include/" "INCLUDE_DIRS include/"
3434+ substituteInPlace CMakeLists.txt --replace "DESTINATION usr/lib/" "DESTINATION lib/"
3535+ export cmakeFlags="$cmakeFlags
3636+ -DCMAKE_INSTALL_PREFIX=$out
3737+ "
3838+ '';
3939+4040+ meta = {
4141+ description = "Integrated Rule-Oriented Data System (iRODS)";
4242+ longDescription = ''
4343+ The Integrated Rule-Oriented Data System (iRODS) is open source data management
4444+ software used by research organizations and government agencies worldwide.
4545+ iRODS is released as a production-level distribution aimed at deployment in mission
4646+ critical environments. It virtualizes data storage resources, so users can take
4747+ control of their data, regardless of where and on what device the data is stored.
4848+ As data volumes grow and data services become more complex, iRODS is increasingly
4949+ important in data management. The development infrastructure supports exhaustive
5050+ testing on supported platforms; plug-in support for microservices, storage resources,
5151+ drivers, and databases; and extensive documentation, training and support services.'';
5252+ homepage = http://irods.org;
5353+ license = stdenv.lib.licenses.bsd3;
5454+ maintainers = [ stdenv.lib.maintainers.bzizou ];
5555+ platforms = stdenv.lib.platforms.all;
5656+ };
5757+}
···11+--- a/lib/core/src/irods_default_paths.cpp 2016-10-24 17:09:02.955889536 +0200
22++++ b/lib/core/src/irods_default_paths.cpp 2016-10-24 17:09:43.178722157 +0200
33+@@ -18,7 +18,7 @@
44+ try {
55+ boost::filesystem::path path{dl_info.dli_fname};
66+ path = boost::filesystem::canonical(path);
77+- 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
88++ path.remove_filename().remove_filename(); // Removes filename and the two directories (usr and lib) between libirods_common.so and base of irods install
99+ return path;
1010+ } catch(const boost::filesystem::filesystem_error& e) {
1111+ THROW(-1, e.what());