1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/applications/misc/airtame/default.nix

80 lines
2.7 KiB
Nix
Raw Normal View History

{ stdenv, lib, fetchurl, makeDesktopItem, makeWrapper
, alsaLib, atk, cairo, cups, curl, dbus, expat, ffmpeg_3, fontconfig, freetype
2019-05-22 12:03:39 +01:00
, gdk-pixbuf, glib, glibc, gnome2, gtk2, libX11, libXScrnSaver, libXcomposite
, libXcursor, libXdamage, libXext, libXfixes, libXi, libXrandr, libXrender
, libXtst, libopus, libpulseaudio, libxcb, nspr, nss, pango, udev, x264
2017-12-15 01:28:39 +00:00
}:
let libPath = lib.makeLibraryPath [
alsaLib atk cairo cups curl dbus expat ffmpeg_3 fontconfig freetype gdk-pixbuf
2018-10-24 10:42:04 +01:00
glib glibc gnome2.GConf gtk2 libopus nspr nss pango stdenv.cc.cc udev x264
libX11 libXScrnSaver libXcomposite libXcursor libXdamage libXext libXfixes
libXi libXrandr libXrender libXtst libpulseaudio libxcb
];
in stdenv.mkDerivation rec {
2017-12-15 01:28:39 +00:00
pname = "airtame";
2018-10-24 10:42:04 +01:00
version = "3.3.0";
2017-12-15 01:28:39 +00:00
longName = "${pname}-application";
src = fetchurl {
url = "https://downloads.airtame.com/application/ga/lin_x64/releases/${longName}-${version}.tar.gz";
2018-10-24 10:42:04 +01:00
sha256 = "16ca1vcxpka26jcrfbxpq74kcizgrm138j94bby6kzqp2swhrl76";
2017-12-15 01:28:39 +00:00
};
nativeBuildInputs = [ makeWrapper ];
desktopItem = makeDesktopItem rec {
name = "airtame";
exec = longName;
comment = "Airtame Streaming Client";
desktopName = "Airtame";
icon = name;
genericName = comment;
categories = "Network;";
2017-12-15 01:28:39 +00:00
};
installPhase = ''
opt="$out/opt/airtame"
mkdir -p "$opt"
cp -R . "$opt"
mkdir -p "$out/bin"
ln -s "$opt/${longName}" "$out/bin/"
mkdir -p "$out/share"
cp -r "${desktopItem}/share/applications" "$out/share/"
mkdir -p "$out/share/icons"
ln -s "$opt/icon.png" "$out/share/icons/airtame.png"
# Flags and rpath are copied from launch-airtame.sh.
2018-10-24 10:42:04 +01:00
vendorlib="\
$opt/resources/app.asar.unpacked/modules/streamer/dist/deps/airtame-modules:\
$opt/resources/app.asar.unpacked/encryption/out/lib:\
$opt/resources/deps/airtame-core/lib:\
$opt/resources/deps/airtame-encryption/lib"
echo $vendorlib
rpath="${libPath}:$opt:$vendorlib"
find "$opt" \( -type f -executable -o -name "*.so" -o -name "*.so.*" \) \
-exec patchelf --set-rpath "$rpath" {} \;
2018-10-24 10:42:04 +01:00
# The main binary also needs libudev which was removed by --shrink-rpath.
2018-10-24 10:42:04 +01:00
interp="$(< $NIX_CC/nix-support/dynamic-linker)"
patchelf --set-interpreter "$interp" $opt/${longName}
2018-10-24 10:42:04 +01:00
wrapProgram $opt/${longName} \
--prefix LD_LIBRARY_PATH=$rpath \
--add-flags "--disable-gpu --enable-transparent-visuals"
2017-12-15 01:28:39 +00:00
'';
dontPatchELF = true;
2017-12-15 01:28:39 +00:00
meta = with stdenv.lib; {
homepage = "https://airtame.com/download";
2017-12-15 01:28:39 +00:00
description = "Wireless streaming client for Airtame devices";
license = licenses.unfree;
maintainers = with maintainers; [ thanegill ];
platforms = platforms.linux;
};
}