oneanime: 1.4.1 -> 1.4.3 (#450646)

This commit is contained in:
Aleksana
2025-11-14 02:41:10 +00:00
committed by GitHub
4 changed files with 173 additions and 139 deletions
+10
View File
@@ -0,0 +1,10 @@
{
"media_kit": "sha256-nzbpzzc/39qvnjkX5d3tfOE/dG0C7Wgr93Ru3cA2CmY=",
"media_kit_libs_android_video": "sha256-nzbpzzc/39qvnjkX5d3tfOE/dG0C7Wgr93Ru3cA2CmY=",
"media_kit_libs_ios_video": "sha256-nzbpzzc/39qvnjkX5d3tfOE/dG0C7Wgr93Ru3cA2CmY=",
"media_kit_libs_linux": "sha256-nzbpzzc/39qvnjkX5d3tfOE/dG0C7Wgr93Ru3cA2CmY=",
"media_kit_libs_macos_video": "sha256-nzbpzzc/39qvnjkX5d3tfOE/dG0C7Wgr93Ru3cA2CmY=",
"media_kit_libs_video": "sha256-nzbpzzc/39qvnjkX5d3tfOE/dG0C7Wgr93Ru3cA2CmY=",
"media_kit_libs_windows_video": "sha256-nzbpzzc/39qvnjkX5d3tfOE/dG0C7Wgr93Ru3cA2CmY=",
"media_kit_video": "sha256-nzbpzzc/39qvnjkX5d3tfOE/dG0C7Wgr93Ru3cA2CmY="
}
+60 -71
View File
@@ -1,36 +1,33 @@
{
lib,
fetchFromGitHub,
flutter329,
autoPatchelfHook,
makeDesktopItem,
copyDesktopItems,
alsa-lib,
libepoxy,
libpulseaudio,
libdrm,
libgbm,
buildGoModule,
stdenv,
buildGoModule,
flutter335,
fetchFromGitHub,
autoPatchelfHook,
desktop-file-utils,
alsa-lib,
libdrm,
libepoxy,
libgbm,
libpulseaudio,
mpv-unwrapped,
mpv,
mimalloc,
runCommand,
yq,
oneanime,
yq-go,
_experimental-update-script-combinators,
gitUpdater,
nix-update-script,
}:
let
libopencc = buildGoModule rec {
libopencc = buildGoModule (finalAttrs: {
pname = "libopencc";
version = "1.0.0";
src = fetchFromGitHub {
owner = "Predidit";
repo = "open_chinese_convert_bridge";
tag = version;
tag = finalAttrs.version;
hash = "sha256-kC5+rIBOcwn9POvQlKEzuYKKcbhuqVs+pFd4JSFgINQ=";
};
@@ -39,7 +36,7 @@ let
buildPhase = ''
runHook preBuild
go build -buildmode=c-shared -o ./libopencc.so
go build -buildmode=c-shared -o libopencc.so
runHook postBuild
'';
@@ -47,45 +44,38 @@ let
installPhase = ''
runHook preInstall
install -Dm0755 ./libopencc.so $out/lib/libopencc.so
install -D --mode=0644 libopencc.so --target-directory $out/lib
runHook postInstall
'';
meta = {
homepage = "https://github.com/Predidit/open_chinese_convert_bridge";
license = with lib.licenses; [ gpl3Plus ];
license = lib.licenses.gpl3Plus;
};
};
in
flutter329.buildFlutterApplication rec {
pname = "oneanime";
version = "1.4.1";
});
version = "1.4.3";
src = fetchFromGitHub {
owner = "Predidit";
repo = "oneAnime";
tag = version;
hash = "sha256-VZdqbdKxzfGlS27WUSvSR2x7wU8uYMkWRU9QvxW22uQ=";
hash = "sha256-dDXDBem2G/CSGOiHTAtMZ9PrTj8b1zIiqabh/dNiSkQ=";
};
in
flutter335.buildFlutterApplication {
pname = "oneanime";
inherit version src;
postPatch = ''
substituteInPlace lib/pages/init_page.dart \
--replace-fail "lib/opencc.so" "${libopencc}/lib/libopencc.so"
'';
pubspecLock = lib.importJSON ./pubspec.lock.json;
gitHashes =
let
media_kit-hash = "sha256-NTnEmU873mzB9YuD6hhRXKfF1WWGPjqvmvAH5ULayxI=";
in
{
flutter_open_chinese_convert = "sha256-uRPBBB5RUd8fiFaM8dg9Th2tvQYwnbsQrsiDSPMm5kk=";
media_kit = media_kit-hash;
media_kit_libs_android_video = media_kit-hash;
media_kit_libs_ios_video = media_kit-hash;
media_kit_libs_linux = media_kit-hash;
media_kit_libs_macos_video = media_kit-hash;
media_kit_libs_video = media_kit-hash;
media_kit_libs_windows_video = media_kit-hash;
media_kit_video = media_kit-hash;
};
gitHashes = lib.importJSON ./gitHashes.json;
customSourceBuilders = {
# unofficial media_kit_libs_linux
@@ -118,10 +108,11 @@ flutter329.buildFlutterApplication rec {
inherit (src) passthru;
postPatch = ''
sed -i '/set(LIBMPV_ZIP_URL/,/if(MEDIA_KIT_LIBS_AVAILABLE)/{//!d; /set(LIBMPV_ZIP_URL/d}' media_kit_video/linux/CMakeLists.txt
sed -i '/if(MEDIA_KIT_LIBS_AVAILABLE)/i set(LIBMPV_HEADER_UNZIP_DIR "${mpv-unwrapped.dev}/include/mpv")' media_kit_video/linux/CMakeLists.txt
sed -i '/if(MEDIA_KIT_LIBS_AVAILABLE)/i set(LIBMPV_PATH "${mpv}/lib")' media_kit_video/linux/CMakeLists.txt
sed -i '/if(MEDIA_KIT_LIBS_AVAILABLE)/i set(LIBMPV_UNZIP_DIR "${mpv}/lib")' media_kit_video/linux/CMakeLists.txt
sed -i '/if(ARCH_NAME STREQUAL "x86_64")/,/if(MEDIA_KIT_LIBS_AVAILABLE)/{ /if(MEDIA_KIT_LIBS_AVAILABLE)/!d; /set(LIBMPV_ZIP_URL/d }' media_kit_video/linux/CMakeLists.txt
sed -i '/if(MEDIA_KIT_LIBS_AVAILABLE)/i \
set(LIBMPV_UNZIP_DIR "${mpv-unwrapped}/lib")\n\
set(LIBMPV_PATH "${mpv-unwrapped}/lib")\n\
set(LIBMPV_HEADER_UNZIP_DIR "${mpv-unwrapped.dev}/include/mpv")' media_kit_video/linux/CMakeLists.txt
'';
installPhase = ''
@@ -134,52 +125,50 @@ flutter329.buildFlutterApplication rec {
};
};
desktopItems = [
(makeDesktopItem {
name = "oneanime";
exec = "oneanime";
icon = "oneanime";
desktopName = "oneAnime";
})
];
nativeBuildInputs = [
autoPatchelfHook
copyDesktopItems
desktop-file-utils
];
buildInputs = [
alsa-lib
libepoxy
libpulseaudio
libdrm
libepoxy
libgbm
mpv
libpulseaudio
mpv-unwrapped
];
postPatch = ''
substituteInPlace lib/pages/init_page.dart \
--replace-fail "lib/opencc.so" "${libopencc}/lib/libopencc.so"
'';
postInstall = ''
ln -snf ${mpv}/lib/libmpv.so.2 $out/app/oneanime/lib/libmpv.so.2
install -Dm0644 assets/images/logo/logo_android_2.png $out/share/pixmaps/oneanime.png
ln --symbolic --no-dereference --force ${mpv-unwrapped}/lib/libmpv.so.2 $out/app/oneanime/lib/libmpv.so.2
install -D --mode=0644 assets/images/logo/logo_android_2.png $out/share/pixmaps/oneanime.png
desktop-file-edit oneAnime.desktop \
--set-key="Icon" --set-value="oneanime"
install -D --mode=0644 oneAnime.desktop --target-directory $out/share/applications
'';
passthru = {
pubspecSource =
runCommand "pubspec.lock.json"
{
nativeBuildInputs = [ yq ];
inherit (oneanime) src;
inherit src;
nativeBuildInputs = [ yq-go ];
}
''
cat $src/pubspec.lock | yq > $out
yq eval --output-format=json --prettyPrint $src/pubspec.lock > "$out"
'';
updateScript = _experimental-update-script-combinators.sequence [
(gitUpdater { })
(_experimental-update-script-combinators.copyAttrOutputToFile "oneanime.pubspecSource" ./pubspec.lock.json)
(nix-update-script { })
(
(_experimental-update-script-combinators.copyAttrOutputToFile "oneanime.pubspecSource" ./pubspec.lock.json)
// {
supportedFeatures = [ ];
}
)
{
command = [ ./update-gitHashes.py ];
supportedFeatures = [ ];
}
];
};
@@ -187,7 +176,7 @@ flutter329.buildFlutterApplication rec {
description = "Anime1 third-party client with bullet screen";
homepage = "https://github.com/Predidit/oneAnime";
mainProgram = "oneanime";
license = with lib.licenses; [ gpl3Plus ];
license = lib.licenses.gpl3Plus;
maintainers = [ ];
platforms = lib.platforms.linux;
};
+52 -68
View File
@@ -4,17 +4,11 @@
"dependency": "transitive",
"description": {
"name": "_fe_analyzer_shared",
"sha256": "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab",
"sha256": "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "76.0.0"
},
"_macros": {
"dependency": "transitive",
"description": "dart",
"source": "sdk",
"version": "0.3.3"
"version": "67.0.0"
},
"adaptive_theme": {
"dependency": "direct main",
@@ -30,11 +24,11 @@
"dependency": "transitive",
"description": {
"name": "analyzer",
"sha256": "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e",
"sha256": "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "6.11.0"
"version": "6.4.1"
},
"archive": {
"dependency": "transitive",
@@ -100,11 +94,11 @@
"dependency": "transitive",
"description": {
"name": "build",
"sha256": "cef23f1eda9b57566c81e2133d196f8e3df48f244b317368d65c5943d91148f0",
"sha256": "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "2.4.2"
"version": "2.4.1"
},
"build_config": {
"dependency": "transitive",
@@ -130,31 +124,31 @@
"dependency": "transitive",
"description": {
"name": "build_resolvers",
"sha256": "b9e4fda21d846e192628e7a4f6deda6888c36b5b69ba02ff291a01fd529140f0",
"sha256": "339086358431fa15d7eca8b6a36e5d783728cf025e559b834f4609a1fcfb7b0a",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "2.4.4"
"version": "2.4.2"
},
"build_runner": {
"dependency": "direct dev",
"description": {
"name": "build_runner",
"sha256": "058fe9dce1de7d69c4b84fada934df3e0153dd000758c4d65964d0166779aa99",
"sha256": "028819cfb90051c6b5440c7e574d1896f8037e3c96cf17aaeb054c9311cfbf4d",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "2.4.15"
"version": "2.4.13"
},
"build_runner_core": {
"dependency": "transitive",
"description": {
"name": "build_runner_core",
"sha256": "22e3aa1c80e0ada3722fe5b63fd43d9c8990759d0a2cf489c8c5d7b2bdebc021",
"sha256": "f8126682b87a7282a339b871298cc12009cb67109cfa1614d6436fb0289193e0",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "8.0.0"
"version": "7.3.2"
},
"built_collection": {
"dependency": "transitive",
@@ -330,11 +324,11 @@
"dependency": "transitive",
"description": {
"name": "dart_style",
"sha256": "7306ab8a2359a48d22310ad823521d723acfed60ee1f7e37388e8986853b6820",
"sha256": "99e066ce75c89d6b29903d788a7bb9369cf754f7b24bf70bf4b6d6d6b26853b9",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "2.3.8"
"version": "2.3.6"
},
"dbus": {
"dependency": "transitive",
@@ -724,31 +718,31 @@
"dependency": "transitive",
"description": {
"name": "leak_tracker",
"sha256": "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0",
"sha256": "8dcda04c3fc16c14f48a7bb586d4be1f0d1572731b6d81d51772ef47c02081e0",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "10.0.9"
"version": "11.0.1"
},
"leak_tracker_flutter_testing": {
"dependency": "transitive",
"description": {
"name": "leak_tracker_flutter_testing",
"sha256": "f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573",
"sha256": "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "3.0.9"
"version": "3.0.10"
},
"leak_tracker_testing": {
"dependency": "transitive",
"description": {
"name": "leak_tracker_testing",
"sha256": "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3",
"sha256": "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "3.0.1"
"version": "3.0.2"
},
"lints": {
"dependency": "transitive",
@@ -770,16 +764,6 @@
"source": "hosted",
"version": "1.3.0"
},
"macros": {
"dependency": "transitive",
"description": {
"name": "macros",
"sha256": "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "0.1.3-main.0"
},
"matcher": {
"dependency": "transitive",
"description": {
@@ -804,8 +788,8 @@
"dependency": "direct main",
"description": {
"path": "media_kit",
"ref": "main",
"resolved-ref": "ad84c59faa2b871926cb31516bdeec65d7676884",
"ref": "8c4b795d373243d1d64fea932ba497696fd89925",
"resolved-ref": "8c4b795d373243d1d64fea932ba497696fd89925",
"url": "https://github.com/Predidit/media-kit.git"
},
"source": "git",
@@ -815,8 +799,8 @@
"dependency": "direct overridden",
"description": {
"path": "libs/android/media_kit_libs_android_video",
"ref": "main",
"resolved-ref": "ad84c59faa2b871926cb31516bdeec65d7676884",
"ref": "8c4b795d373243d1d64fea932ba497696fd89925",
"resolved-ref": "8c4b795d373243d1d64fea932ba497696fd89925",
"url": "https://github.com/Predidit/media-kit.git"
},
"source": "git",
@@ -826,8 +810,8 @@
"dependency": "direct overridden",
"description": {
"path": "libs/ios/media_kit_libs_ios_video",
"ref": "main",
"resolved-ref": "ad84c59faa2b871926cb31516bdeec65d7676884",
"ref": "8c4b795d373243d1d64fea932ba497696fd89925",
"resolved-ref": "8c4b795d373243d1d64fea932ba497696fd89925",
"url": "https://github.com/Predidit/media-kit.git"
},
"source": "git",
@@ -837,8 +821,8 @@
"dependency": "direct overridden",
"description": {
"path": "libs/linux/media_kit_libs_linux",
"ref": "main",
"resolved-ref": "ad84c59faa2b871926cb31516bdeec65d7676884",
"ref": "8c4b795d373243d1d64fea932ba497696fd89925",
"resolved-ref": "8c4b795d373243d1d64fea932ba497696fd89925",
"url": "https://github.com/Predidit/media-kit.git"
},
"source": "git",
@@ -848,8 +832,8 @@
"dependency": "direct overridden",
"description": {
"path": "libs/macos/media_kit_libs_macos_video",
"ref": "main",
"resolved-ref": "ad84c59faa2b871926cb31516bdeec65d7676884",
"ref": "8c4b795d373243d1d64fea932ba497696fd89925",
"resolved-ref": "8c4b795d373243d1d64fea932ba497696fd89925",
"url": "https://github.com/Predidit/media-kit.git"
},
"source": "git",
@@ -859,8 +843,8 @@
"dependency": "direct main",
"description": {
"path": "libs/universal/media_kit_libs_video",
"ref": "main",
"resolved-ref": "ad84c59faa2b871926cb31516bdeec65d7676884",
"ref": "8c4b795d373243d1d64fea932ba497696fd89925",
"resolved-ref": "8c4b795d373243d1d64fea932ba497696fd89925",
"url": "https://github.com/Predidit/media-kit.git"
},
"source": "git",
@@ -870,8 +854,8 @@
"dependency": "direct overridden",
"description": {
"path": "libs/windows/media_kit_libs_windows_video",
"ref": "main",
"resolved-ref": "ad84c59faa2b871926cb31516bdeec65d7676884",
"ref": "8c4b795d373243d1d64fea932ba497696fd89925",
"resolved-ref": "8c4b795d373243d1d64fea932ba497696fd89925",
"url": "https://github.com/Predidit/media-kit.git"
},
"source": "git",
@@ -881,8 +865,8 @@
"dependency": "direct main",
"description": {
"path": "media_kit_video",
"ref": "main",
"resolved-ref": "ad84c59faa2b871926cb31516bdeec65d7676884",
"ref": "8c4b795d373243d1d64fea932ba497696fd89925",
"resolved-ref": "8c4b795d373243d1d64fea932ba497696fd89925",
"url": "https://github.com/Predidit/media-kit.git"
},
"source": "git",
@@ -1182,11 +1166,11 @@
"dependency": "transitive",
"description": {
"name": "screen_brightness_android",
"sha256": "6ba1b5812f66c64e9e4892be2d36ecd34210f4e0da8bdec6a2ea34f1aa42683e",
"sha256": "d34f5321abd03bc3474f4c381f53d189117eba0b039eac1916aa92cca5fd0a96",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "2.1.1"
"version": "2.1.3"
},
"screen_brightness_ios": {
"dependency": "transitive",
@@ -1382,11 +1366,11 @@
"dependency": "transitive",
"description": {
"name": "shelf_web_socket",
"sha256": "3632775c8e90d6c9712f883e633716432a27758216dfb61bd86a8321c0580925",
"sha256": "cc36c297b52866d203dbf9332263c94becc2fe0ceaa9681d07b6ef9807023b67",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "3.0.0"
"version": "2.0.1"
},
"sky_engine": {
"dependency": "transitive",
@@ -1528,11 +1512,11 @@
"dependency": "transitive",
"description": {
"name": "test_api",
"sha256": "fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd",
"sha256": "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "0.7.4"
"version": "0.7.6"
},
"timing": {
"dependency": "transitive",
@@ -1678,11 +1662,11 @@
"dependency": "transitive",
"description": {
"name": "vector_math",
"sha256": "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803",
"sha256": "d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "2.1.4"
"version": "2.2.0"
},
"vm_service": {
"dependency": "transitive",
@@ -1698,21 +1682,21 @@
"dependency": "transitive",
"description": {
"name": "volume_controller",
"sha256": "c71d4c62631305df63b72da79089e078af2659649301807fa746088f365cb48e",
"sha256": "d75039e69c0d90e7810bfd47e3eedf29ff8543ea7a10392792e81f9bded7edf5",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "2.0.8"
"version": "3.4.0"
},
"wakelock_plus": {
"dependency": "transitive",
"description": {
"name": "wakelock_plus",
"sha256": "a474e314c3e8fb5adef1f9ae2d247e57467ad557fa7483a2b895bc1b421c5678",
"sha256": "61713aa82b7f85c21c9f4cd0a148abd75f38a74ec645fcb1e446f882c82fd09b",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "1.3.2"
"version": "1.3.3"
},
"wakelock_plus_platform_interface": {
"dependency": "transitive",
@@ -1788,11 +1772,11 @@
"dependency": "direct main",
"description": {
"name": "window_manager",
"sha256": "732896e1416297c63c9e3fb95aea72d0355f61390263982a47fd519169dc5059",
"sha256": "7eb6d6c4164ec08e1bf978d6e733f3cebe792e2a23fb07cbca25c2872bfdbdcd",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "0.4.3"
"version": "0.5.1"
},
"xdg_directories": {
"dependency": "transitive",
@@ -1836,7 +1820,7 @@
}
},
"sdks": {
"dart": ">=3.7.0 <4.0.0",
"flutter": ">=3.32.2"
"dart": ">=3.8.0-0 <4.0.0",
"flutter": ">=3.35.7"
}
}
+51
View File
@@ -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()