Commit c6435a9d authored by Emily's avatar Emily
Browse files

{irods,irods-icommands}: 4.3.3 -> 5.0.1

parent 8831c775
Loading
Loading
Loading
Loading
+48 −0
Original line number Diff line number Diff line
{
  lib,
  llvmPackages,
  fetchFromGitHub,
  cmake,
  ninja,
  help2man,
  irods,
}:

llvmPackages.stdenv.mkDerivation (finalAttrs: {
  pname = "irods-icommands";
  inherit (irods) version;

  src = fetchFromGitHub {
    owner = "irods";
    repo = "irods_client_icommands";
    tag = finalAttrs.version;
    hash = "sha256-lo1eCI/CSzl7BJWdPo7KKVHfznkPN6GwsiQThUGuQdw=";
  };

  nativeBuildInputs = [
    cmake
    ninja
    help2man
  ];

  buildInputs = [ irods ];

  cmakeFlags = irods.commonCmakeFlags ++ [
    (lib.cmakeFeature "ICOMMANDS_INSTALL_DIRECTORY" "${placeholder "out"}/bin")
    (lib.cmakeBool "ICOMMANDS_INSTALL_SYMLINKS" false)
  ];

  meta = {
    inherit (irods.meta)
      homepage
      license
      maintainers
      platforms
      ;
    description = irods.meta.description + " CLI clients";
    longDescription = irods.meta.longDescription + ''

      This package provides the CLI clients, called 'icommands'.
    '';
  };
})
+115 −0
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  bzip2,
  zlib,
  autoconf,
  automake,
  llvmPackages,
  fetchFromGitHub,
  cmake,
  help2man,
  texinfo,
  libtool,
  cppzmq,
  ninja,
  bison,
  flex,
  libarchive,
  avro-cpp,
  boost,
  zeromq,
  openssl,
  pam,
  libiodbc,
  libkrb5,
  gcc,
  libcxx,
  which,
  catch2,
  nanodbc,
  fmt,
  nlohmann_json,
  unixODBC,
  jsoncons,
  curl,
  spdlog_rods,
  bison,
  flex,
  systemdLibs,
  openssl,
  boost183,
  nlohmann_json,
  nanodbc,
  fmt_9,
  spdlog,
}:

