diff options
author | Michael Donovan <michael@mdonovan.dev> | 2023-08-18 18:57:16 -0500 |
---|---|---|
committer | Anderson Torres <torres.anderson.85@protonmail.com> | 2023-08-19 22:22:45 +0000 |
commit | 3cecf7bb5a36096c28acca2524c613122e098aef (patch) | |
tree | b9f8634ba4c8ea9188530e6e5aa4795db878dccb /pkgs/development/embedded | |
parent | 5a6d170f6045f6b10a296fda0cf6c9ca7600cc8e (diff) |
teensy-cmake-macros: init at unstable-2023-04-15
Co-authored-by: Anderson Torres <torres.anderson.85@protonmail.com>
Diffstat (limited to 'pkgs/development/embedded')
3 files changed, 57 insertions, 0 deletions
diff --git a/pkgs/development/embedded/teensy-cmake-macros/default.nix b/pkgs/development/embedded/teensy-cmake-macros/default.nix new file mode 100644 index 0000000000000..7254becdbce70 --- /dev/null +++ b/pkgs/development/embedded/teensy-cmake-macros/default.nix @@ -0,0 +1,35 @@ +{ stdenv +, lib +, fetchFromGitHub +, cmake +, pkg-config +, callPackage +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "teensy-cmake-macros"; + version = "unstable-2023-04-15"; + + src = fetchFromGitHub { + owner = "newdigate"; + repo = "teensy-cmake-macros"; + rev = "dc401ed23e6e13a9db3cd2a65f611a4738df3b0e"; + hash = "sha256-E+BOlsCJtOScr3B5GSv1WM6rFv6cFYvm/iJ893fsmXM="; + }; + + propagatedBuildInputs = [ cmake pkg-config ]; + + passthru = { + hook = callPackage ./hook.nix { + teensy-cmake-macros = finalAttrs.finalPackage; + }; + }; + + meta = with lib; { + description = "CMake macros for building teensy projects"; + platforms = platforms.all; + homepage = "https://github.com/newdigate/teensy-cmake-macros"; + license = licenses.mit; + maintainers = [ maintainers.michaeldonovan ]; + }; +}) diff --git a/pkgs/development/embedded/teensy-cmake-macros/hook.nix b/pkgs/development/embedded/teensy-cmake-macros/hook.nix new file mode 100644 index 0000000000000..83a4e6828d4ae --- /dev/null +++ b/pkgs/development/embedded/teensy-cmake-macros/hook.nix @@ -0,0 +1,17 @@ +{ lib +, makeSetupHook +, teensy-cmake-macros +}: + +makeSetupHook { + name = "teensy-cmake-macros-hook"; + + propagatedBuildInputs = [ teensy-cmake-macros ]; + + passthru = { inherit teensy-cmake-macros; }; + + meta = { + description = "A setup hook for teensy-cmake-macros"; + inherit (teensy-cmake-macros.meta) maintainers platforms broken; + }; +} ./setup-hook.sh diff --git a/pkgs/development/embedded/teensy-cmake-macros/setup-hook.sh b/pkgs/development/embedded/teensy-cmake-macros/setup-hook.sh new file mode 100644 index 0000000000000..71026eedcf65e --- /dev/null +++ b/pkgs/development/embedded/teensy-cmake-macros/setup-hook.sh @@ -0,0 +1,5 @@ +teensyCMakeMacrosEnvHook() { + cmakeFlagsArray+=(-DCMAKE_MODULE_PATH=@out@/lib/cmake) +} + +addEnvHooks "$targetOffset" teensyCMakeMacrosEnvHook |