anvil-editor: init at 0.4
[NixPkgs.git] / pkgs / development / tools / ldid / default.nix
blobc3a988885cec5204b9a303e4cc2b71d0c62f6d3f
1 { lib
2 , stdenv
3 , fetchgit
4 , libplist
5 , libxml2
6 , openssl
7 , CoreFoundation
8 , Security
9 }:
11 stdenv.mkDerivation rec {
12   pname = "ldid";
13   version = "2.1.5";
15   src = fetchgit {
16     url = "git://git.saurik.com/ldid.git";
17     rev = "v${version}";
18     hash = "sha256-RM5pU3mrgyvwNfWKNvCT3UYVGKtVhD7ifgp8fq9xXiM=";
19   };
21   strictDeps = true;
23   buildInputs = [
24     libplist
25     libxml2
26     openssl
27   ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
28     CoreFoundation
29     Security
30   ];
32   NIX_LDFLAGS = [
33     "-lcrypto"
34     "-lplist-2.0"
35     "-lxml2"
36   ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
37     "-framework CoreFoundation"
38     "-framework Security"
39   ];
41   buildPhase = ''
42     runHook preBuild
44     cc -c -o lookup2.o lookup2.c -I.
45     c++ -std=c++11 -o ldid lookup2.o ldid.cpp -I. ${toString NIX_LDFLAGS}
47     runHook postBuild
48   '';
50   installPhase = ''
51     runHook preInstall
53     install -Dm755 {,$out/bin/}ldid
54     ln -s $out/bin/ldid $out/bin/ldid2
56     runHook postInstall
57   '';
59   meta = with lib; {
60     description = "Link Identity Editor";
61     homepage = "https://cydia.saurik.com/info/ldid/";
62     maintainers = with maintainers; [ wegank ];
63     platforms = platforms.unix;
64     license = licenses.agpl3Only;
65   };