2016-05-07 09:46:52 +01:00
|
|
|
{ stdenv, fetchFromGitHub, zlib, libusb1, cmake, qt5, enableGUI ? false }:
|
2016-01-16 00:36:34 +00:00
|
|
|
|
2017-02-02 14:01:55 +00:00
|
|
|
let version = "1.4.1-37-gb6fe7f8"; in
|
2011-08-21 01:10:12 +01:00
|
|
|
|
2016-05-07 00:39:48 +01:00
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "heimdall-${version}";
|
2011-08-21 01:10:12 +01:00
|
|
|
|
2015-01-20 05:37:44 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Benjamin-Dobell";
|
|
|
|
repo = "Heimdall";
|
2016-05-07 00:39:48 +01:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "10c71k251wxd05j6c76qlar5sd73zam1c1g2cq3cscqayd7rzafg";
|
2011-08-21 01:10:12 +01:00
|
|
|
};
|
|
|
|
|
2016-01-16 00:36:34 +00:00
|
|
|
buildInputs = [ zlib libusb1 cmake ];
|
2017-02-02 14:20:16 +00:00
|
|
|
|
2016-05-07 09:46:52 +01:00
|
|
|
cmakeFlags = [
|
2017-02-02 14:20:16 +00:00
|
|
|
"-DBUILD_TYPE=Release"
|
|
|
|
"-DDISABLE_FRONTEND=${if enableGUI then "OFF" else "ON"}"
|
|
|
|
] ++ stdenv.lib.optionals enableGUI [
|
2016-04-16 18:45:53 +01:00
|
|
|
"-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 09:46:52 +01:00
|
|
|
];
|
2013-08-31 15:36:47 +01:00
|
|
|
|
2016-05-07 09:46:52 +01: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"'
|
2017-02-02 14:20:16 +00:00
|
|
|
|
|
|
|
# Fix version string reported by the executable.
|
|
|
|
sed -i -e 's/version = "v.*"/version = "v${version}"/' heimdall/source/Interface.cpp
|
2016-05-07 09:46:52 +01:00
|
|
|
'';
|
2011-08-21 01:10:12 +01:00
|
|
|
|
2016-05-07 09:46:52 +01: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
|
|
|
|
'';
|
2011-08-21 01:10:12 +01:00
|
|
|
|
2017-02-02 14:20:16 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2011-08-21 01:10:12 +01:00
|
|
|
meta = {
|
2016-05-07 09:46:52 +01:00
|
|
|
homepage = "http://www.glassechidna.com.au/products/heimdall/";
|
|
|
|
description = "A cross-platform tool suite to flash firmware onto Samsung Galaxy S devices";
|
2014-06-19 05:19:00 +01:00
|
|
|
license = stdenv.lib.licenses.mit;
|
2016-08-02 18:50:55 +01:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2011-08-21 01:10:12 +01:00
|
|
|
};
|
|
|
|
}
|