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

79 lines
1.4 KiB
Nix
Raw Normal View History

2020-10-02 03:16:09 +00:00
{ stdenv
2021-06-14 14:21:44 +00:00
, lib
2020-10-02 03:16:09 +00:00
, fetchurl
, autoPatchelfHook
, substituteAll
, qt4
, fontconfig
, freetype
, libusb
, libICE
, libSM
, ncurses5
, udev
, libX11
, libXext
, libXcursor
, libXfixes
, libXrender
, libXrandr
}:
let
2021-11-18 01:43:03 +00:00
conf = (lib.importJSON ./version.json).${stdenv.hostPlatform.system} or (throw "unsupported system ${stdenv.hostPlatform.system}");
2020-10-02 03:16:09 +00:00
in
stdenv.mkDerivation rec {
pname = "jlink";
2021-11-18 01:43:03 +00:00
version = conf.version;
2020-10-02 03:16:09 +00:00
src = fetchurl {
2021-11-18 22:11:03 +00:00
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/bin/JLinkDevices.xml $out/JLink/libQt*
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 ];
};
}