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

46 lines
1.4 KiB
Nix
Raw Normal View History

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