nixos-config/externals/packages/jlink/default.nix

60 lines
1.4 KiB
Nix
Raw Normal View History

2023-08-26 23:00:18 +00:00
{ stdenv, lib, fetchurl, autoPatchelfHook, substituteAll, qt4, fontconfig
, freetype, libusb, libICE, libSM, ncurses5, udev, libX11, libXext, libXcursor
, libXfixes, libXrender, libXrandr }:
2020-10-02 03:16:09 +00:00
let
2023-08-26 23:00:18 +00:00
conf = (lib.importJSON ./version.json).${stdenv.hostPlatform.system} or (throw
"unsupported system ${stdenv.hostPlatform.system}");
in stdenv.mkDerivation rec {
2020-10-02 03:16:09 +00:00
pname = "jlink";
2021-11-18 01:43:03 +00:00
version = conf.version;
2020-10-02 03:16:09 +00:00
2023-08-26 23:00:18 +00:00
src = fetchurl { inherit (conf) url hash curlOpts; };
2020-10-02 03:16:09 +00:00
dontConfigure = true;
dontBuild = true;
dontStrip = true;
2022-07-10 04:20:33 +00:00
preferLocalBuild = true;
2020-10-02 03:16:09 +00:00
nativeBuildInputs = [ autoPatchelfHook ];
buildInputs = [
qt4
fontconfig
freetype
libusb
libICE
libSM
ncurses5
udev
libX11
libXext
libXcursor
libXfixes
libXrender
libXrandr
];
runtimeDependencies = [ udev ];
installPhase = ''
mkdir -p $out/{JLink,bin}
cp -R * $out/JLink
ln -s $out/JLink/J* $out/bin/
rm -r $out/JLink/libQt*
2020-10-02 03:16:09 +00:00
install -D -t $out/lib/udev/rules.d 99-jlink.rules
'';
preFixup = ''
patchelf --add-needed libudev.so.1 $out/JLink/libjlinkarm.so
'';
2021-11-18 01:43:03 +00:00
passthru.updateScript = ./update.py;
2021-06-14 14:21:44 +00:00
meta = with lib; {
2020-10-02 03:16:09 +00:00
homepage = "https://www.segger.com/downloads/jlink";
description = "SEGGER J-Link";
license = licenses.unfree;
platforms = [ "x86_64-linux" "i686-linux" "armv7l-linux" "aarch64-linux" ];
maintainers = with maintainers; [ artemist ];
};
}