Skip to content

Commit

Permalink
flipperzero-toolchain: init at 39
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeRadu committed Feb 21, 2025
1 parent 9e4e299 commit dea5a91
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions pkgs/by-name/fl/flipperzero-toolchain/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
lib,
stdenv,
fetchurl,
autoPatchelfHook,
libgcc,
libnsl,
libxcrypt,
}:

stdenv.mkDerivation rec {
pname = "flipperzero-toolchain";
version = "39";

src = fetchurl {
url = "https://update.flipperzero.one/builds/toolchain/gcc-arm-none-eabi-12.3-x86_64-linux-flipper-${version}.tar.gz";
hash = "sha256-wETFkjP2b278+FSv/i1eCdutBNaHCdUTvHYLHZiJWFM=";
};

nativeBuildInputs = [ autoPatchelfHook ];

buildInputs = [
libgcc
stdenv.cc.cc.lib # for libstdc++.so.6
libnsl
libxcrypt
];

sourceRoot = ".";

shellHook = ''
export FBT_TOOLCHAIN_PATH=$out/opt/flipperzero-toolchain
'';

installPhase = ''
mkdir -p $out/opt/flipperzero-toolchain/toolchain/x86_64-linux
cp -r gcc-arm-none-eabi-12.3-x86_64-linux-flipper/* $out/opt/flipperzero-toolchain/toolchain/x86_64-linux
cp -L ${libnsl}/lib/libnsl.so.3 $out/opt/flipperzero-toolchain/toolchain/x86_64-linux/lib/libnsl.so.2
cp -L ${libxcrypt}/lib/libcrypt.so.2 $out/opt/flipperzero-toolchain/toolchain/x86_64-linux/lib/libcrypt.so.1
ln -sf $out/opt/flipperzero-toolchain/toolchain/x86_64-linux $out/opt/flipperzero-toolchain/toolchain/current
'';

meta = {
description = "Toolchain for the flipperzero";
homepage = "https://github.com/flipperdevices/flipperzero-toolchain";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ CodeRadu ];
platforms = lib.platforms.linux;
};
}

0 comments on commit dea5a91

Please sign in to comment.