rgriebl / brickstore

An offline BrickLink inventory management tool.
https://www.brickstore.dev/
GNU General Public License v3.0
121 stars 26 forks source link

Help debugging Nixos package #874

Closed jrobinson-uk closed 7 months ago

jrobinson-uk commented 7 months ago

@rgriebl @joalcava I decided to make a fresh "issue", to address some minor build issues on Nixos. This does things differently to other distros such as ubuntu. I'm not looking for a solution directly but nudges or insight that help me indentify and fix issues myself.

My aim is to build and share a robust Nixos package (derivation) with the community.

I now have Brickstore installed and seemingly working for the most part but have a couple of issues to resolve:

  1. I can't use the camera features to search for parts etc, this works under the appImage but no camera is detected under the installed version. The follow console measages are also logged:

Screenshot from 2024-04-23 10-46-09

Failed to initialize QImageCapture "Could not find the videoconvert GStreamer element" (at unknown, 0)

Looks like something is missing but I can't tell whether it's a build issue or an environment issue

  1. The following message is repeatedly output whilst BS is running, but with no discernable issue whilst running:

    This plugin does not support setting window opacity (at unknown, 0)

Any help would be really appreciated

jrobinson-uk commented 7 months ago

I've managed to address both issues and planning to submit a package to the nixos repository. Until then I'll share this for any other nixos users

{ lib
, stdenv
, fetchurl
, qt6
, fetchFromGitHub
, gst_all_1
, wrapQtAppsHook
, cmake
, libglvnd
, tbb
, ninja
, git
, pkg-config
}:

stdenv.mkDerivation rec {
  pname = "brickstore";
  version = "2024.5.1";

  buildInputs = [ git pkg-config qt6.qttools cmake libglvnd tbb ninja stdenv];
  nativeBuildInputs = [ git pkg-config qt6.qtimageformats wrapQtAppsHook qt6.qtdoc qt6.qtdeclarative qt6.qtmultimedia qt6.qtquick3d qt6.qtshadertools qt6.qtwayland stdenv qt6.qtbase qt6.qttools cmake libglvnd tbb ninja];
#  dontWrapQtApps = true;
  enableParallelBuilding = true;
  patches = [ ./no-download.patch ];

  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 ]}'' ];

  qcoro = fetchFromGitHub {
    owner  = "danvratil";
    repo   = "qcoro";
    rev    = "v0.10.0";
    sha256 = "sha256-C4k5ClsMwzxURAQBGV5WBwlRr5N0SvUMJobZ+ROT0EY=";
    fetchSubmodules = true;
  };

  src = fetchFromGitHub {
    owner = "rgriebl";
    repo = "brickstore";
    rev = "v${version}";
    hash = "sha256-czcY30u62K3lpzsM/8A8uoIIFdkl0+876/MtjvOHJ+I=";

    fetchSubmodules = true;
  };

 preConfigure = ''
    mkdir -p /build/source/build/_deps/qcoro-src

    cp -r ${qcoro}/* build/_deps/qcoro-src/
    chmod -R +w build/_deps/qcoro-src
  '';

  meta = with lib; {
    description = "BrickLink offline management tool";
    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.
    '';
    homepage = "https://www.brickstore.dev/";
    changelog = "https://github.com/rgriebl/brickstore/blob/main/CHANGELOG.md";
    license = licenses.gpl3Plus;
};
}
rgriebl commented 6 months ago

Thanks for having a go at this!

Please let me know if and when you get this upstream, so I can add it to the installation instructions. For now, I'm going to link to this page.

jrobinson-uk commented 5 months ago

@rgriebl brickstore is now packaged for nixos

https://search.nixos.org/packages?channel=24.05&from=0&size=50&sort=relevance&type=packages&query=brickstore