nixpkgs/pkgs/development/mobile/xpwn/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

34 lines
1 KiB
Nix

{ lib, stdenv, fetchFromGitHub, cmake, zlib, libpng, bzip2, libusb-compat-0_1, openssl }:
stdenv.mkDerivation rec {
pname = "xpwn";
version = "0.5.8git";
src = fetchFromGitHub {
owner = "planetbeing";
repo = pname;
rev = "ac362d4ffe4d0489a26144a1483ebf3b431da899";
sha256 = "1qw9vbk463fpnvvvfgzxmn9add2p30k832s09mlycr7z1hrh3wyf";
};
preConfigure = ''
rm BUILD # otherwise `mkdir build` fails on case insensitive file systems
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
'';
strictDeps = true;
nativeBuildInputs = [ cmake ];
buildInputs = [ zlib libpng bzip2 libusb-compat-0_1 openssl ];
meta = with lib; {
homepage = "http://planetbeing.lighthouseapp.com/projects/15246-xpwn";
description = "Custom NOR firmware loader/IPSW generator for the iPhone";
license = licenses.gpl3Plus;
platforms = with platforms; linux ++ darwin;
};
}