Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 56 additions & 8 deletions pkgs/by-name/fl/flare-signal/package.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchFromGitLab,
runCommand,
cargo,
meson,
ninja,
Expand All @@ -14,31 +16,60 @@
gtksourceview5,
rustPlatform,
rustc,
appstream-glib,
yq,
appstream,
blueprint-compiler,
desktop-file-utils,
wrapGAppsHook4,
}:

let
presage = fetchFromGitHub {
owner = "whisperfish";
repo = "presage";
# match with commit from Cargo.toml
rev = "123c1f926e359c21b34d099279ee8a92462ce96d";
Comment thread
MarcelCoding marked this conversation as resolved.
Outdated
hash = "sha256-qKpPbK5ToFnWucujDlV8qxeT+XrRGYYnm7jp8UOXgZ0=";
};
in

stdenv.mkDerivation (finalAttrs: {
pname = "flare";
version = "0.16.3";
# NOTE: also update presage commit
version = "0.17.0";

src = fetchFromGitLab {
domain = "gitlab.com";
owner = "schmiddi-on-mobile";
repo = "flare";
tag = finalAttrs.version;
hash = "sha256-uUEeARhKhI6SvzZHLAvDgBjOxw82Yp88c6U0cHeRKoc=";
hash = "sha256-Zdzs9ZLvrI5rGhC1K0SLPsv/xMtJEu5vFRnH3+z/keA=";
};

cargoDeps = rustPlatform.fetchCargoVendor {
inherit (finalAttrs) pname version src;
hash = "sha256-bQiQrl+yqKDGFXN7VfS7VEWKAcT1LtoRZjWq/BwHgKw=";
};
cargoDeps =
let
cargoDeps = rustPlatform.fetchCargoVendor {
inherit (finalAttrs) pname version src;
hash = "sha256-XBUpFQy68qwrKgsKi5TeoakalNLTqolv6z5YfyiaEZI=";
};
in
# Replace with simpler solution:
# https://github.com/NixOS/nixpkgs/pull/432651#discussion_r2312796706
# depending on sqlx release and update in flare-signal
runCommand "${finalAttrs.pname}-${finalAttrs.version}-vendor-patched" { inherit cargoDeps; }
# https://github.com/flathub/de.schmidhuberj.Flare/commit/b1352087beaf299569c798bc69e31660712853db
# bash
''
mkdir $out
find $cargoDeps -maxdepth 1 -exec sh -c "ln -s {} $out/\$(basename {})" \;
rm $out/presage-store-sqlite-*
cp -r $cargoDeps/presage-store-sqlite-* $out
chmod +w $out/presage-store-sqlite-*
ln -s ${presage}/.sqlx $out/presage-store-sqlite-*
Comment thread
MarcelCoding marked this conversation as resolved.
Outdated
'';

nativeBuildInputs = [
appstream-glib # for appstream-util
appstream # for appstream-util
blueprint-compiler
desktop-file-utils # for update-desktop-database
meson
Expand All @@ -48,8 +79,25 @@ stdenv.mkDerivation (finalAttrs: {
rustPlatform.cargoSetupHook
cargo
rustc
# yq contains tomlq
yq
];

postPatch = ''
cargoPresageRev="$(tomlq -r '.dependencies.presage.rev' Cargo.toml)"
actualPresageRev="${presage.rev}"
if [ "$cargoPresageRev" != "$actualPresageRev" ]; then
echo ""
echo "fetchFromGitHub presage revision does not match revision specified in Cargo.toml"
echo "consider replacing fetchFromGitHub's revision with revision specified in Cargo.toml"
echo ""
echo " fetchFromGitHub = ''${actualPresageRev}"
echo " Cargo.toml = ''${cargoPresageRev}"
echo ""
exit 1
fi
'';

buildInputs = [
gtksourceview5
libadwaita
Expand Down
Loading