{ lib, flutter332, fetchFromGitHub, gst_all_1, libunwind, orc, webkitgtk_4_1, autoPatchelfHook, xorg, runCommand, yq, saber, _experimental-update-script-combinators, gitUpdater, }: flutter332.buildFlutterApplication rec { pname = "saber"; version = "0.26.0"; src = fetchFromGitHub { owner = "saber-notes"; repo = "saber"; tag = "v${version}"; hash = "sha256-5N4HojdDysLgCPq614ZzJXx/dx3s4F++W35fjYdevRk="; }; gitHashes = lib.importJSON ./gitHashes.json; pubspecLock = lib.importJSON ./pubspec.lock.json; nativeBuildInputs = [ autoPatchelfHook ]; buildInputs = [ gst_all_1.gstreamer gst_all_1.gst-plugins-base libunwind orc webkitgtk_4_1 xorg.libXmu ]; postPatch = '' patchShebangs patches/remove_proprietary_dependencies.sh patches/remove_proprietary_dependencies.sh ''; flutterBuildFlags = [ "--dart-define=DIRTY=false" ]; postInstall = '' install -Dm0644 flatpak/com.adilhanney.saber.desktop $out/share/applications/saber.desktop install -Dm0644 assets/icon/icon.svg $out/share/icons/hicolor/scalable/apps/com.adilhanney.saber.svg install -Dm0644 flatpak/com.adilhanney.saber.metainfo.xml -t $out/share/metainfo ''; # Remove libpdfrx.so's reference to the /build/ directory preFixup = '' patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" $out/app/saber/lib/lib*.so ''; passthru = { pubspecSource = runCommand "pubspec.lock.json" { nativeBuildInputs = [ yq ]; inherit (saber) src; } '' cat $src/pubspec.lock | yq > $out ''; updateScript = _experimental-update-script-combinators.sequence [ (gitUpdater { rev-prefix = "v"; }) (_experimental-update-script-combinators.copyAttrOutputToFile "saber.pubspecSource" ./pubspec.lock.json) { command = [ ./update-gitHashes.py ]; supportedFeatures = [ "silent" ]; } ]; }; meta = { description = "Cross-platform open-source app built for handwriting"; homepage = "https://github.com/saber-notes/saber"; mainProgram = "saber"; license = with lib.licenses; [ gpl3Plus ]; maintainers = with lib.maintainers; [ ]; platforms = [ "aarch64-linux" "x86_64-linux" ]; }; }