From 05bebd7215b3d627bf08fe769d9dfafb5b5a47e5 Mon Sep 17 00:00:00 2001 From: mt_caret Date: Wed, 18 Apr 2018 00:06:41 +0900 Subject: [PATCH] sweep-visualizer: init at 0.15.0 (#38607) * sweep-visualizer: init at 0.15.0 * restrict platform * fix maintainers * fix license attribute --- pkgs/tools/misc/sweep-visualizer/default.nix | 60 ++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 62 insertions(+) create mode 100644 pkgs/tools/misc/sweep-visualizer/default.nix diff --git a/pkgs/tools/misc/sweep-visualizer/default.nix b/pkgs/tools/misc/sweep-visualizer/default.nix new file mode 100644 index 000000000000..c1f3fbea8e5c --- /dev/null +++ b/pkgs/tools/misc/sweep-visualizer/default.nix @@ -0,0 +1,60 @@ +{ stdenv, lib, makeWrapper, fetchurl, + alsaLib, atk, cairo, cups, dbus, expat, fontconfig, freetype, gdk_pixbuf, glib, + gnome2, gtk2-x11, nspr, nss, + libX11, libxcb, libXcomposite, libXcursor, libXdamage, libXext, libXfixes, + libXi, libXrandr, libXrender, libXScrnSaver, libXtst, + libudev0-shim +}: + stdenv.mkDerivation rec { + name = "sweep-visualizer-${version}"; + version = "0.15.0"; + + src = fetchurl { + url = "https://s3.amazonaws.com/scanse/Visualizer/v${version}/sweepvisualizer_${version}_amd64.deb"; + sha256 = "1k6rdjw2340qrzafv6hjxvbvyh3s1wad6d3629nchdcrpyx9xy1c"; + }; + + nativeBuildInputs = [ makeWrapper ]; + + sourceRoot = "."; + unpackCmd = '' + ar p "$src" data.tar.xz | tar xJ + ''; + + buildPhase = ":"; + + installPhase = '' + mkdir -p $out/lib $out/bin $out/share/sweep-visualizer + mv usr/share/* $out/share + mv opt/Sweep\ Visualizer\ BETA/* $out/share/sweep-visualizer/ + mv $out/share/sweep-visualizer/*.so $out/lib/ + ln -s $out/share/sweep-visualizer/sweep_visualizer $out/bin/sweep_visualizer + ''; + + preFixup = let + libPath = lib.makeLibraryPath [ + alsaLib atk cairo cups.lib dbus.lib expat fontconfig.lib freetype + gdk_pixbuf glib gnome2.GConf gnome2.pango gtk2-x11 nspr nss stdenv.cc.cc.lib + libX11 libxcb libXcomposite libXcursor libXdamage libXext libXfixes + libXi libXrandr libXrender libXScrnSaver libXtst + ]; + runtimeLibs = lib.makeLibraryPath [ libudev0-shim ]; + in '' + for lib in $out/lib/*.so; do + patchelf --set-rpath "$out/lib:${libPath}" $lib + done + patchelf \ + --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ + --set-rpath "$out/lib:${libPath}" \ + $out/share/sweep-visualizer/sweep_visualizer + wrapProgram "$out/bin/sweep_visualizer" --prefix LD_LIBRARY_PATH : ${runtimeLibs} + ''; + + meta = with stdenv.lib; { + homepage = https://support.scanse.io/hc/en-us/articles/115006008948-Visualizer-Overview; + description = "A minimal desktop application for interfacing with the Sweep device"; + license = licenses.unfree; + platforms = [ "x86_64-linux" ]; + maintainers = with maintainers; [ mt-caret ]; + }; + } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7c056b86b98e..e63b06fd317b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1358,6 +1358,8 @@ with pkgs; bash-supergenpass = callPackage ../tools/security/bash-supergenpass { }; + sweep-visualizer = callPackage ../tools/misc/sweep-visualizer { }; + syscall_limiter = callPackage ../os-specific/linux/syscall_limiter {}; syslogng = callPackage ../tools/system/syslog-ng { };