3
0
Fork 0
forked from mirrors/nixpkgs

Revert "[WIP] flashtool: 0.9.14.0 -> 0.9.23.3"

This reverts commit 0e5c802120.

It was pulled accidentially -- this is not ready yet.
This commit is contained in:
Nikolay Amiantov 2016-07-04 00:23:42 +03:00
parent 29ae5a10fb
commit 5bed7df058
2 changed files with 22 additions and 32 deletions

View file

@ -1,6 +1,6 @@
{ stdenv, requireFile, p7zip, jre, libusb1, platformTools, gtk2, glib, libXtst, swt, makeWrapper, mono }:
{ stdenv, requireFile, p7zip, jre, libusb1, platformTools, gtk2, glib, libXtst }:
assert stdenv.isLinux;
assert stdenv.system == "i686-linux";
# TODO:
#
@ -13,49 +13,39 @@ assert stdenv.isLinux;
# mounted read-only. This doesn't matter, though, because the build
# instructions fix the executable bits already.
let
CP = "$(ls ./x10flasher_lib/*.jar|xargs|tr ' ' ':')";
SWT = "${swt}/jars/swt.jar";
ARCH = if stdenv.system == "i686-linux" then "32" else "64";
in
stdenv.mkDerivation rec {
name = "flashtool";
version = "0.9.22.3";
name = "flashtool-0.9.14.0";
src = requireFile {
url = "http://uploaded.net/file/fyc683jo";
name = "${name}-${version}-linux.tar.7z";
sha256 = "00sncfxi32y745cjf2zhaazs9p6zhpwqcrm91byja7d7pksf29ca";
url = "http://dfiles.eu/files/n8c1c3pgc";
name = "flashtool-0.9.14.0-linux.tar.7z";
sha256 = "0mfjdjj7clz2dhkg7lzy1m8hk8ngla7zgcryf51aki1gnpbb2zc1";
};
buildInputs = [ p7zip jre swt makeWrapper mono ];
buildInputs = [ p7zip jre ];
unpackPhase = ''
7z e ${src}
tar xf ${name}-${version}-linux.tar
tar xf ${name}-linux.tar
sourceRoot=FlashTool
'';
buildPhase = ''
rm x10flasher_lib/adb.linux.${ARCH}
rm x10flasher_lib/fastboot.linux.${ARCH}
ln -s ${platformTools}/platform-tools/adb x10flasher_lib/adb.linux.${ARCH}
ln -s ${platformTools}/platform-tools/fastboot x10flasher_lib/fastboot.linux.${ARCH}
ln -s ${platformTools}/platform-tools/adb x10flasher_lib/adb.linux
ln -s ${platformTools}/platform-tools/fastboot x10flasher_lib/fastboot.linux
ln -s ${libusb1.out}/lib/libusb-1.0.so.0 ./x10flasher_lib/linux/lib32/libusbx-1.0.so
ln -s ${libusb1.out}/lib/libusb-1.0.so.0 ./x10flasher_lib/linux/lib${ARCH}/libusbx-1.0.so
chmod +x x10flasher_lib/unyaffs.linux.x86 x10flasher_lib/bin2elf x10flasher_lib/bin2sin
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" x10flasher_lib/unyaffs.linux.x86
ln -sf unyaffs.linux.x86 x10flasher_lib/unyaffs.linux
rm FlashTool
makeWrapper ${jre}/bin/java $out/FlashTool \
--set JAVA_HOME "${jre}" \
--set PATH "$out:$PATH" \
--set LD_LIBRARY_PATH "${libXtst}/lib:${glib}/lib:${gtk2}/lib:${libusb1}/lib:${swt}/lib:x10flasher_lib/linux/lib${ARCH}:\$LD_LIBRARY_PATH" \
--add-flags "-classpath $out/x10flasher.jar:${CP}:${SWT} -Xms128m -Xmx512m -Duser.country=US -Duser.language=en -Djsse.enableSNIExtension=false gui.Main"
sed -i -e 's|Main.*$|Main|' $out/FlashTool
sed -i -e 's|./x10flasher_lib|$out/x10flasher_lib|' $out/FlashTool
ln -s swt32.jar x10flasher_lib/swtlin/swt.jar
sed -i \
-e 's|$(uname -m)|i686|' \
-e 's|export JAVA_HOME=.*|export JAVA_HOME=${jre}|' \
-e 's|export LD_LIBRARY_PATH=.*|export LD_LIBRARY_PATH=${libXtst}/lib:${glib}/lib:${gtk2}/lib:./x10flasher_lib/linux/lib32|' \
FlashTool FlashToolConsole
'';
installPhase = ''

View file

@ -1529,7 +1529,7 @@ in
flamerobin = callPackage ../applications/misc/flamerobin { };
flashtool = callPackage ../development/mobile/flashtool {
flashtool = callPackage_i686 ../development/mobile/flashtool {
platformTools = androidenv.platformTools;
};