about summary refs log tree commit diff
path: root/pkgs/by-name/wi/wiliwili/package.nix
blob: 302b47b65b4e5c627a290032ce97fb2b929f59ef (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
{
  lib,
  stdenv,
  fetchFromGitHub,
  cmake,
  pkg-config,
  wayland-scanner,
  mpv-unwrapped,
  openssl,
  curl,
  libxkbcommon,
  dbus,
  libffi,
  wayland,
  egl-wayland,
  xorg,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "wiliwili";
  version = "1.4.1";

  src = fetchFromGitHub {
    owner = "xfangfang";
    repo = "wiliwili";
    rev = "v${finalAttrs.version}";
    fetchSubmodules = true;
    hash = "sha256-Fl8YV7yBW9dmcpcHCDVvkAzICTopNb4zKziDkR6NEwU=";
  };

  nativeBuildInputs = [
    cmake
    pkg-config
  ] ++ lib.optionals stdenv.isLinux [
    wayland-scanner
  ];

  buildInputs = [
    mpv-unwrapped
    openssl
    curl
    libxkbcommon
    dbus
  ] ++ lib.optionals stdenv.isLinux [
    libffi # needed for wayland
    wayland
    egl-wayland
    xorg.libX11
    xorg.libXrandr
    xorg.libXinerama
    xorg.libXcursor
    xorg.libXi
  ];

  cmakeFlags = [
    (lib.cmakeBool "PLATFORM_DESKTOP" true)
    (lib.cmakeBool "INSTALL" true)
    (lib.cmakeBool "GLFW_BUILD_WAYLAND" stdenv.isLinux)
    (lib.cmakeBool "GLFW_BUILD_X11" stdenv.isLinux)
    # Otherwise cpr cmake will try to download zlib
    (lib.cmakeBool "CPR_FORCE_USE_SYSTEM_CURL" true)
  ];

  meta = {
    description = "Third-party Bilibili client with a switch-like UI";
    homepage = "https://xfangfang.github.io/wiliwili";
    # https://github.com/xfangfang/wiliwili/discussions/355
    license = lib.licenses.gpl3Only;
    mainProgram = "wiliwili";
    maintainers = with lib.maintainers; [ aleksana ];
    platforms = with lib.platforms; unix ++ windows;
    # Testing on darwin was blocked due to broken swift
    # buildInputs should still need some tweaking, but can't be sure
    badPlatforms = lib.platforms.darwin;
  };
})