1{ lib
2, stdenv
3, fetchFromGitHub
4, fetchpatch
5, openssl
6}:
7
8stdenv.mkDerivation rec {
9 pname = "decoder";
10 version = "unstable-2021-11-20";
11
12 src = fetchFromGitHub {
13 owner = "PeterPawn";
14 repo = "decoder";
15 rev = "da0f826629d4e7b873f9d1a39f24c50ff0a68cd2";
16 sha256 = "sha256-1sT1/iwtc2ievmLuNuooy9b14pTs1ZC5noDwzFelk7w=";
17 };
18
19 patches = [
20 # Pull fix pending upstream inclusion for -fno-common toolchains:
21 # https://github.com/PeterPawn/decoder/pull/29
22 (fetchpatch {
23 name = "fno-common.patch";
24 url = "https://github.com/PeterPawn/decoder/commit/843ac477c31108023d8008581bf91c5a3acc1859.patch";
25 sha256 = "sha256-rRylz8cxgNyPSqL/THdgEBpzcVx1K+xbjUn4PwP9Jn4=";
26 })
27 ];
28
29 buildInputs = [
30 openssl
31 ];
32
33 makeFlags = [ "OPENSSL=y" ];
34
35 installPhase = ''
36 runHook preInstall
37
38 install -Dm755 src/decoder "$out/bin/decoder"
39
40 runHook postInstall
41 '';
42
43 meta = with lib; {
44 homepage = "https://github.com/PeterPawn/decoder";
45 description = ''"secrets" decoding for FRITZ!OS devices'';
46 license = licenses.gpl2Plus;
47 platforms = platforms.linux;
48 maintainers = with maintainers; [ Luflosi ];
49 };
50}