2013-02-28 21:15:04 +00:00
|
|
|
# Saleae logic analyzer software
|
|
|
|
#
|
|
|
|
# Suggested udev rules to be able to access the Logic device without being root:
|
|
|
|
# SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="0925", ATTR{idProduct}=="3881", MODE="0666"
|
|
|
|
# SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="21a9", ATTR{idProduct}=="1001", MODE="0666"
|
2014-03-08 08:52:18 +00:00
|
|
|
#
|
|
|
|
# In NixOS, simply add this package to services.udev.packages.
|
2013-02-28 21:15:04 +00:00
|
|
|
|
2016-09-11 22:24:51 +01:00
|
|
|
{ stdenv, fetchurl, unzip, glib, libSM, libICE, gtk2, libXext, libXft
|
2013-02-28 21:15:04 +00:00
|
|
|
, fontconfig, libXrender, libXfixes, libX11, libXi, libXrandr, libXcursor
|
saleae-logic: 1.1.15 -> 1.2.9
Changelog:
http://support.saleae.com/hc/en-us/articles/210245593-Saleae-Logic-Beta-Software-Changelog
(Yes, the changelog title contains the word 'beta', but as of version
1.2.9 the beta branding is removed from the software as the beta branch
was merged to master.)
This software update is required for newer logic analysers (e.g. Logic
Pro 8). (The original Logic is still supported, although it's difficult
to find info about it on their website.)
v1.2.9 grew new dependencies: libxcb, zlib, pciutils, xkeyboardconfig.
The LD_PRELOAD library hack, used to divert writes from
$out/Settings/settings.xml to $HOME/.saleae-logic-settings.xml, has been
updated. The new software writes more paths
($out/{Settings,Errors,Databases,Calibration}) and uses a few extra
library calls to access those paths
(open,openat,stat,access,unlink,...). So instead of single file
redirect, the library now redirects accesses to all those directories,
mirrored in $HOME/.saleae-logic/. (Existing
$HOME/.saleae-logic-settings.xml files will be automatically migrated to
$HOME/.saleae-logic/Settings/settings.xml.)
2016-05-13 17:22:37 +01:00
|
|
|
, freetype, libXinerama, libxcb, zlib, pciutils
|
2019-02-26 11:45:54 +00:00
|
|
|
, makeDesktopItem, xkeyboardconfig, runtimeShell
|
2013-02-28 21:15:04 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
libPath = stdenv.lib.makeLibraryPath [
|
2016-09-11 22:24:51 +01:00
|
|
|
glib libSM libICE gtk2 libXext libXft fontconfig libXrender libXfixes libX11
|
saleae-logic: 1.1.15 -> 1.2.9
Changelog:
http://support.saleae.com/hc/en-us/articles/210245593-Saleae-Logic-Beta-Software-Changelog
(Yes, the changelog title contains the word 'beta', but as of version
1.2.9 the beta branding is removed from the software as the beta branch
was merged to master.)
This software update is required for newer logic analysers (e.g. Logic
Pro 8). (The original Logic is still supported, although it's difficult
to find info about it on their website.)
v1.2.9 grew new dependencies: libxcb, zlib, pciutils, xkeyboardconfig.
The LD_PRELOAD library hack, used to divert writes from
$out/Settings/settings.xml to $HOME/.saleae-logic-settings.xml, has been
updated. The new software writes more paths
($out/{Settings,Errors,Databases,Calibration}) and uses a few extra
library calls to access those paths
(open,openat,stat,access,unlink,...). So instead of single file
redirect, the library now redirects accesses to all those directories,
mirrored in $HOME/.saleae-logic/. (Existing
$HOME/.saleae-logic-settings.xml files will be automatically migrated to
$HOME/.saleae-logic/Settings/settings.xml.)
2016-05-13 17:22:37 +01:00
|
|
|
libXi libXrandr libXcursor freetype libXinerama libxcb zlib stdenv.cc.cc.lib
|
2013-02-28 21:15:04 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "saleae-logic";
|
2016-10-26 13:40:55 +01:00
|
|
|
version = "1.2.10";
|
2013-02-28 21:15:04 +00:00
|
|
|
name = "${pname}-${version}";
|
|
|
|
|
|
|
|
src =
|
2018-08-20 20:11:29 +01:00
|
|
|
if stdenv.hostPlatform.system == "i686-linux" then
|
2013-02-28 21:15:04 +00:00
|
|
|
fetchurl {
|
saleae-logic: 1.1.15 -> 1.2.9
Changelog:
http://support.saleae.com/hc/en-us/articles/210245593-Saleae-Logic-Beta-Software-Changelog
(Yes, the changelog title contains the word 'beta', but as of version
1.2.9 the beta branding is removed from the software as the beta branch
was merged to master.)
This software update is required for newer logic analysers (e.g. Logic
Pro 8). (The original Logic is still supported, although it's difficult
to find info about it on their website.)
v1.2.9 grew new dependencies: libxcb, zlib, pciutils, xkeyboardconfig.
The LD_PRELOAD library hack, used to divert writes from
$out/Settings/settings.xml to $HOME/.saleae-logic-settings.xml, has been
updated. The new software writes more paths
($out/{Settings,Errors,Databases,Calibration}) and uses a few extra
library calls to access those paths
(open,openat,stat,access,unlink,...). So instead of single file
redirect, the library now redirects accesses to all those directories,
mirrored in $HOME/.saleae-logic/. (Existing
$HOME/.saleae-logic-settings.xml files will be automatically migrated to
$HOME/.saleae-logic/Settings/settings.xml.)
2016-05-13 17:22:37 +01:00
|
|
|
name = "saleae-logic-${version}-32bit.zip";
|
|
|
|
url = "http://downloads.saleae.com/logic/${version}/Logic%20${version}%20(32-bit).zip";
|
2016-10-26 13:40:55 +01:00
|
|
|
sha256 = "1dyrj07cgj2fvwi1sk97vady9ri8f8n7mxy9zyzmw9isngs7bmll";
|
2013-02-28 21:15:04 +00:00
|
|
|
}
|
2018-08-20 20:11:29 +01:00
|
|
|
else if stdenv.hostPlatform.system == "x86_64-linux" then
|
2013-02-28 21:15:04 +00:00
|
|
|
fetchurl {
|
saleae-logic: 1.1.15 -> 1.2.9
Changelog:
http://support.saleae.com/hc/en-us/articles/210245593-Saleae-Logic-Beta-Software-Changelog
(Yes, the changelog title contains the word 'beta', but as of version
1.2.9 the beta branding is removed from the software as the beta branch
was merged to master.)
This software update is required for newer logic analysers (e.g. Logic
Pro 8). (The original Logic is still supported, although it's difficult
to find info about it on their website.)
v1.2.9 grew new dependencies: libxcb, zlib, pciutils, xkeyboardconfig.
The LD_PRELOAD library hack, used to divert writes from
$out/Settings/settings.xml to $HOME/.saleae-logic-settings.xml, has been
updated. The new software writes more paths
($out/{Settings,Errors,Databases,Calibration}) and uses a few extra
library calls to access those paths
(open,openat,stat,access,unlink,...). So instead of single file
redirect, the library now redirects accesses to all those directories,
mirrored in $HOME/.saleae-logic/. (Existing
$HOME/.saleae-logic-settings.xml files will be automatically migrated to
$HOME/.saleae-logic/Settings/settings.xml.)
2016-05-13 17:22:37 +01:00
|
|
|
name = "saleae-logic-${version}-64bit.zip";
|
|
|
|
url = "http://downloads.saleae.com/logic/${version}/Logic%20${version}%20(64-bit).zip";
|
2016-10-26 13:40:55 +01:00
|
|
|
sha256 = "1skx2pfnic7pyss7c69qb7kg2xvflpxf112xkf9awk516dw1w4h7";
|
2013-02-28 21:15:04 +00:00
|
|
|
}
|
|
|
|
else
|
2017-12-05 23:06:43 +00:00
|
|
|
throw "Saleae Logic software requires i686-linux or x86_64-linux";
|
2013-02-28 21:15:04 +00:00
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "saleae-logic";
|
|
|
|
exec = "saleae-logic";
|
|
|
|
icon = ""; # the package contains no icon
|
|
|
|
comment = "Software for Saleae logic analyzers";
|
|
|
|
desktopName = "Saleae Logic";
|
|
|
|
genericName = "Logic analyzer";
|
|
|
|
categories = "Application;Development";
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ unzip ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
# Copy prebuilt app to $out
|
|
|
|
mkdir "$out"
|
|
|
|
cp -r * "$out"
|
|
|
|
|
|
|
|
# Patch it
|
2014-12-17 18:11:30 +00:00
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$out/Logic"
|
2016-04-30 21:56:43 +01:00
|
|
|
patchelf --set-rpath "${stdenv.cc.cc.lib}/lib:${stdenv.cc.cc.lib}/lib64:${libPath}:\$ORIGIN/Analyzers:\$ORIGIN" "$out/Logic"
|
2013-02-28 21:15:04 +00:00
|
|
|
|
|
|
|
# Build the LD_PRELOAD library that makes Logic work from a read-only directory
|
|
|
|
mkdir -p "$out/lib"
|
|
|
|
gcc -shared -fPIC -DOUT=\"$out\" "${./preload.c}" -o "$out/lib/preload.so" -ldl
|
|
|
|
|
|
|
|
# Make wrapper script that uses the LD_PRELOAD library
|
|
|
|
mkdir -p "$out/bin"
|
|
|
|
cat > "$out/bin/saleae-logic" << EOF
|
2019-02-26 11:45:54 +00:00
|
|
|
#!${runtimeShell}
|
2013-02-28 21:15:04 +00:00
|
|
|
export LD_PRELOAD="$out/lib/preload.so"
|
saleae-logic: 1.1.15 -> 1.2.9
Changelog:
http://support.saleae.com/hc/en-us/articles/210245593-Saleae-Logic-Beta-Software-Changelog
(Yes, the changelog title contains the word 'beta', but as of version
1.2.9 the beta branding is removed from the software as the beta branch
was merged to master.)
This software update is required for newer logic analysers (e.g. Logic
Pro 8). (The original Logic is still supported, although it's difficult
to find info about it on their website.)
v1.2.9 grew new dependencies: libxcb, zlib, pciutils, xkeyboardconfig.
The LD_PRELOAD library hack, used to divert writes from
$out/Settings/settings.xml to $HOME/.saleae-logic-settings.xml, has been
updated. The new software writes more paths
($out/{Settings,Errors,Databases,Calibration}) and uses a few extra
library calls to access those paths
(open,openat,stat,access,unlink,...). So instead of single file
redirect, the library now redirects accesses to all those directories,
mirrored in $HOME/.saleae-logic/. (Existing
$HOME/.saleae-logic-settings.xml files will be automatically migrated to
$HOME/.saleae-logic/Settings/settings.xml.)
2016-05-13 17:22:37 +01:00
|
|
|
export QT_XKB_CONFIG_ROOT="${xkeyboardconfig}/share/X11/xkb"
|
|
|
|
export PATH="${pciutils}/bin:\$PATH"
|
2013-02-28 21:15:04 +00:00
|
|
|
exec "$out/Logic" "\$@"
|
|
|
|
EOF
|
|
|
|
chmod a+x "$out"/bin/saleae-logic
|
|
|
|
|
|
|
|
# Copy the generated .desktop file
|
|
|
|
mkdir -p "$out/share/applications"
|
|
|
|
cp "$desktopItem"/share/applications/* "$out/share/applications/"
|
2014-03-08 08:52:18 +00:00
|
|
|
|
|
|
|
# Install provided udev rules
|
|
|
|
mkdir -p "$out/etc/udev/rules.d"
|
|
|
|
cp Drivers/99-SaleaeLogic.rules "$out/etc/udev/rules.d/"
|
2013-02-28 21:15:04 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Software for Saleae logic analyzers";
|
|
|
|
homepage = http://www.saleae.com/;
|
|
|
|
license = licenses.unfree;
|
2018-05-03 06:58:11 +01:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
2013-02-28 21:15:04 +00:00
|
|
|
maintainers = [ maintainers.bjornfor ];
|
|
|
|
};
|
|
|
|
}
|