# Common attributes of irods packages
llvmPackages.stdenv.mkDerivation (finalAttrs: {
  pname = "irods";
  version = "5.0.1";

  src = fetchFromGitHub {
    owner = "irods";
    repo = "irods";
    tag = finalAttrs.version;
    hash = "sha256-/mcuqukgDoMc89FL/TfOhHWglsfdLmQbAnQYT8vTFsY=";
  };

{
  nativeBuildInputs = [
    autoconf
    automake
    cmake
    help2man
    texinfo
    which
    gcc
    ninja
    bison
    flex
  ];

  buildInputs = [
    bzip2
    zlib
    libtool
    cppzmq
    libarchive
    avro-cpp
    zeromq
    openssl
    pam
    libiodbc
    libkrb5
    boost
    libcxx
    catch2
    nanodbc
    fmt
    nlohmann_json
    spdlog_rods
    unixODBC
    jsoncons
    curl
    systemdLibs
  ];

  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_ZMQ=${zeromq}"
    "-DIRODS_EXTERNALS_FULLPATH_CPPZMQ=${cppzmq}"
    "-DIRODS_EXTERNALS_FULLPATH_CATCH2=${catch2}"
    "-DIRODS_EXTERNALS_FULLPATH_NANODBC=${nanodbc}"
    "-DIRODS_EXTERNALS_FULLPATH_FMT=${fmt}"
    "-DIRODS_EXTERNALS_FULLPATH_JSON=${nlohmann_json}"
    "-DIRODS_EXTERNALS_FULLPATH_SPDLOG=${spdlog_rods}"
    "-DIRODS_LINUX_DISTRIBUTION_NAME=nix"
    "-DIRODS_LINUX_DISTRIBUTION_VERSION_MAJOR=1.0"
    "-DCPACK_GENERATOR=TGZ"
    "-DCMAKE_CXX_FLAGS=-I${lib.getDev libcxx}/include/c++/v1"
    "-DPAM_LIBRARY=${pam}/lib/libpam.so"
    "-DCMAKE_INSTALL_PREFIX=${placeholder "out"}"
    "-DIRODS_HOME_DIRECTORY=${placeholder "out"}"
    "-DCMAKE_INSTALL_SBINDIR=${placeholder "out"}/sbin"
  propagatedBuildInputs = [
    openssl
    # Can potentially be unpinned after:
    # <https://github.com/irods/irods/issues/7248>
    boost183
    nlohmann_json
    nanodbc
    # Tracking issue for `fmt_11`:
    # <https://github.com/irods/irods/issues/8454>
    fmt_9
    (spdlog.override {
      fmt = fmt_9;
    })
  ];

  cmakeFlags = finalAttrs.passthru.commonCmakeFlags ++ [
    # Tracking issues for moving these to `find_package`:
    # * <https://github.com/irods/irods/issues/6249>
    # * <https://github.com/irods/irods/issues/6253>
    (lib.cmakeFeature "IRODS_EXTERNALS_FULLPATH_BOOST" "${boost183}")
    (lib.cmakeFeature "IRODS_EXTERNALS_FULLPATH_NANODBC" "${nanodbc}")
    (lib.cmakeFeature "IRODS_EXTERNALS_FULLPATH_JSONCONS" "${jsoncons}")
  ];

  postPatch = ''
    patchShebangs ./packaging ./scripts
    patchShebangs ./test
    substituteInPlace plugins/database/CMakeLists.txt --replace-fail \
      'COMMAND cpp -E -P -D''${plugin} "''${CMAKE_CURRENT_BINARY_DIR}/src/icatSysTables.sql.pp" ' \
      'COMMAND cpp -E -P -D''${plugin} "''${CMAKE_CURRENT_BINARY_DIR}/src/icatSysTables.sql.pp" -o '
    substituteInPlace server/auth/CMakeLists.txt --replace-fail SETUID ""
  '';

  meta = with lib; {
  passthru = {
    commonCmakeFlags = [
      # We already use Clang in the `stdenv`.
      (lib.cmakeBool "IRODS_BUILD_WITH_CLANG" false)
      # Upstream builds with LLVM 16 and doesn’t handle newer warnings.
      (lib.cmakeBool "IRODS_BUILD_WITH_WERROR" false)
      (lib.cmakeFeature "IRODS_HOME_DIRECTORY" "${placeholder "out"}")
      (lib.cmakeFeature "IRODS_LINUX_DISTRIBUTION_NAME" "NixOS")
      (lib.cmakeFeature "IRODS_LINUX_DISTRIBUTION_VERSION" lib.trivial.release)
      (lib.cmakeFeature "IRODS_LINUX_DISTRIBUTION_VERSION_MAJOR" lib.trivial.release)
      (lib.cmakeFeature "CPACK_GENERATOR" "TGZ")
    ];
  };

  meta = {
    description = "Integrated Rule-Oriented Data System (iRODS)";
    longDescription = ''
      The Integrated Rule-Oriented Data System (iRODS) is open source data management
@@ -105,10 +104,12 @@
      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.'';
      drivers, and databases; and extensive documentation, training and support services.
    '';
    homepage = "https://irods.org";
    license = lib.licenses.bsd3;
    maintainers = [ lib.maintainers.bzizou ];
    platforms = lib.platforms.linux;
    mainProgram = "irodsServer";
  };
}
})
+0 −169
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchFromGitHub,
  bzip2,
  zlib,
  autoconf,
  automake,
  cmake,
  help2man,
  texinfo,
  libtool,
  cppzmq,
  libarchive,
  avro-cpp_llvm,
  boost,
  zeromq,
  openssl,
  pam,
  libiodbc,
  libkrb5,
  gcc,
  libcxx,
  which,
  catch2,
  nanodbc_llvm,
  fmt,
  nlohmann_json,
  spdlog_llvm,
  curl,
  bison,
  flex,
}:

let
  spdlog_rods = spdlog_llvm.overrideAttrs (attrs: {
    inherit stdenv;
    version = "1.10.0";
    src = attrs.src.override {
      rev = "v1.10.0";
      hash = "sha256-c6s27lQCXKx6S1FhZ/LiKh14GnXMhZtD1doltU4Avws=";
    };
    postPatch = ''
      substituteInPlace cmake/spdlog.pc.in \
        --replace-fail '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@
    '';
  });
