evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / in / intiface-central / package.nix
blobfad8b190b18620c9739f8a8fb48fb062436a627e
1 { lib
2 , fetchFromGitHub
3 , flutterPackages
4 , corrosion
5 , rustPlatform
6 , cargo
7 , rustc
8 , udev
9 , copyDesktopItems
10 , makeDesktopItem
12 flutterPackages.stable.buildFlutterApplication rec {
13   pname = "intiface-central";
14   version = "2.6.4";
15   src = fetchFromGitHub {
16     owner = "intiface";
17     repo = "intiface-central";
18     rev = "v${version}";
19     hash = "sha256-QBNEKhjBfKxArBykUq/fE4lftCYzGdAaWYD1F7rar5Y=";
20   };
21   patches = [
22     ./corrosion.patch
23   ];
25   pubspecLock = lib.importJSON ./pubspec.lock.json;
27   cargoDeps = rustPlatform.fetchCargoTarball {
28     name = "${pname}-${version}-cargo-deps";
29     inherit src;
30     sourceRoot = "${src.name}/intiface-engine-flutter-bridge";
31     hash = "sha256-S3Yy0IIMiRUUpFNlLvS1PGwpvxePMB1sO5M6mpm1OgY=";
32   };
33   cargoRoot = "intiface-engine-flutter-bridge";
35   preConfigure = ''
36     export CMAKE_PREFIX_PATH="${corrosion}:$CMAKE_PREFIX_PATH"
37   '';
39   nativeBuildInputs = [
40     corrosion
41     rustPlatform.cargoSetupHook
42     cargo
43     rustc
44     copyDesktopItems
45   ];
47   buildInputs = [
48     udev
49   ];
51   # without this, only the splash screen will be shown and the logs will contain the
52   # line `Failed to load dynamic library 'lib/libintiface_engine_flutter_bridge.so'`
53   # Environmental variables don't quite eval outside of hooks so use pname and
54   # version directly.
55   extraWrapProgramArgs = "--chdir $out/app/${pname}";
57   postInstall = ''
58     mkdir -p $out/share/pixmaps
59     cp $out/app/$pname/data/flutter_assets/assets/icons/intiface_central_icon.png $out/share/pixmaps/intiface-central.png
60   '';
62   desktopItems = [
63     (makeDesktopItem {
64       name = "intiface-central";
65       exec = "intiface_central";
66       icon = "intiface-central";
67       comment = "Intiface Central (Buttplug Frontend) Application for Desktop";
68       desktopName = "Intiface Central";
69     })
70   ];
72   meta = with lib; {
73     mainProgram = "intiface_central";
74     description = "Intiface Central (Buttplug Frontend) Application for Desktop";
75     homepage = "https://intiface.com/";
76     license = licenses.gpl3Only;
77     maintainers = with maintainers; [ _999eagle ];
78     platforms = platforms.linux;
79   };