diff --git a/flake.nix b/flake.nix index 5677d23..ecacc67 100644 --- a/flake.nix +++ b/flake.nix @@ -15,8 +15,6 @@ config.allowUnfree = true; }; - lib = pkgs.lib; - packages = rec { proj = pkgs.python3Packages.callPackage ./pkgs/proj { inherit pytest-skip-slow; diff --git a/pkgs/doctest/default.nix b/pkgs/doctest/default.nix index 53447e8..9540742 100644 --- a/pkgs/doctest/default.nix +++ b/pkgs/doctest/default.nix @@ -1,4 +1,5 @@ { pkgs +, fetchpatch }: pkgs.doctest.overrideAttrs ( old: rec { @@ -11,5 +12,13 @@ pkgs.doctest.overrideAttrs ( old: rec { }; patches = [ ./doctest-template-test.patch + + # Fix the build with Clang. + (fetchpatch { + name = "doctest-disable-warnings.patch"; + url = "https://github.com/doctest/doctest/commit/c8d9ed2398d45aa5425d913bd930f580560df30d.patch"; + excludes = [ ".github/workflows/main.yml" ]; + hash = "sha256-kOBy0om6MPM2vLXZjNLXiezZqVgNr/viBI7mXrOZts8="; + }) ]; }) diff --git a/pkgs/ff-clang-format.nix b/pkgs/ff-clang-format.nix index 4807b8f..130558b 100644 --- a/pkgs/ff-clang-format.nix +++ b/pkgs/ff-clang-format.nix @@ -1,4 +1,5 @@ -{ stdenv +{ pkgs +, stdenv , lib , autoPatchelfHook , fetchurl @@ -10,12 +11,21 @@ stdenv.mkDerivation rec { system = "x86_64-linux"; - src = fetchurl { - url = "https://github.com/muttleyxd/clang-tools-static-binaries/releases/download/${version}/clang-format-16_linux-amd64"; - hash = "sha256-5eTzOVcmuvSNGr2lyQrBO2Rs0vOed5k7ICPw0IPq4sE="; - }; + src = let + blobs = { + x86_64-linux = { + url = "https://github.com/muttleyxd/clang-tools-static-binaries/releases/download/${version}/clang-format-16_linux-amd64"; + hash = "sha256-5eTzOVcmuvSNGr2lyQrBO2Rs0vOed5k7ICPw0IPq4sE="; + }; + x86_64-darwin = { + url = "https://github.com/muttleyxd/clang-tools-static-binaries/releases/download/${version}/clang-format-16_macosx-amd64"; + hash = "sha256-I9F/mn3I+ZAq2aDw0Mc9Imo+AJMwbzsjalqBSo/7DL4="; + }; + }; + in + fetchurl blobs.${pkgs.system}; - nativeBuildInputs = [ + nativeBuildInputs = lib.optionals stdenv.isLinux [ autoPatchelfHook ]; @@ -29,6 +39,6 @@ stdenv.mkDerivation rec { meta = with lib; { homepage = "https://github.com/muttleyxd/clang-tools-static-binaries"; - platforms = platforms.linux; + platforms = platforms.linux ++ platforms.darwin; }; } diff --git a/pkgs/proj/default.nix b/pkgs/proj/default.nix index e319c81..ccd71d5 100644 --- a/pkgs/proj/default.nix +++ b/pkgs/proj/default.nix @@ -1,4 +1,5 @@ -{ buildPythonApplication +{ pkgs +, buildPythonApplication , pytestCheckHook , typing-extensions , enlighten @@ -34,17 +35,21 @@ }: let + lib = pkgs.lib; + stdenv = pkgs.stdenv; + bins = [ - valgrind - kcachegrind ff-clang-format - bencher-cli - hotspot - perf ccache compdb cmake lcov + ] ++ lib.optionals stdenv.isLinux [ + bencher-cli + hotspot + valgrind + kcachegrind + perf ]; in buildPythonApplication {