From 208737d4bca3b86bfd0f2a4a5bac77aab58a8c1f Mon Sep 17 00:00:00 2001 From: mivorasu Date: Thu, 24 Jul 2025 22:33:47 +0800 Subject: [PATCH] venera: 1.4.5 -> 1.4.6 --- pkgs/by-name/ve/venera/gitHashes.json | 18 ++++++++ pkgs/by-name/ve/venera/package.nix | 33 ++++---------- pkgs/by-name/ve/venera/pubspec.lock.json | 12 ++++- pkgs/by-name/ve/venera/update-gitHashes.py | 51 ++++++++++++++++++++++ 4 files changed, 88 insertions(+), 26 deletions(-) create mode 100644 pkgs/by-name/ve/venera/gitHashes.json create mode 100755 pkgs/by-name/ve/venera/update-gitHashes.py diff --git a/pkgs/by-name/ve/venera/gitHashes.json b/pkgs/by-name/ve/venera/gitHashes.json new file mode 100644 index 000000000000..9123f1968eb0 --- /dev/null +++ b/pkgs/by-name/ve/venera/gitHashes.json @@ -0,0 +1,18 @@ +{ + "desktop_webview_window": "sha256-c2f1CjfZJ8M9SJz65WQVG+0uuKaFMjQFFAGSNH9osjg=", + "flutter_7zip": "sha256-KHDq4XG3l+dq1NPW84wOK5kKbXJ8qCK8voGeTnX/Krw=", + "flutter_inappwebview": "sha256-9ocNFgXXqP28VmuJVXc81MUSPjIkzngOyEInMSxgwCU=", + "flutter_inappwebview_android": "sha256-9ocNFgXXqP28VmuJVXc81MUSPjIkzngOyEInMSxgwCU=", + "flutter_inappwebview_ios": "sha256-9ocNFgXXqP28VmuJVXc81MUSPjIkzngOyEInMSxgwCU=", + "flutter_inappwebview_macos": "sha256-9ocNFgXXqP28VmuJVXc81MUSPjIkzngOyEInMSxgwCU=", + "flutter_inappwebview_platform_interface": "sha256-9ocNFgXXqP28VmuJVXc81MUSPjIkzngOyEInMSxgwCU=", + "flutter_inappwebview_web": "sha256-9ocNFgXXqP28VmuJVXc81MUSPjIkzngOyEInMSxgwCU=", + "flutter_inappwebview_windows": "sha256-9ocNFgXXqP28VmuJVXc81MUSPjIkzngOyEInMSxgwCU=", + "flutter_qjs": "sha256-Mp9swQ4JEIyIEBQGlR7i+37Jp2sFGwL0uGrSTwE/n88=", + "flutter_saf": "sha256-zmRZ82aJPYX/N/lOUcOoT8UAHEDoUk0FTFSqB4gKR+U=", + "lodepng_flutter": "sha256-fOOhjoo3dzNNZI04Ie7GHLTfVlD5X+5IONpg8+RlmsE=", + "photo_view": "sha256-zRc/WCbVybWkF52KDZZXgvKA8bbXASI7Yj2RFzLhXUk=", + "rhttp": "sha256-6AH7A+CJg60Vk0ph3cJwj29GkmJEezI/VuZvRqqmOYs=", + "scrollable_positioned_list": "sha256-6XmBlNxE7DEqY2LsEFtVrshn2Xt55XnmaiTq+tiPInA=", + "webdav_client": "sha256-euNF7HdDtZ68BqSEq9BvO10BK09MxX2wWGoElFS0yeE=" +} diff --git a/pkgs/by-name/ve/venera/package.nix b/pkgs/by-name/ve/venera/package.nix index c8039c03522e..bfa13a7b6436 100644 --- a/pkgs/by-name/ve/venera/package.nix +++ b/pkgs/by-name/ve/venera/package.nix @@ -14,39 +14,18 @@ flutter332.buildFlutterApplication rec { pname = "venera"; - version = "1.4.5"; + version = "1.4.6"; src = fetchFromGitHub { owner = "venera-app"; repo = "venera"; tag = "v${version}"; - hash = "sha256-yg7VwR1IGswyqkyuvTZnVVLI4YKnfcea+VemWLOUXto="; + hash = "sha256-WGzgx+QbAurv9yOJjO40R8t4WtSt/iIkkBuBizT94lQ="; }; pubspecLock = lib.importJSON ./pubspec.lock.json; - gitHashes = - let - flutter_inappwebview-hash = "sha256-Vh5bZP/tkSAlstbT3souy/iLmpw3CENrA/rCUOcJb2o="; - in - { - desktop_webview_window = "sha256-c2f1CjfZJ8M9SJz65WQVG+0uuKaFMjQFFAGSNH9osjg="; - flutter_qjs = "sha256-Mp9swQ4JEIyIEBQGlR7i+37Jp2sFGwL0uGrSTwE/n88="; - flutter_7zip = "sha256-KHDq4XG3l+dq1NPW84wOK5kKbXJ8qCK8voGeTnX/Krw="; - lodepng_flutter = "sha256-fOOhjoo3dzNNZI04Ie7GHLTfVlD5X+5IONpg8+RlmsE="; - photo_view = "sha256-zRc/WCbVybWkF52KDZZXgvKA8bbXASI7Yj2RFzLhXUk="; - scrollable_positioned_list = "sha256-6XmBlNxE7DEqY2LsEFtVrshn2Xt55XnmaiTq+tiPInA="; - webdav_client = "sha256-euNF7HdDtZ68BqSEq9BvO10BK09MxX2wWGoElFS0yeE="; - flutter_saf = "sha256-zmRZ82aJPYX/N/lOUcOoT8UAHEDoUk0FTFSqB4gKR+U="; - rhttp = "sha256-6AH7A+CJg60Vk0ph3cJwj29GkmJEezI/VuZvRqqmOYs="; - flutter_inappwebview = flutter_inappwebview-hash; - flutter_inappwebview_android = flutter_inappwebview-hash; - flutter_inappwebview_ios = flutter_inappwebview-hash; - flutter_inappwebview_macos = flutter_inappwebview-hash; - flutter_inappwebview_web = flutter_inappwebview-hash; - flutter_inappwebview_windows = flutter_inappwebview-hash; - flutter_inappwebview_platform_interface = flutter_inappwebview-hash; - }; + gitHashes = lib.importJSON ./gitHashes.json; nativeBuildInputs = [ copyDesktopItems ]; @@ -71,7 +50,7 @@ flutter332.buildFlutterApplication rec { ]; postInstall = '' - install -Dm0644 ./debian/gui/venera.png $out/share/pixmaps/venera.png + install -Dm0644 debian/gui/venera.png $out/share/pixmaps/venera.png ''; extraWrapProgramArgs = '' @@ -91,6 +70,10 @@ flutter332.buildFlutterApplication rec { updateScript = _experimental-update-script-combinators.sequence [ (gitUpdater { rev-prefix = "v"; }) (_experimental-update-script-combinators.copyAttrOutputToFile "venera.pubspecSource" ./pubspec.lock.json) + { + command = [ ./update-gitHashes.py ]; + supportedFeatures = [ "silent" ]; + } ]; }; diff --git a/pkgs/by-name/ve/venera/pubspec.lock.json b/pkgs/by-name/ve/venera/pubspec.lock.json index 5e2fe10d13da..b74a0f19e56c 100644 --- a/pkgs/by-name/ve/venera/pubspec.lock.json +++ b/pkgs/by-name/ve/venera/pubspec.lock.json @@ -211,6 +211,16 @@ "source": "hosted", "version": "2.1.0" }, + "display_mode": { + "dependency": "direct main", + "description": { + "name": "display_mode", + "sha256": "8a381f3602a09dc4e96140a0df30808631468d6d0dfff7722f67b1f83757a7cc", + "url": "https://pub.dev" + }, + "source": "hosted", + "version": "0.0.2" + }, "dynamic_color": { "dependency": "direct main", "description": { @@ -1379,6 +1389,6 @@ }, "sdks": { "dart": ">=3.8.0 <4.0.0", - "flutter": ">=3.32.4" + "flutter": ">=3.32.6" } } diff --git a/pkgs/by-name/ve/venera/update-gitHashes.py b/pkgs/by-name/ve/venera/update-gitHashes.py new file mode 100755 index 000000000000..ffa6feb66653 --- /dev/null +++ b/pkgs/by-name/ve/venera/update-gitHashes.py @@ -0,0 +1,51 @@ +#! /usr/bin/env nix-shell +#! nix-shell -i python3 -p python3 nix-prefetch-git + +import json +import subprocess +import sys +from pathlib import Path + +THIS_FOLDER = Path(__file__).parent.resolve() +PUBSPEC_LOCK = THIS_FOLDER / "pubspec.lock.json" +GIT_HASHES = THIS_FOLDER / "gitHashes.json" + + +def fetch_git_hash(url: str, rev: str) -> str: + result = subprocess.run( + ["nix-prefetch-git", "--url", url, "--rev", rev], + capture_output=True, + text=True, + check=True, + ) + return json.loads(result.stdout)["hash"] + + +def main() -> None: + if not PUBSPEC_LOCK.exists(): + sys.exit(1) + try: + data = json.loads(PUBSPEC_LOCK.read_text()) + except json.JSONDecodeError: + sys.exit(1) + output: dict[str, str] = {} + for name, info in data.get("packages", {}).items(): + if info.get("source") != "git": + continue + desc = info.get("description") + if not isinstance(desc, dict): + continue + url = desc.get("url") + rev = desc.get("resolved-ref") + if not (isinstance(url, str) and isinstance(rev, str)): + continue + try: + package_hash = fetch_git_hash(url, rev) + except subprocess.CalledProcessError: + continue + output[name] = package_hash + GIT_HASHES.write_text(json.dumps(output, indent=2) + "\n") + + +if __name__ == "__main__": + main()