Unverified Commit 79959976 authored by Maciej Krüger's avatar Maciej Krüger Committed by GitHub
Browse files

Merge pull request #228282 from hacker1024/patch-3

fluffychat: 1.10.0 -> 1.11.0, build from source
parents 038e126f 0437c92f
Loading
Loading
Loading
Loading
+17 −36
Original line number Diff line number Diff line
{ lib
, stdenv
, fetchzip
, fetchFromGitLab
, imagemagick
, autoPatchelfHook
, gtk3
, libsecret
, jsoncpp
, wrapGAppsHook
, flutter
, makeDesktopItem
, openssl
, olm
}:

let
  version = "1.10.0";
  # map of nix platform -> expected url platform
  platformMap = {
    x86_64-linux = "linux-x86";
    aarch64-linux = "linux-arm64";
  };
in
stdenv.mkDerivation {
  inherit version;
  pname = "fluffychat";
flutter.buildFlutterApplication rec {
  version = "1.11.0";
  name = "fluffychat";

  src = fetchzip {
    url = "https://gitlab.com/api/v4/projects/16112282/packages/generic/fluffychat/${version}/fluffychat-${platformMap.${stdenv.hostPlatform.system}}.tar.gz";
    stripRoot = false;
    sha256 = "sha256-SbzTEMeJRFEUN0nZF9hL0UEzTWl1VtHVPIx/AGgQvM8=";
  src = fetchFromGitLab {
    owner = "famedly";
    repo = "fluffychat";
    rev = "v${version}";
    hash = "sha256-Z7BOGsirBVQxRJY4kmskCmPeZloc41/bf4/ExoO8VBk=";
  };

  depsListFile = ./deps.json;
  vendorHash = "sha256-axByNptbzGR7GQT4Gs2yaEyUCkCbI9RQNNOHN7CYd9A=";

  desktopItem = makeDesktopItem {
    name = "Fluffychat";
    exec = "@out@/bin/fluffychat";
@@ -38,18 +27,10 @@ stdenv.mkDerivation {
    genericName = "Chat with your friends (matrix client)";
    categories = [ "Chat" "Network" "InstantMessaging" ];
  };
  buildInputs = [ gtk3 libsecret jsoncpp ];
  nativeBuildInputs = [ autoPatchelfHook wrapGAppsHook imagemagick ];

  installPhase = ''
    mkdir -p $out/bin
    mkdir -p $out/share
    mv * $out/share

    makeWrapper "$out/share/fluffychat" "$out/bin/fluffychat" \
      --prefix "LD_LIBRARY_PATH" ":" "${lib.makeLibraryPath [ openssl olm ]}"
  nativeBuildInputs = [ imagemagick ];

    FAV=$out/share/data/flutter_assets/assets/favicon.png
  postInstall = ''
    FAV=$out/app/data/flutter_assets/assets/favicon.png
    ICO=$out/share/icons

    install -D $FAV $ICO/fluffychat.png
@@ -70,6 +51,6 @@ stdenv.mkDerivation {
    license = licenses.agpl3Plus;
    maintainers = with maintainers; [ mkg20001 gilice ];
    platforms = [ "x86_64-linux" "aarch64-linux" ];
    sourceProvenance = [ sourceTypes.binaryNativeCode ];
    sourceProvenance = [ sourceTypes.fromSource ];
  };
}
+3095 −0

File added.

Preview size limit exceeded, changes collapsed.

+4 −0
Original line number Diff line number Diff line
{ callPackage }:

{
  flutter_secure_storage_linux = callPackage ./flutter-secure-storage-linux { };
  handy_window = callPackage ./handy-window { };
  matrix = callPackage ./matrix { };
  olm = callPackage ./olm { };
}
+17 −0
Original line number Diff line number Diff line
{ lib
, pkg-config
, libsecret
, jsoncpp
}:

{ ... }:

{ nativeBuildInputs ? [ ]
, buildInputs ? [ ]
, ...
}:

{
  nativeBuildInputs = [ pkg-config ] ++ nativeBuildInputs;
  buildInputs = [ libsecret jsoncpp ] ++ buildInputs;
}
+14 −0
Original line number Diff line number Diff line
{ lib
, cairo
, fribidi
}:

{ ... }:

{ CFLAGS ? ""
, ...
}:

{
  CFLAGS = "${CFLAGS} -isystem ${lib.getOutput "dev" fribidi}/include/fribidi -isystem ${lib.getOutput "dev" cairo}/include";
}
Loading