2021-01-17 17:28:51 +00:00
|
|
|
{ stdenv, lib, fetchurl, makeWrapper, which, zlib, libGL, glib, xorg, libxkbcommon
|
2016-11-27 09:21:25 +00:00
|
|
|
, xdg_utils
|
2016-07-25 05:12:29 +01:00
|
|
|
# For glewinfo
|
|
|
|
, libXmu, libXi, libXext }:
|
|
|
|
|
|
|
|
let
|
|
|
|
packages = [
|
2018-03-17 15:47:55 +00:00
|
|
|
stdenv.cc.cc zlib glib xorg.libX11 libxkbcommon libXmu libXi libXext libGL
|
2016-07-25 05:12:29 +01:00
|
|
|
];
|
2021-01-17 17:28:51 +00:00
|
|
|
libPath = lib.makeLibraryPath packages;
|
2016-07-25 05:12:29 +01:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2019-05-27 06:46:05 +01:00
|
|
|
pname = "genymotion";
|
2016-11-27 10:18:24 +00:00
|
|
|
version = "2.8.0";
|
2019-05-27 06:46:05 +01:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://dl.genymotion.com/releases/genymotion-${version}/genymotion-${version}-linux_x64.bin";
|
2016-07-25 05:12:29 +01:00
|
|
|
name = "genymotion-${version}-linux_x64.bin";
|
2016-11-27 10:18:24 +00:00
|
|
|
sha256 = "0lvfdlpmmsyq2i9gs4mf6a8fxkfimdr4rhyihqnfhjij3fzxz4lk";
|
2016-07-25 05:12:29 +01:00
|
|
|
};
|
|
|
|
|
2016-11-27 09:21:25 +00:00
|
|
|
buildInputs = [ makeWrapper which xdg_utils ];
|
2016-07-25 05:12:29 +01:00
|
|
|
|
|
|
|
unpackPhase = ''
|
2016-11-27 09:21:25 +00:00
|
|
|
mkdir -p phony-home $out/share/applications
|
|
|
|
export HOME=$TMP/phony-home
|
|
|
|
|
2019-05-27 06:46:05 +01:00
|
|
|
mkdir ${pname}
|
|
|
|
echo "y" | sh $src -d ${pname}
|
|
|
|
sourceRoot=${pname}
|
2016-11-27 09:21:25 +00:00
|
|
|
|
|
|
|
substitute phony-home/.local/share/applications/genymobile-genymotion.desktop \
|
2019-05-27 06:46:05 +01:00
|
|
|
$out/share/applications/genymobile-genymotion.desktop --replace "$TMP/${pname}" "$out/libexec"
|
2016-07-25 05:12:29 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin $out/libexec
|
|
|
|
mv genymotion $out/libexec/
|
2016-11-27 09:21:25 +00:00
|
|
|
ln -s $out/libexec/genymotion/{genymotion,player} $out/bin
|
2016-07-25 05:12:29 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
fixupPhase = ''
|
|
|
|
patchInterpreter() {
|
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
|
|
"$out/libexec/genymotion/$1"
|
|
|
|
}
|
|
|
|
|
|
|
|
patchExecutable() {
|
|
|
|
patchInterpreter "$1"
|
2016-11-27 09:21:25 +00:00
|
|
|
wrapProgram "$out/libexec/genymotion/$1" \
|
2016-07-25 05:12:29 +01:00
|
|
|
--set "LD_LIBRARY_PATH" "${libPath}"
|
|
|
|
}
|
|
|
|
|
|
|
|
patchTool() {
|
|
|
|
patchInterpreter "tools/$1"
|
|
|
|
wrapProgram "$out/libexec/genymotion/tools/$1" \
|
|
|
|
--set "LD_LIBRARY_PATH" "${libPath}"
|
|
|
|
}
|
|
|
|
|
|
|
|
patchExecutable genymotion
|
|
|
|
patchExecutable player
|
|
|
|
|
|
|
|
patchTool adb
|
|
|
|
patchTool aapt
|
|
|
|
patchTool glewinfo
|
|
|
|
|
|
|
|
rm $out/libexec/genymotion/libxkbcommon*
|
|
|
|
'';
|
|
|
|
|
2021-01-17 17:28:51 +00:00
|
|
|
meta = with lib; {
|
2016-07-25 05:12:29 +01:00
|
|
|
description = "Fast and easy Android emulation";
|
|
|
|
longDescription = ''
|
|
|
|
Genymotion is a relatively fast Android emulator which comes with
|
|
|
|
pre-configured Android (x86 with OpenGL hardware acceleration) images,
|
|
|
|
suitable for application testing.
|
|
|
|
'';
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://www.genymotion.com/";
|
2021-01-17 17:28:51 +00:00
|
|
|
license = licenses.unfree;
|
2016-11-27 10:18:24 +00:00
|
|
|
platforms = ["x86_64-linux"];
|
2021-01-17 17:28:51 +00:00
|
|
|
maintainers = [ maintainers.puffnfresh ];
|
2016-07-25 05:12:29 +01:00
|
|
|
};
|
|
|
|
}
|