lol
1{
2 lib,
3 stdenv,
4 fetchFromGitea,
5 pugixml,
6 updfparser,
7 curl,
8 openssl,
9 libzip,
10 installShellFiles,
11}:
12
13stdenv.mkDerivation (finalAttrs: {
14 pname = "libgourou";
15 version = "0.8.7";
16
17 src = fetchFromGitea {
18 domain = "forge.soutade.fr";
19 owner = "soutade";
20 repo = "libgourou";
21 tag = "v${finalAttrs.version}";
22 hash = "sha256-Tkft/pe3lH07pmyVibTEutIIvconUWDH1ZVN3qV4sSY=";
23 };
24
25 postPatch = ''
26 patchShebangs scripts/setup.sh
27 '';
28
29 postConfigure = ''
30 mkdir lib
31 ln -s ${updfparser}/lib lib/updfparser
32 '';
33
34 nativeBuildInputs = [ installShellFiles ];
35 buildInputs = [
36 pugixml
37 updfparser
38 curl
39 openssl
40 libzip
41 ];
42
43 makeFlags = [
44 "BUILD_STATIC=1"
45 "BUILD_SHARED=1"
46 ];
47
48 installPhase = ''
49 runHook preInstall
50 install -Dt $out/include include/libgourou*.h
51 install -Dt $out/lib libgourou.so
52 install -Dt $out/lib libgourou.so.${finalAttrs.version}
53 install -Dt $out/lib libgourou.a
54 install -Dt $out/bin utils/acsmdownloader
55 install -Dt $out/bin utils/adept_{activate,loan_mgt,remove}
56 installManPage utils/man/*.1
57 runHook postInstall
58 '';
59
60 meta = with lib; {
61 description = "Implementation of Adobe's ADEPT protocol for ePub/PDF DRM";
62 homepage = "https://forge.soutade.fr/soutade/libgourou";
63 license = licenses.lgpl3Plus;
64 maintainers = with maintainers; [ autumnal ];
65 platforms = platforms.all;
66 broken = stdenv.hostPlatform.isDarwin;
67 };
68})