summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/fa/fadein/package.nix
blob: 2a02247d949e93ef4b6eb8c2e71f45e5dd4c417e (plain)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
{
  lib,
  stdenv,
  fetchzip,
  autoPatchelfHook,
  cairo,
  fontconfig,
  gdk-pixbuf,
  glib,
  gtk3,
  libuuid,
  pango,
  zlib,
  libsm,
  libx11,
  libxxf86vm,
  wayland,
  curl,
  webkitgtk_4_1,
  libjpeg8,
  wrapGAppsHook3,
}:

stdenv.mkDerivation {
  pname = "fadein";
  version = "5.0.13";

  src = fetchzip {
    url = "https://web.archive.org/web/20260819062342/https://www.fadeinpro.com/download/demo/fadein-linux-x64-demo.tar.gz";
    hash = "sha256-6rq4DyuE8W6BOeNSFvwm102nXqVSHeUEHXuZbh3fbdA=";
  };

  strictDeps = true;
  __structuredAttrs = true;

  nativeBuildInputs = [
    autoPatchelfHook
    wrapGAppsHook3
  ];

  buildInputs = [
    cairo
    fontconfig
    gdk-pixbuf
    glib
    gtk3
    libuuid
    pango
    (lib.getLib stdenv.cc.cc)
    libsm
    libx11
    libxxf86vm
    curl
    libjpeg8
    webkitgtk_4_1
    wayland
    zlib
  ];

  installPhase = ''
    runHook preInstall
    mkdir -p $out/share
    cp -r usr/share/* $out/share

    # Fix icons
    for size in 16 24 32 48 64 96 128 256 512; do
      install -Dm444 \
        "usr/share/fadein/icon_app/fadein_icon_''${size}x''${size}.png" \
        "$out/share/icons/hicolor/''${size}x''${size}/apps/fadein.png"

      install -Dm444 \
        "usr/share/fadein/icon_app/fadein_doc_''${size}x''${size}.png" \
        "$out/share/icons/hicolor/''${size}x''${size}/mimetypes/application-x-fadein-document.png"
    done

    substituteInPlace $out/share/applications/fadein.desktop \
      --replace-fail 'Icon=/usr/share/fadein/icon_app/fadein_icon_256x256.png' 'Icon=fadein'

    mkdir -p $out/bin
    ln -s "$out/share/fadein/fadein" "$out/bin/fadein"
    runHook postInstall
  '';

  meta = {
    description = "Writing motion picture screenplays";
    homepage = "https://www.fadeinpro.com/";
    changelog = "https://www.fadeinpro.com/page.pl?content=version_notes";
    license = lib.licenses.unfree;
    mainProgram = "fadein";
    maintainers = with lib.maintainers; [ pancaek ];
    platforms = [ "x86_64-linux" ];
  };
}