about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libgourou/default.nix
blob: 78b5654873bdbd6601ce1416c2fac670798588e2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{ lib
, stdenv
, fetchzip
, pugixml
, updfparser
, curl
, openssl
, libzip
, installShellFiles
}:

stdenv.mkDerivation rec {
  name = "libgourou";
  version = "0.8.2";

  src = fetchzip {
    url = "https://indefero.soutade.fr/p/${name}/source/download/v${version}/";
    sha256 = "sha256-adkrvBCgN07Ir+J3JFCy+X9p9609lj1w8nElrlHXTxc";
    extension = "zip";
  };

  postPatch = ''
    patchShebangs scripts/setup.sh
  '';

  postConfigure = ''
    mkdir lib
    ln -s ${updfparser}/lib lib/updfparser
  '';

  nativeBuildInputs = [ installShellFiles ];
  buildInputs = [ pugixml updfparser curl openssl libzip ];

  makeFlags = [ "BUILD_STATIC=1" "BUILD_SHARED=1" ];

  installPhase = ''
    runHook preInstall
    install -Dt $out/include include/libgourou*.h
    install -Dt $out/lib libgourou.so
    install -Dt $out/lib libgourou.so.${version}
    install -Dt $out/lib libgourou.a
    install -Dt $out/bin utils/acsmdownloader
    install -Dt $out/bin utils/adept_{activate,loan_mgt,remove}
    installManPage utils/man/*.1
    runHook postInstall
  '';

  meta = with lib; {
    description = "Implementation of Adobe's ADEPT protocol for ePub/PDF DRM";
    homepage = "https://indefero.soutade.fr/p/libgourou";
    license = licenses.lgpl3Plus;
    maintainers = with maintainers; [ autumnal ];
    platforms = platforms.all;
    broken = stdenv.isDarwin;
  };
}