diff options
| author | Theofilos Augoustis <theofilos.augoustis@tum.de> | 2025-08-27 17:48:11 +0000 |
|---|---|---|
| committer | Theofilos Augoustis <theofilos.augoustis@tum.de> | 2025-08-28 09:19:33 +0000 |
| commit | ff3c9a0136b1b308a06d01108157146cc315274b (patch) | |
| tree | e2f7132427cb68ceb941cb4620ff32661625db8a /flake.nix | |
| parent | 9729ae38f8e44a17cb0915952791b5b906b4b7fa (diff) | |
| download | focaccia-ff3c9a0136b1b308a06d01108157146cc315274b.tar.gz focaccia-ff3c9a0136b1b308a06d01108157146cc315274b.zip | |
Migrate to LLDB from pylldb
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/flake.nix b/flake.nix index 836a49e..63a1d90 100644 --- a/flake.nix +++ b/flake.nix @@ -38,7 +38,7 @@ pyproject-build-systems, ... }: - flake-utils.lib.eachDefaultSystem (system: + flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] (system: let qemu-60 = inputs.nixpkgs-qemu-60.qemu; @@ -80,9 +80,33 @@ miasm = super.miasm.overrideAttrs (old: { nativeBuildInputs = (old.nativeBuildInputs or []) ++ [ self.setuptools ]; }); + cpuid = super.cpuid.overrideAttrs (old: { nativeBuildInputs = (old.nativeBuildInputs or []) ++ [ self.setuptools ]; }); + + focaccia = super.focaccia.overrideAttrs (old: { + buildInputs = (old.buildInputs or []) ++ [ pkgs.lldb ]; + + postInstall = (old.postInstall or "") + '' + set -eu + + target="$out/${python.sitePackages}" + src="$(${pkgs.lldb}/bin/lldb -P)" + + mkdir -p "$target" + + # Copy the lldb Python package (and the native extension) + if [ -d "$src/lldb" ]; then + ln -sTf "$src/lldb" "$target/lldb" + fi + + # Optional: some builds ship a top-level helper + if [ -f "$src/LLDB.py" ]; then + cp -a "$src/LLDB.py" "$target/" + fi + ''; + }); }; pyprojectOverridesEditable = self: super: { @@ -115,6 +139,25 @@ (old.src + "/src/focaccia/__init__.py") ]; }; + + postInstall = (old.postInstall or "") + '' + set -eu + + target="$out/${python.sitePackages}" + src="$(${pkgs.lldb}/bin/lldb -P)" + + mkdir -p "$target" + + # Copy the lldb Python package (and the native extension) + if [ -h "$src/lldb" ]; then + ln -sT "$src/lldb" "$target/lldb" + fi + + # Optional: some builds ship a top-level helper + if [ -f "$src/LLDB.py" ]; then + cp -a "$src/LLDB.py" "$target/" + fi + ''; }); }; |