2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, zlib, libpng, bzip2, libusb-compat-0_1, openssl }:
|
2014-03-10 01:57:48 +00:00
|
|
|
|
2019-08-21 17:14:01 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "xpwn";
|
|
|
|
version = "0.5.8git";
|
2014-03-10 01:57:48 +00:00
|
|
|
|
2019-08-21 17:14:01 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "planetbeing";
|
|
|
|
repo = pname;
|
|
|
|
rev = "ac362d4ffe4d0489a26144a1483ebf3b431da899";
|
|
|
|
sha256 = "1qw9vbk463fpnvvvfgzxmn9add2p30k832s09mlycr7z1hrh3wyf";
|
2014-03-10 01:57:48 +00:00
|
|
|
};
|
|
|
|
|
2022-06-03 09:00:35 +00:00
|
|
|
# Workaround build failure on -fno-common toolchains:
|
|
|
|
# ld: ../ipsw-patch/libxpwn.a(libxpwn.c.o):(.bss+0x4): multiple definition of
|
|
|
|
# `endianness'; CMakeFiles/xpwn-bin.dir/src/xpwn.cpp.o:(.bss+0x0): first defined here
|
2023-02-19 19:23:32 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-fcommon";
|
2022-06-03 09:00:35 +00:00
|
|
|
|
2014-03-10 01:57:48 +00:00
|
|
|
preConfigure = ''
|
2014-06-06 22:06:03 +00:00
|
|
|
rm BUILD # otherwise `mkdir build` fails on case insensitive file systems
|
2014-03-10 01:57:48 +00:00
|
|
|
sed -r -i \
|
|
|
|
-e 's/(install.*TARGET.*DESTINATION )\.\)/\1bin)/' \
|
|
|
|
-e 's!(install.*(FILE|DIR).*DESTINATION )([^)]*)!\1share/xpwn/\3!' \
|
|
|
|
*/CMakeLists.txt
|
|
|
|
sed -i -e '/install/d' CMakeLists.txt
|
|
|
|
'';
|
|
|
|
|
2019-08-21 17:14:01 +00:00
|
|
|
strictDeps = true;
|
|
|
|
nativeBuildInputs = [ cmake ];
|
2020-04-28 03:29:39 +00:00
|
|
|
buildInputs = [ zlib libpng bzip2 libusb-compat-0_1 openssl ];
|
2014-03-10 01:57:48 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2022-05-28 22:56:40 +00:00
|
|
|
broken = stdenv.isDarwin;
|
2014-09-11 03:10:02 +00:00
|
|
|
homepage = "http://planetbeing.lighthouseapp.com/projects/15246-xpwn";
|
2014-03-10 01:57:48 +00:00
|
|
|
description = "Custom NOR firmware loader/IPSW generator for the iPhone";
|
2014-09-11 03:10:02 +00:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = with platforms; linux ++ darwin;
|
2014-03-10 01:57:48 +00:00
|
|
|
};
|
|
|
|
}
|