nixpkgs/pkgs/by-name/bt/bt-fw-converter/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

37 lines
1.2 KiB
Nix

{ lib, stdenv, fetchurl, makeWrapper, perl, perlPackages, bluez }:
stdenv.mkDerivation rec {
pname = "bt-fw-converter";
version = "2017-02-19";
rev = "2d8b34402df01c6f7f4b8622de9e8b82fadf4153";
src = fetchurl {
url = "https://raw.githubusercontent.com/winterheart/broadcom-bt-firmware/${rev}/tools/bt-fw-converter.pl";
sha256 = "c259b414a4a273c89a0fa7159b3ef73d1ea62b6de91c3a7c2fcc832868e39f4b";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ perl perlPackages.RegexpGrammars bluez ];
unpackCmd = ''
mkdir -p ${pname}-${version}
cp $src ${pname}-${version}/bt-fw-converter.pl
'';
installPhase = ''
install -D -m755 bt-fw-converter.pl $out/bin/bt-fw-converter
substituteInPlace $out/bin/bt-fw-converter --replace /usr/bin/hex2hcd ${bluez}/bin/hex2hcd
wrapProgram $out/bin/bt-fw-converter --set PERL5LIB $PERL5LIB
'';
meta = with lib; {
homepage = "https://github.com/winterheart/broadcom-bt-firmware/";
description = "Tool that converts hex to hcd based on inf file";
mainProgram = "bt-fw-converter";
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [ zraexy ];
};
}