summary refs log tree commit diff
path: root/pkgs/tools
diff options
context:
space:
mode:
authorJoachim F <joachifm@users.noreply.github.com>2017-05-06 18:19:04 +0100
committerGitHub <noreply@github.com>2017-05-06 18:19:04 +0100
commit3c320fe7b1039a5d4bfc067b81e4028876c40af5 (patch)
treea626f863be8258e500b0b5e1598a247cdc6c58f7 /pkgs/tools
parentdf5329e12758071cf0a4e2c5932b3c5db3754ef8 (diff)
parent146985e772e43c6129eb32589c39dec29053f75f (diff)
downloadnixpkgs-3c320fe7b1039a5d4bfc067b81e4028876c40af5.tar
nixpkgs-3c320fe7b1039a5d4bfc067b81e4028876c40af5.tar.gz
nixpkgs-3c320fe7b1039a5d4bfc067b81e4028876c40af5.tar.bz2
nixpkgs-3c320fe7b1039a5d4bfc067b81e4028876c40af5.tar.lz
nixpkgs-3c320fe7b1039a5d4bfc067b81e4028876c40af5.tar.xz
nixpkgs-3c320fe7b1039a5d4bfc067b81e4028876c40af5.tar.zst
nixpkgs-3c320fe7b1039a5d4bfc067b81e4028876c40af5.zip
Merge pull request #19898 from bzizou/irods4.2
irods: init at 4.2.0
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/filesystems/irods/common.nix57
-rw-r--r--pkgs/tools/filesystems/irods/default.nix84
-rw-r--r--pkgs/tools/filesystems/irods/irods_root_path.patch11
3 files changed, 152 insertions, 0 deletions
diff --git a/pkgs/tools/filesystems/irods/common.nix b/pkgs/tools/filesystems/irods/common.nix
new file mode 100644
index 00000000000..9c5412ddef7
--- /dev/null
+++ b/pkgs/tools/filesystems/irods/common.nix
@@ -0,0 +1,57 @@
+{ stdenv, bzip2, zlib, autoconf, automake, cmake, gnumake, help2man , texinfo, libtool , cppzmq , libarchive, avro-cpp, boost, jansson, zeromq, openssl, pam, libiodbc, kerberos, gcc, libcxx, which }:
+
+# Common attributes of irods packages
+
+with stdenv;
+
+{
+  enableParallelBuilding = true;
+
+  buildInputs = [ bzip2 zlib autoconf automake cmake gnumake help2man texinfo libtool cppzmq libarchive avro-cpp jansson zeromq openssl pam libiodbc kerberos gcc boost libcxx which ];
+
+  propagateBuildInputs = [ boost ];
+
+  cmakeFlags = [
+    "-DIRODS_EXTERNALS_FULLPATH_CLANG=${stdenv.cc}"
+    "-DIRODS_EXTERNALS_FULLPATH_CLANG_RUNTIME=${stdenv.cc}"
+    "-DIRODS_EXTERNALS_FULLPATH_ARCHIVE=${libarchive.lib}"
+    "-DIRODS_EXTERNALS_FULLPATH_AVRO=${avro-cpp}"
+    "-DIRODS_EXTERNALS_FULLPATH_BOOST=${boost}"
+    "-DIRODS_EXTERNALS_FULLPATH_JANSSON=${jansson}"
+    "-DIRODS_EXTERNALS_FULLPATH_ZMQ=${zeromq}"
+    "-DIRODS_EXTERNALS_FULLPATH_CPPZMQ=${cppzmq}"
+    "-DIRODS_LINUX_DISTRIBUTION_NAME=nix"
+    "-DIRODS_LINUX_DISTRIBUTION_VERSION_MAJOR=${builtins.nixVersion}"
+    "-DCPACK_GENERATOR=TGZ"
+    "-DCMAKE_CXX_FLAGS=-I${libcxx}/include/c++/v1"
+  ];
+
+  preConfigure = ''
+    patchShebangs ./packaging
+    patchShebangs ./scripts
+    substituteInPlace CMakeLists.txt --replace "DESTINATION usr/bin" "DESTINATION bin"
+    substituteInPlace CMakeLists.txt --replace "INCLUDE_DIRS usr/include/" "INCLUDE_DIRS include/"
+    substituteInPlace CMakeLists.txt --replace "DESTINATION usr/lib/" "DESTINATION lib/"
+    export cmakeFlags="$cmakeFlags
+      -DCMAKE_INSTALL_PREFIX=$out
+    "
+  '';
+
+  meta = {
+    description = "Integrated Rule-Oriented Data System (iRODS)";
+    longDescription = ''
+      The Integrated Rule-Oriented Data System (iRODS) is open source data management
+      software used by research organizations and government agencies worldwide.
+      iRODS is released as a production-level distribution aimed at deployment in mission
+      critical environments.  It virtualizes data storage resources, so users can take
+      control of their data, regardless of where and on what device the data is stored.
+      As data volumes grow and data services become more complex, iRODS is increasingly
+      important in data management. The development infrastructure supports exhaustive
+      testing on supported platforms; plug-in support for microservices, storage resources,
+      drivers, and databases; and extensive documentation, training and support services.'';
+    homepage = http://irods.org;
+    license = stdenv.lib.licenses.bsd3;
+    maintainers = [ stdenv.lib.maintainers.bzizou ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/tools/filesystems/irods/default.nix b/pkgs/tools/filesystems/irods/default.nix
new file mode 100644
index 00000000000..72118cada9f
--- /dev/null
+++ b/pkgs/tools/filesystems/irods/default.nix
@@ -0,0 +1,84 @@
+{ stdenv, fetchurl, python, bzip2, zlib, autoconf, automake, cmake, gnumake, help2man , texinfo, libtool , cppzmq , libarchive, avro-cpp, boost, jansson, zeromq, openssl , pam, libiodbc, kerberos, gcc, libcxx, which }:
+
+with stdenv;
+
+let
+  common = import ./common.nix {
+    inherit stdenv bzip2 zlib autoconf automake cmake gnumake
+            help2man texinfo libtool cppzmq libarchive jansson
+            zeromq openssl pam libiodbc kerberos gcc libcxx
+            boost avro-cpp which;
+  };
+in rec {
+
+  # irods: libs and server package
+  irods = stdenv.mkDerivation (common // rec {
+    version = "4.2.0";
+    prefix = "irods";
+    name = "${prefix}-${version}";
+
+    src = fetchurl {
+      url = "https://github.com/irods/irods/releases/download/${version}/irods-${version}.tar.gz";
+      sha256 = "b5c0d7209219629da139058ce462a237ecc22ad4dae613413a428961e4ff9d3e";
+    };
+
+    # Patches:
+    # irods_root_path.patch : the root path is obtained by stripping 3 items of the path,
+    #                         but we don't use /usr with nix, so remove only 2 items.
+    patches = [ ./irods_root_path.patch ];
+
+    preConfigure = common.preConfigure + ''
+      patchShebangs ./test
+      substituteInPlace plugins/database/CMakeLists.txt --replace "COMMAND cpp" "COMMAND ${gcc.cc}/bin/cpp"
+      substituteInPlace cmake/server.cmake --replace "DESTINATION usr/sbin" "DESTINATION sbin"
+      substituteInPlace cmake/server.cmake --replace "IRODS_DOC_DIR usr/share" "IRODS_DOC_DIR share"
+      substituteInPlace cmake/runtime_library.cmake --replace "DESTINATION usr/lib" "DESTINATION lib"
+      substituteInPlace cmake/development_library.cmake --replace "DESTINATION usr/lib" "DESTINATION lib"
+      substituteInPlace cmake/development_library.cmake --replace "DESTINATION usr/include" "DESTINATION include"
+      export cmakeFlags="$cmakeFlags
+        -DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath,$out/lib
+        -DCMAKE_MODULE_LINKER_FLAGS=-Wl,-rpath,$out/lib
+        -DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath,$out/lib
+        "
+    '';
+
+    meta = common.meta // {
+      longDescription = common.meta.longDescription + ''
+        This package provides the servers and libraries.'';
+    };
+  });
+
+
+  # icommands (CLI) package, depends on the irods package
+  irods-icommands = stdenv.mkDerivation (common // rec {
+     version = "4.2.0";
+     name = "irods-icommands-${version}";
+     src = fetchurl {
+       url = "http://github.com/irods/irods_client_icommands/archive/${version}.tar.gz";
+       sha256 = "b581067c8139b5ef7897f15fc1fc79f69d2e784a0f36d96e8fa3cb260b6378ce";
+     };
+
+     buildInputs = common.buildInputs ++ [ irods ];
+
+     propagateBuildInputs = [ boost ];
+
+     preConfigure = common.preConfigure + ''
+       patchShebangs ./bin
+     '';
+
+     cmakeFlags = common.cmakeFlags ++ [
+       "-DCMAKE_INSTALL_PREFIX=${out}"
+       "-DIRODS_DIR=${irods}/lib/irods/cmake"
+       "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath,${irods}/lib"
+       "-DCMAKE_MODULE_LINKER_FLAGS=-Wl,-rpath,${irods}/lib"
+       "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath,${irods}/lib"
+    ];
+
+     meta = common.meta // {
+       description = common.meta.description + " CLI clients";
+       longDescription = common.meta.longDescription + ''
+         This package provides the CLI clients, called 'icommands'.'';
+     };
+  });
+}
+
diff --git a/pkgs/tools/filesystems/irods/irods_root_path.patch b/pkgs/tools/filesystems/irods/irods_root_path.patch
new file mode 100644
index 00000000000..c88169ac023
--- /dev/null
+++ b/pkgs/tools/filesystems/irods/irods_root_path.patch
@@ -0,0 +1,11 @@
+--- a/lib/core/src/irods_default_paths.cpp	2016-10-24 17:09:02.955889536 +0200
++++ b/lib/core/src/irods_default_paths.cpp	2016-10-24 17:09:43.178722157 +0200
+@@ -18,7 +18,7 @@
+         try {
+             boost::filesystem::path path{dl_info.dli_fname};
+             path = boost::filesystem::canonical(path);
+-            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
++            path.remove_filename().remove_filename(); // Removes filename and the two directories (usr and lib) between libirods_common.so and base of irods install
+             return path;
+         } catch(const boost::filesystem::filesystem_error& e) {
+             THROW(-1, e.what());