Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ stack.yaml.lock
*.hs_
*.tracy
upstream/tracy
result
27 changes: 27 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
description = "A flake for tracy Haskell bindings development";

inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";

outputs = { self, nixpkgs }:
let
forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
in
{
packages = forAllSystems (system: let pkgs = import nixpkgs { inherit system; }; in {
tracy-profiler = pkgs.haskellPackages.callCabal2nix "tracy-profiler" ./. {
buildInputs = [ self.packages.${system}.tracy-lib ];
};
tracy-lib = pkgs.stdenv.mkDerivation {
pname = "tracy";
version = "v0.12.2";

src = pkgs.fetchFromGitHub {
owner = "KovalevDima";
repo = "tracy";
rev = "denerate-pc-for-tracy";
hash = "sha256-laqt1ORB2XryU3uuqgdGfDLu1BGK4ekboT8gLjRr7+U=";
};

nativeBuildInputs = with pkgs; [ pkg-config meson ninja cmake ];
buildInputs = with pkgs; [ zlib libunwind ];
};
});
devShells = forAllSystems (system: let pkgs = import nixpkgs { inherit system; }; in {
default = pkgs.mkShell {
inputsFrom = with pkgs; [ ];
packages = with pkgs; [ pkg-config self.packages.${system}.tracy-lib ];
};
});
};
}
2 changes: 1 addition & 1 deletion src/System/Tracy/FFI/Types.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ data SourceLocationData = SourceLocationData
}

#ifdef TRACY_ENABLE
#include "TracyC.h"
#include "tracy/tracy/TracyC.h"

instance Storable SourceLocationData where
sizeOf (~_undef) = (#size struct ___tracy_source_location_data)
Expand Down
3 changes: 2 additions & 1 deletion tracy-profiler.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,11 @@ library
, unliftio-core
, webcolor-labels
default-language: GHC2021
pkgconfig-depends:
tracy
if flag(enable)
cpp-options: -DTRACY_ENABLE
extra-libraries:
TracyClient
stdc++
if flag(manual_lifetime)
cpp-options: -DTRACY_MANUAL_LIFETIME
Expand Down