in
let
  avro-cpp = avro-cpp_llvm;
  nanodbc = nanodbc_llvm;

  common = import ./common.nix {
    inherit
      lib
      stdenv
      bzip2
      zlib
      autoconf
      automake
      cmake
      help2man
      texinfo
      libtool
      cppzmq
      libarchive
      zeromq
      openssl
      pam
      libiodbc
      libkrb5
      gcc
      libcxx
      boost
      avro-cpp
      which
      catch2
      nanodbc
      fmt
      nlohmann_json
      curl
      spdlog_rods
      bison
      flex
      ;
  };
in
rec {

  # irods: libs and server package
  irods = stdenv.mkDerivation (
    finalAttrs:
    common
    // {
      version = "4.3.3";
      pname = "irods";

      src = fetchFromGitHub {
        owner = "irods";
        repo = "irods";
        rev = finalAttrs.version;
        hash = "sha256-SmN2FzeoA2/gjiDfGs2oifOVj0mK2WdQCgiSdIlENfk=";
        fetchSubmodules = true;
      };

      # fix build with recent llvm versions
      env.NIX_CFLAGS_COMPILE = "-Wno-deprecated-register -Wno-deprecated-declarations";

      cmakeFlags = common.cmakeFlags or [ ] ++ [
        "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath,${placeholder "out"}/lib -D_GLIBCXX_USE_CXX11_ABI=0"
        "-DCMAKE_MODULE_LINKER_FLAGS=-Wl,-rpath,${placeholder "out"}/lib"
        "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath,${placeholder "out"}/lib"
      ];

      postPatch = common.postPatch + ''
        patchShebangs ./test
        substituteInPlace plugins/database/CMakeLists.txt --replace-fail "COMMAND cpp" "COMMAND ${gcc.cc}/bin/cpp"
        for file in unit_tests/cmake/test_config/*.cmake
        do
          substituteInPlace $file --replace-quiet "CATCH2}/include" "CATCH2}/include/catch2"
        done

        substituteInPlace server/auth/CMakeLists.txt --replace-fail SETUID ""
      '';

      meta = common.meta // {
        longDescription = common.meta.longDescription + "This package provides the servers and libraries.";
        mainProgram = "irodsServer";
      };
    }
  );

  # icommands (CLI) package, depends on the irods package
  irods-icommands = stdenv.mkDerivation (
    finalAttrs:
    common
    // {
      version = "4.3.3";
      pname = "irods-icommands";

      src = fetchFromGitHub {
        owner = "irods";
        repo = "irods_client_icommands";
        rev = finalAttrs.version;
        hash = "sha256-cc0V6BztJk3njobWt27VeJNmQUXyH6aBJkvYIDFEzWY=";
      };

      buildInputs = common.buildInputs ++ [ irods ];

      postPatch = common.postPatch + ''
        patchShebangs ./bin
      '';

      cmakeFlags = common.cmakeFlags ++ [
        "-DCMAKE_INSTALL_PREFIX=${stdenv.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'.";
      };
    }
  );
}
+0 −14
Original line number Diff line number Diff line
@@ -3224,20 +3224,6 @@ with pkgs;

  icepeak = haskell.lib.compose.justStaticExecutables haskellPackages.icepeak;

  inherit
    (callPackages ../tools/filesystems/irods rec {
      stdenv = llvmPackages_13.libcxxStdenv;
      libcxx = llvmPackages_13.libcxx;
      boost = boost178.override { inherit stdenv; };
      fmt = fmt_9.override { inherit stdenv; };
      nanodbc_llvm = nanodbc.override { inherit stdenv; };
      avro-cpp_llvm = avro-cpp.override { inherit stdenv boost; };
      spdlog_llvm = spdlog.override { inherit stdenv fmt; };
    })
    irods
    irods-icommands
    ;

  ihaskell = callPackage ../development/tools/haskell/ihaskell/wrapper.nix {
    inherit (haskellPackages) ghcWithPackages;