17 # Old vendored package which has no other use than here, so not packaged in nixpkgs.
18 demumble = fetchFromGitHub {
21 rev = "01098eab821b33bd31b9778aea38565cd796aa85";
22 hash = "sha256-605SsXd7TSdm3BH854ChHIZbOXcHI/n8RN+pFMz4Ex4=";
27 version = "1.1-unstable-2024-09-23";
29 src = fetchFromGitHub {
32 rev = "0c89acd7e8b9d91fd1e9c8c129be627b4e47f1ea";
33 hash = "sha256-txZDPytWnkjkiVkPL2SWLwCPEtVvqoI/MVRvbJ2kBGw=";
37 "-DLIT_EXECUTABLE=${lit}/bin/lit"
38 "-DFILECHECK_EXECUTABLE=${llvmPackages_16.libllvm}/bin/FileCheck"
39 "-DYAML2OBJ_EXECUTABLE=${llvmPackages_16.libllvm}/bin/yaml2obj"
43 # Build system relies on some of those source files
44 rm -rf third_party/googletest third_party/abseil-cpp third_party/demumble
45 ln -s ${gtest.src} third_party/googletest
46 ln -s ${abseil-cpp.src} third_party/abseil-cpp
47 ln -s ${demumble} third_party/demumble
48 substituteInPlace CMakeLists.txt \
49 --replace "find_package(Python COMPONENTS Interpreter)" "" \
50 --replace "if(Python_FOUND AND LIT_EXECUTABLE" "if(LIT_EXECUTABLE" \
51 --replace "COMMAND \''\${Python_EXECUTABLE} \''\${LIT_EXECUTABLE}" "COMMAND \''\${LIT_EXECUTABLE}"
52 # wasm test fail. Possibly due to LLVM version < 17. See https://github.com/google/bloaty/pull/354
69 llvmPackages_16.libllvm
75 # These lit tests need to be build seperatly.
76 # See https://github.com/google/bloaty/blob/main/tests/README.md
77 cmake --build . --target check-bloaty
80 install -Dm755 {.,$out/bin}/bloaty
84 description = "Size profiler for binaries";
85 mainProgram = "bloaty";
86 homepage = "https://github.com/google/bloaty";
87 license = lib.licenses.asl20;
88 platforms = lib.platforms.unix;
89 maintainers = with lib.maintainers; [ momeemt ];