nixpkgs/pkgs/tools/misc/heimdall/default.nix

49 lines
1.5 KiB
Nix
Raw Normal View History

2016-01-16 00:36:34 +00:00
{ stdenv, fetchFromGitHub, zlib, libusb1, cmake, qt5
, enableGUI ? false }:
let version = "d0526a3"; in
let verName = "1.4.2pre"; in
2015-01-20 05:37:44 +00:00
stdenv.mkDerivation rec {
2016-01-16 00:36:34 +00:00
name = "heimdall-${verName}";
2015-01-20 05:37:44 +00:00
src = fetchFromGitHub {
owner = "Benjamin-Dobell";
repo = "Heimdall";
2016-01-16 00:36:34 +00:00
rev = "${version}";
sha256 = "1y8gvqprajlml1z6mjcrlj54m9xsr8691nqagakkkis7hs1lgzmp";
};
2016-01-16 00:36:34 +00:00
buildInputs = [ zlib libusb1 cmake ];
patchPhase = stdenv.lib.optional (!enableGUI) ''
sed -i '/heimdall-frontend/d' CMakeLists.txt
'';
enableParallelBuilding = true;
cmakeFlags = ["-DQt5Widgets_DIR=${qt5.qtbase}/lib/cmake/Qt5Widgets"
"-DQt5Gui_DIR=${qt5.qtbase}/lib/cmake/Qt5Gui"
"-DQt5Core_DIR=${qt5.qtbase}/lib/cmake/Qt5Core"
"-DBUILD_TYPE=Release"];
2013-08-31 14:36:47 +00:00
preConfigure =
''
2016-01-16 00:36:34 +00:00
# Give ownership of the Galaxy S USB device to the logged in user.
substituteInPlace heimdall/60-heimdall.rules --replace 'MODE="0666"' 'TAG+="uaccess"'
'';
2016-01-16 00:36:34 +00:00
installPhase =
''
2016-01-16 00:36:34 +00:00
mkdir -p $out/bin $out/share/doc/heimdall $out/lib/udev/rules.d
cp bin/heimdall $out/bin
cp ../Linux/README $out/share/doc/heimdall
cp ../heimdall/60-heimdall.rules $out/lib/udev/rules.d
'' + stdenv.lib.optionalString enableGUI ''
2016-01-16 00:36:34 +00:00
cp bin/heimdall-frontend $out/bin
'';
meta = {
homepage = http://www.glassechidna.com.au/products/heimdall/;
description = "A cross-platform open-source tool suite used to flash firmware onto Samsung Galaxy S devices";
license = stdenv.lib.licenses.mit;
};
}