Skip to content

Commit

Permalink
eztrace: 1.1-11 -> 2.1.1, fix build, adopt
Browse files Browse the repository at this point in the history
  • Loading branch information
xokdvium committed Mar 11, 2025
1 parent 2d70289 commit 4976529
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 17 deletions.
19 changes: 19 additions & 0 deletions pkgs/by-name/ez/eztrace/0001-otf2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b36a8a94..61019e71 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -32,7 +32,13 @@ SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# CMakeFind repository
list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake_modules)

-find_package (OTF2 REQUIRED)
+PKG_CHECK_MODULES(OTF2 REQUIRED otf2)
+SET(OTF2_INCLUDE_PATH ${OTF2_INCLUDE_DIRS})
+SET(OTF2_LIBRARY ${OTF2_LIBRARIES})
+STRING(REPLACE "." ";" _VERSION ${OTF2_VERSION})
+LIST(GET _VERSION 0 OTF2_MAJOR_VERSION)
+LIST(GET _VERSION 1 OTF2_MINOR_VERSION)
+
if (NOT OTF2_FOUND)
message(FATAL_ERROR "libotf2 not found.")
endif()
68 changes: 51 additions & 17 deletions pkgs/by-name/ez/eztrace/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,77 @@
lib,
stdenv,
fetchFromGitLab,
cmake,
gfortran,
pkg-config,
libelf,
libiberty,
zlib,
# Once https://gitlab.com/eztrace/eztrace/-/issues/41
# is released we can switch to latest binutils.
libbfd_2_38,
libopcodes_2_38,
autoreconfHook,
libbfd,
libopcodes,
libotf2,
}:

stdenv.mkDerivation rec {
pname = "EZTrace";
version = "1.1-11";
pname = "eztrace";
version = "2.1.1";

outputs = [
"out"
"lib"
"man"
];

src = fetchFromGitLab {
owner = "eztrace";
repo = "eztrace";
rev = "eztrace-${version}";
hash = "sha256-A6HMr4ib5Ka1lTbbTQOdq3kIdCoN/CwAKRdXdv9wpfU=";
tag = "${version}";
hash = "sha256-ccW4YjEf++tkdIJLze2x8B/SWbBBXnYt8UV9OH8+KGU=";
};

patches = [
./0001-otf2.patch
];

postPatch = ''
substituteInPlace src/eztrace-lib/eztrace_otf2.c \
--replace-fail "/bin/rm" "rm"
substituteInPlace cmake_modules/FindOTF2.cmake \
--replace-fail otf2-config "${lib.getExe' libotf2 "otf2-config"}"
patchShebangs test
'';

strictDeps = true;

cmakeFlags = [
(lib.cmakeBool "EZTRACE_ENABLE_MEMORY" true)
];

nativeBuildInputs = [
cmake
pkg-config
libotf2
gfortran
autoreconfHook
];

buildInputs = [
libelf
libiberty
zlib
libbfd_2_38
libopcodes_2_38
libbfd
libopcodes
libotf2
];

meta = with lib; {
doCheck = true;

meta = {
description = "Tool that aims at generating automatically execution trace from HPC programs";
license = licenses.cecill-b;
maintainers = [ ];
license = lib.licenses.cecill-b;
maintainers = [ lib.maintainers.xokdvium ];
mainProgram = "eztrace";
badPlatforms = [
# Undefined symbols for architecture x86_64:
# > "___cyg_profile_func_enter", referenced from:
lib.systems.inspect.patterns.isDarwin
];
};
}

0 comments on commit 4976529

Please sign in to comment.