Unverified Commit aa904d3a authored by 7c6f434c's avatar 7c6f434c Committed by GitHub
Browse files

Kagen: 1.1.0 -> 1.2.0; cgal: propagate boost (#448036)

parents b0bb1a55 7ff10fc2
Loading
Loading
Loading
Loading
+17 −3
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
  boost,
  gmp,
  mpfr,
  testers,
}:

stdenv.mkDerivation (finalAttrs: {
@@ -17,19 +18,32 @@ stdenv.mkDerivation (finalAttrs: {
    sha256 = "sha256-8wxb58JaKj6iS8y6q1z2P6/aY8AnnzTX5/izISgh/tY=";
  };

  patches = [ ./cgal_path.patch ];

  nativeBuildInputs = [ cmake ];

  # note: optional component libCGAL_ImageIO would need zlib and opengl;
  #   there are also libCGAL_Qt{3,4} omitted ATM
  buildInputs = [
    boost
    gmp
    mpfr
  ];
  nativeBuildInputs = [ cmake ];

  patches = [ ./cgal_path.patch ];
  propagatedBuildInputs = [
    boost
  ];

  doCheck = false;

  passthru = {
    tests = {
      cmake-config = testers.hasCmakeConfigModules {
        moduleNames = [ "CGAL" ];
        package = finalAttrs.finalPackage;
      };
    };
  };

  meta = {
    description = "Computational Geometry Algorithms Library";
    homepage = "http://cgal.org";
+24 −35
Original line number Diff line number Diff line
@@ -2,25 +2,22 @@
  lib,
  stdenv,
  fetchFromGitHub,
  fetchpatch2,
  cmake,
  pkg-config,
  mpi,
  cgal_5,
  boost,
  gmp,
  mpfr,
  cgal,
  sparsehash,
  imagemagick,
  gtest,
  ctestCheckHook,
  mpiCheckPhaseHook,
  withExamples ? false,
  testers,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "kagen";
  version = "1.1.0";
  version = "1.2.0";

  src = fetchFromGitHub {
    owner = "KarlsruheGraphGeneration";
@@ -28,44 +25,27 @@ stdenv.mkDerivation (finalAttrs: {
    tag = "v${finalAttrs.version}";
    # use vendor libmorton and xxHash
    fetchSubmodules = true;
    hash = "sha256-FSlTNOQgwPGOn4mIVIgFejvU0dpyydomHYJOKPz1UjU=";
    hash = "sha256-2jXHHS9Siu6hXrYPIrZSOWe6D2PgsvrbMw/7Ykpc3wk=";
  };

  patches = [
    # replace asm by builtin function to ensure compatibility with arm64
    (fetchpatch2 {
      url = "https://github.com/KarlsruheGraphGeneration/KaGen/commit/cab9d5dc6cc256972e52675ad9c385524d40ecd9.patch?full_index=1";
      hash = "sha256-DCsuwUiE98UKZMxlUI9p36/wq486uHHrUphrIVqM+Cc=";
    })
  ];

  postPatch = ''
    substituteInPlace tests/CMakeLists.txt \
      --replace-fail "FetchContent_MakeAvailable(googletest)" "find_package(GTest REQUIRED)"\
      --replace-fail "set_property(DIRECTORY" "#set_property(DIRECTORY"

    substituteInPlace kagen/CMakeLists.txt \
      --replace-fail "OBJECT" ""
  '';

  nativeBuildInputs = [
    cmake
    pkg-config
  ];

  buildInputs = [
    imagemagick
  ];

  propagatedBuildInputs = [
    mpi
    cgal_5
    cgal
    sparsehash
    imagemagick
    # should be propagated by cgal
    boost
    gmp
    mpfr
  ];

  cmakeFlags = [
    (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))
    (lib.cmakeBool "KAGEN_USE_BUNDLED_GTEST" false)
    (lib.cmakeBool "KAGEN_BUILD_EXAMPLES" withExamples)
    (lib.cmakeBool "KAGEN_BUILD_TESTS" finalAttrs.finalPackage.doCheck)
  ];
@@ -80,15 +60,24 @@ stdenv.mkDerivation (finalAttrs: {
    mpiCheckPhaseHook
  ];

  disabledTests = lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
    # flaky tests on aarch64-darwin
  disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
    # flaky tests on darwin
    "test_rgg2d.2cores"
    "test_rgg2d.4cores"
    "test_edge_weights.2cores"
    "test_edge_weights.4cores"
    "test_permutation.2cores"
    "test_permutation.4cores"
  ];

  postInstall = ''
    cmake --install . --component tools
  '';
  passthru = {
    tests = {
      cmake-config = testers.hasCmakeConfigModules {
        moduleNames = [ "KaGen" ];
        package = finalAttrs.finalPackage;
      };
    };
  };

  meta = {
    description = "Communication-free Massively Distributed Graph Generators";