mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-19 20:23:02 +00:00
Merge pull request #223117 from gilice/fluffychat-updates
This commit is contained in:
commit
02e464590e
@ -1,22 +1,31 @@
|
|||||||
{ lib
|
{ lib
|
||||||
, fetchFromGitLab
|
, stdenv
|
||||||
, flutter2
|
, fetchzip
|
||||||
, olm
|
|
||||||
, imagemagick
|
, imagemagick
|
||||||
|
, autoPatchelfHook
|
||||||
|
, gtk3
|
||||||
|
, libsecret
|
||||||
|
, jsoncpp
|
||||||
|
, wrapGAppsHook
|
||||||
, makeDesktopItem
|
, makeDesktopItem
|
||||||
}:
|
}:
|
||||||
|
|
||||||
flutter2.mkFlutterApp rec {
|
let
|
||||||
pname = "fluffychat";
|
version = "1.10.0";
|
||||||
version = "1.2.0";
|
# map of nix platform -> expected url platform
|
||||||
|
platformMap = {
|
||||||
|
x86_64-linux = "linux-x86";
|
||||||
|
aarch64-linux = "linux-arm64";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
inherit version;
|
||||||
|
name = "fluffychat";
|
||||||
|
|
||||||
vendorHash = "sha256-1PDX023WXRmRe/b1L+6Du91BvGwYNp3YATqYSQdPrRY=";
|
src = fetchzip {
|
||||||
|
url = "https://gitlab.com/api/v4/projects/16112282/packages/generic/fluffychat/${version}/fluffychat-${platformMap.${stdenv.hostPlatform.system}}.tar.gz";
|
||||||
src = fetchFromGitLab {
|
stripRoot = false;
|
||||||
owner = "famedly";
|
sha256 = "sha256-SbzTEMeJRFEUN0nZF9hL0UEzTWl1VtHVPIx/AGgQvM8=";
|
||||||
repo = "fluffychat";
|
|
||||||
rev = "v${version}";
|
|
||||||
hash = "sha256-PJH3jMQc6u9R6Snn+9rNN8t+8kt6l3Xt7zKPbpqj13E=";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
desktopItem = makeDesktopItem {
|
desktopItem = makeDesktopItem {
|
||||||
@ -28,45 +37,27 @@ flutter2.mkFlutterApp rec {
|
|||||||
categories = [ "Chat" "Network" "InstantMessaging" ];
|
categories = [ "Chat" "Network" "InstantMessaging" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [ gtk3 libsecret jsoncpp ];
|
||||||
olm
|
nativeBuildInputs = [ autoPatchelfHook wrapGAppsHook imagemagick ];
|
||||||
];
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
installPhase = ''
|
||||||
imagemagick
|
mkdir -p $out/bin
|
||||||
];
|
mkdir -p $out/share
|
||||||
|
mv * $out/share
|
||||||
|
|
||||||
flutterExtraFetchCommands = ''
|
ln -s $out/share/fluffychat $out/bin/fluffychat
|
||||||
M=$(echo $TMP/.pub-cache/hosted/pub.dartlang.org/matrix-*)
|
|
||||||
sed -i $M/scripts/prepare.sh \
|
|
||||||
-e "s|/usr/lib/x86_64-linux-gnu/libolm.so.3|/bin/sh|g" \
|
|
||||||
-e "s|if which flutter >/dev/null; then|exit; if which flutter >/dev/null; then|g"
|
|
||||||
|
|
||||||
pushd $M
|
FAV=$out/share/data/flutter_assets/assets/favicon.png
|
||||||
bash scripts/prepare.sh
|
|
||||||
popd
|
|
||||||
'';
|
|
||||||
|
|
||||||
# replace olm dummy path
|
|
||||||
postConfigure = ''
|
|
||||||
M=$(echo $depsFolder/.pub-cache/hosted/pub.dartlang.org/matrix-*)
|
|
||||||
ln -sf ${olm}/lib/libolm.so.3 $M/ffi/olm/libolm.so
|
|
||||||
'';
|
|
||||||
|
|
||||||
postInstall = ''
|
|
||||||
FAV=$out/app/data/flutter_assets/assets/favicon.png
|
|
||||||
ICO=$out/share/icons
|
ICO=$out/share/icons
|
||||||
|
|
||||||
install -D $FAV $ICO/fluffychat.png
|
install -D $FAV $ICO/fluffychat.png
|
||||||
mkdir $out/share/applications
|
mkdir $out/share/applications
|
||||||
cp $desktopItem/share/applications/*.desktop $out/share/applications
|
cp $desktopItem/share/applications/*.desktop $out/share/applications
|
||||||
|
for size in 24 32 42 64 128 256 512; do
|
||||||
for s in 24 32 42 64 128 256 512; do
|
|
||||||
D=$ICO/hicolor/''${s}x''${s}/apps
|
D=$ICO/hicolor/''${s}x''${s}/apps
|
||||||
mkdir -p $D
|
mkdir -p $D
|
||||||
convert $FAV -resize ''${s}x''${s} $D/fluffychat.png
|
convert $FAV -resize ''${size}x''${size} $D/fluffychat.png
|
||||||
done
|
done
|
||||||
|
|
||||||
substituteInPlace $out/share/applications/*.desktop \
|
substituteInPlace $out/share/applications/*.desktop \
|
||||||
--subst-var out
|
--subst-var out
|
||||||
'';
|
'';
|
||||||
@ -75,7 +66,8 @@ flutter2.mkFlutterApp rec {
|
|||||||
description = "Chat with your friends (matrix client)";
|
description = "Chat with your friends (matrix client)";
|
||||||
homepage = "https://fluffychat.im/";
|
homepage = "https://fluffychat.im/";
|
||||||
license = licenses.agpl3Plus;
|
license = licenses.agpl3Plus;
|
||||||
maintainers = with maintainers; [ mkg20001 ];
|
maintainers = with maintainers; [ mkg20001 gilice ];
|
||||||
platforms = platforms.linux;
|
platforms = [ "x86_64-linux" "aarch64-linux" ];
|
||||||
|
sourceProvenance = [ sourceTypes.binaryNativeCode ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -4,14 +4,13 @@
|
|||||||
, cmake
|
, cmake
|
||||||
, python3
|
, python3
|
||||||
, validatePkgConfig
|
, validatePkgConfig
|
||||||
, fetchpatch
|
|
||||||
, secureMemory ? false
|
, secureMemory ? false
|
||||||
, enableStatic ? stdenv.hostPlatform.isStatic
|
, enableStatic ? stdenv.hostPlatform.isStatic
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "jsoncpp";
|
pname = "jsoncpp";
|
||||||
version = "1.9.4";
|
version = "1.9.5";
|
||||||
|
|
||||||
outputs = ["out" "dev"];
|
outputs = ["out" "dev"];
|
||||||
|
|
||||||
@ -19,17 +18,9 @@ stdenv.mkDerivation rec {
|
|||||||
owner = "open-source-parsers";
|
owner = "open-source-parsers";
|
||||||
repo = "jsoncpp";
|
repo = "jsoncpp";
|
||||||
rev = version;
|
rev = version;
|
||||||
sha256 = "0qnx5y6c90fphl9mj9d20j2dfgy6s5yr5l0xnzid0vh71zrp6jwv";
|
sha256 = "sha256-OyfJD19g8cT9wOD0hyJyEw4TbaxZ9eY04396U/7R+hs=";
|
||||||
};
|
};
|
||||||
|
|
||||||
patches = [
|
|
||||||
# Fix for https://github.com/open-source-parsers/jsoncpp/issues/1235.
|
|
||||||
(fetchpatch {
|
|
||||||
url = "https://github.com/open-source-parsers/jsoncpp/commit/ac2870298ed5b5a96a688d9df07461b31f83e906.patch";
|
|
||||||
sha256 = "02wswhiwypmf1jn3rj9q1fw164kljiv4l8h0q6wyijzr77hq4wsg";
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
/* During darwin bootstrap, we have a cp that doesn't understand the
|
/* During darwin bootstrap, we have a cp that doesn't understand the
|
||||||
* --reflink=auto flag, which is used in the default unpackPhase for dirs
|
* --reflink=auto flag, which is used in the default unpackPhase for dirs
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user