8 , acceptLicense ? config.segger-jlink.acceptLicense or false
15 source = import ./source.nix;
16 supported = removeAttrs source ["version"];
18 platform = supported.${stdenv.system} or (throw "unsupported platform ${stdenv.system}");
20 inherit (source) version;
22 url = "https://www.segger.com/downloads/jlink/JLink_Linux_V${version}_${platform.name}.tgz";
25 assert !acceptLicense -> throw ''
26 Use of the "SEGGER JLink Software and Documentation pack" requires the
27 acceptance of the following licenses:
29 - SEGGER Downloads Terms of Use [1]
30 - SEGGER Software Licensing [2]
32 You can express acceptance by setting acceptLicense to true in your
33 configuration. Note that this is not a free license so it requires allowing
34 unfree licenses as well.
37 nixpkgs.config.allowUnfree = true;
38 nixpkgs.config.segger-jlink.acceptLicense = true;
42 segger-jlink.acceptLicense = true;
45 [2]: https://www.segger.com/purchase/licensing/
49 inherit (platform) hash;
50 curlOpts = "--data accept_license_agreement=accepted";
53 qt4-bundled = callPackage ./qt4-bundled.nix { inherit src version; };
55 in stdenv.mkDerivation {
56 pname = "segger-jlink";
61 ] ++ lib.optionals (!headless) [
65 buildInputs = lib.optionals (!headless) [
69 # Udev is loaded late at runtime
77 desktopItems = lib.optionals (!headless) (
82 icon = "applications-utilities";
84 genericName = "SEGGER ${entry}";
85 categories = [ "Development" ];
88 startupNotify = false;
111 ${lib.optionalString (!headless) ''
112 # Install binaries and runtime files into /opt/
113 mv J* ETC GDBServer Firmwares $out/opt
115 # Link executables into /bin/
117 for binr in $out/opt/*Exe; do
118 binrlink=''${binr#"$out/opt/"}
119 ln -s $binr $out/bin/$binrlink
120 # Create additional symlinks without "Exe" suffix
121 binrlink=''${binrlink/%Exe}
122 ln -s $binr $out/bin/$binrlink
125 # Copy special alias symlinks
126 for slink in $(find $out/opt/. -type l); do
127 cp -P -n $slink $out/bin || true
133 install -Dm444 libjlinkarm.so* -t $out/lib
134 for libr in $out/lib/libjlinkarm.*; do
138 # Install docs and examples
140 mv Doc $out/share/docs
141 mv Samples $out/share/examples
144 install -Dm444 99-jlink.rules -t $out/lib/udev/rules.d/
149 passthru.updateScript = ./update.py;
152 description = "J-Link Software and Documentation pack";
153 homepage = "https://www.segger.com/downloads/jlink/#J-LinkSoftwareAndDocumentationPack";
154 changelog = "https://www.segger.com/downloads/jlink/ReleaseNotes_JLink.html";
155 license = licenses.unfree;
156 platforms = attrNames supported;
157 maintainers = with maintainers; [