about summary refs log tree commit diff
path: root/pkgs/by-name/br/brickstore/package.nix
blob: 03d3dd06c6c541dc88348d49e6c0f98063b35e9d (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
{
  lib,
  stdenv,
  qt6,
  libsForQt5,
  fetchFromGitHub,
  gst_all_1,
  cmake,
  libglvnd,
  tbb,
  ninja,
  pkg-config,
}:
let
  inherit (libsForQt5) qcoro;
in
stdenv.mkDerivation (finalAttrs: {
  pname = "brickstore";
  version = "0-unstable-2024-05-02";

  src = fetchFromGitHub {
    owner = "rgriebl";
    repo = "brickstore";
    rev = "v2024.5.2";
    hash = "sha256-Bu9oNbZm3lx/CfYAReHyWe/kW+kaefDWeBtWLHOCORU=";
    fetchSubmodules = true;
  };

  nativeBuildInputs = [
    cmake
    libglvnd
    ninja
    pkg-config
    qcoro
    qt6.qtdoc
    qt6.qtdeclarative
    qt6.qtimageformats
    qt6.qtmultimedia
    qt6.qtquick3d
    qt6.qtquicktimeline
    qt6.qtshadertools
    qt6.qttools
    qt6.qtwayland
    qt6.wrapQtAppsHook
    tbb
  ];

  preConfigure = ''
    sed -i '/^)$/d' cmake/BuildQCoro.cmake

    substituteInPlace cmake/BuildQCoro.cmake \
      --replace-fail 'FetchContent_Declare(' ' ' \
      --replace-fail '    qcoro' ' ' \
      --replace-fail '    GIT_REPOSITORY https://github.com/danvratil/qcoro.git' ' ' \
      --replace-fail '    GIT_TAG        v''${QCORO_VERSION}' ' ' \
      --replace-fail 'FetchContent_GetProperties(qcoro)' ' ' \
      --replace-fail 'FetchContent_Populate(qcoro)' ' ' \
      --replace-fail \
        'add_subdirectory(''${qcoro_SOURCE_DIR} ''${qcoro_BINARY_DIR} EXCLUDE_FROM_ALL)' \
        'add_subdirectory(${qcoro.src} ${qcoro}bin/qcoro)'
  '';

  qtWrapperArgs = [
    ''
      --prefix GST_PLUGIN_SYSTEM_PATH_1_0 : ${
        lib.makeLibraryPath [
          gst_all_1.gstreamer
          gst_all_1.gst-plugins-base
          gst_all_1.gst-plugins-good
          gst_all_1.gst-plugins-bad
          gst_all_1.gst-plugins-ugly
          gst_all_1.gst-libav
        ]
      }
    ''
  ];

  meta = {
    changelog = "https://github.com/rgriebl/brickstore/blob/main/CHANGELOG.md";
    description = "BrickLink offline management tool";
    homepage = "https://www.brickstore.dev/";
    license = lib.licenses.gpl3Plus;
    longDescription = ''
      BrickStore is a BrickLink offline management tool.
      It is multi-platform (Windows, macOS and Linux as well as iOS and Android),
      multilingual (currently English, German, Spanish, Swedish and French), fast and stable.
    '';
    maintainers = with lib.maintainers; [ legojames ];
    mainProgram = "brickstore";
    platforms = lib.platforms.linux;
  };
})