about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/pa/parabolic/package.nix
blob: b386b09dd40a9c8aeefddc8dd1114636aef33ee0 (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{ lib
, buildDotnetModule
, fetchFromGitHub
, dotnetCorePackages
, gtk4
, libadwaita
, pkg-config
, wrapGAppsHook4
, glib
, shared-mime-info
, gdk-pixbuf
, blueprint-compiler
, python3
, ffmpeg
}:

buildDotnetModule rec {
  pname = "parabolic";
  version = "2023.12.0";

  src = fetchFromGitHub {
    owner = "NickvisionApps";
    repo = "Parabolic";
    rev = version;
    hash = "sha256-mbGByw/wgovo81l2LDtDE5p+Mh6aJ5DOcZCNzVfmAtA=";
    fetchSubmodules = true;
  };

  dotnet-sdk = dotnetCorePackages.sdk_8_0;
  dotnet-runtime = dotnetCorePackages.runtime_8_0;
  pythonEnv = python3.withPackages(ps: with ps; [ yt-dlp ]);

  projectFile = "NickvisionTubeConverter.GNOME/NickvisionTubeConverter.GNOME.csproj";
  nugetDeps = ./deps.nix;
  executables = "NickvisionTubeConverter.GNOME";

   nativeBuildInputs = [
    pkg-config
    wrapGAppsHook4
    glib
    shared-mime-info
    gdk-pixbuf
    blueprint-compiler
  ];

  buildInputs = [ gtk4 libadwaita ];

  runtimeDeps = [
    gtk4
    libadwaita
    glib
    gdk-pixbuf
  ];

  postPatch = ''
    substituteInPlace NickvisionTubeConverter.Shared/Linux/org.nickvision.tubeconverter.desktop.in --replace '@EXEC@' "NickvisionTubeConverter.GNOME"
  '';

  postInstall = ''
    install -Dm444 NickvisionTubeConverter.Shared/Resources/org.nickvision.tubeconverter.svg -t $out/share/icons/hicolor/scalable/apps/
    install -Dm444 NickvisionTubeConverter.Shared/Resources/org.nickvision.tubeconverter-symbolic.svg -t $out/share/icons/hicolor/symbolic/apps/
    install -Dm444 NickvisionTubeConverter.Shared/Linux/org.nickvision.tubeconverter.desktop.in -T $out/share/applications/org.nickvision.tubeconverter.desktop
  '';

  makeWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ pythonEnv ffmpeg ]}" ];

  passthru.updateScript = ./update.sh;

  meta = with lib; {
    description = "Download web video and audio";
    homepage = "https://github.com/NickvisionApps/Parabolic";
    license = licenses.mit;
    maintainers = with maintainers; [ ewuuwe ];
    mainProgram = "NickvisionTubeConverter.GNOME";
    platforms = platforms.linux;
  };
}