Unverified Commit 184dadc4 authored by Youser Nayme's avatar Youser Nayme
Browse files

dmtcp: unstable-2022-02-28 -> 4.1.0

Many releases have happened since 2022-02-28. See https://github.com/dmtcp/dmtcp/releases

Substitutions had to be updated a bit. Also switched to use
`--replace-fail` instead of `--replace`.

Dependencies for tests were added, they aren't actually run though.
They're currently broken in several ways: a build failure that's fixed
on master but not in a tagged release yet, and the python tests all
fail, though they fail on my host system as well.

Homepage updated.

Platform list updated. It seems linux x86, arm and riscv (both 32-bit
and 64-bit) are all supported (though it's a little unclear? Release
notes for 3.1.0 mention 32-bit arm but readme does not), and darwin is
not.
parent ec7c70d1
Loading
Loading
Loading
Loading
+24 −16
Original line number Diff line number Diff line
@@ -7,37 +7,43 @@
  python3,
}:

stdenv.mkDerivation {
stdenv.mkDerivation (finalAttrs: {
  pname = "dmtcp";
  version = "unstable-2022-02-28";
  version = "4.1.0";

  src = fetchFromGitHub {
    owner = "dmtcp";
    repo = "dmtcp";
    rev = "133687764c6742906006a1d247e3b83cd860fa1d";
    hash = "sha256-9Vr8IhoeATCfyt7Lp7kYe/7e87mFX9KMNGTqxJgIztE=";
    tag = finalAttrs.version;
    hash = "sha256-5laifZ/8oYJrNO5JOggCbPKmA9XiHEC79C/hk+0TdeQ=";
  };

  dontDisableStatic = true;

  nativeCheckInputs = [
    perl
    python3
  ];
  env.HAS_PYTHON3 = "yes";

  patches = [ ./ld-linux-so-buffer-size.patch ];

  postPatch = ''
    patchShebangs .

    substituteInPlace configure \
      --replace '#define ELF_INTERPRETER "$interp"' \
                "#define ELF_INTERPRETER \"$(cat $NIX_CC/nix-support/dynamic-linker)\""
      --replace-fail '#define ELF_INTERPRETER \"$interp\"' \
                "#define ELF_INTERPRETER \\\"$(cat $NIX_CC/nix-support/dynamic-linker)\\\""
    substituteInPlace src/restartscript.cpp \
      --replace /bin/bash ${stdenv.shell}
      --replace-fail /bin/bash ${stdenv.shell}
    substituteInPlace util/dmtcp_restart_wrapper.sh \
      --replace /bin/bash ${stdenv.shell}
      --replace-fail /bin/bash ${stdenv.shell}
    substituteInPlace test/autotest.py \
      --replace /bin/bash ${bash}/bin/bash \
      --replace /usr/bin/perl ${perl}/bin/perl \
      --replace /usr/bin/python ${python3.interpreter} \
      --replace "os.environ['USER']" "\"nixbld1\"" \
      --replace "os.getenv('USER')" "\"nixbld1\""
      --replace-fail /bin/bash ${bash}/bin/bash \
      --replace-fail /usr/bin/perl ${perl}/bin/perl \
      --replace-fail '/usr/bin/env python3' ${python3.interpreter} \
      --replace-fail "os.environ['USER']" "\"nixbld1\"" \
      --replace-fail "os.getenv('USER')" "\"nixbld1\""
  '';

  meta = {
@@ -48,8 +54,10 @@ stdenv.mkDerivation {
      programs spread across many machines and connected by sockets. It does
      not modify the user's program or the operating system.
    '';
    homepage = "http://dmtcp.sourceforge.net/";
    homepage = "http://dmtcp.github.io/";
    license = lib.licenses.lgpl3Plus; # most files seem this or LGPL-2.1+
    platforms = lib.intersectLists lib.platforms.linux lib.platforms.x86; # broken on ARM and Darwin
    platforms = lib.intersectLists lib.platforms.linux (
      lib.platforms.x86 ++ lib.platforms.aarch ++ lib.platforms.riscv
    );
  };
}
})