mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00

* Migrate build system to uv Closes #3787, and is a step towards #3081 and #4022 This change breaks our PyOxidizer bundling process. While we probably could update it to work with the new venvs & lockfile, my intention is to use this as a base to try out a uv-based packager/installer. Some notes about the changes: - Use uv for python download + venv installation - Drop python/requirements* in favour of pyproject files / uv.lock - Bumped to latest Python 3.9 version. The move to 3.13 should be a fairly trivial change when we're ready. - Dropped the old write_wheel.py in favour of uv/hatchling. This has the unfortunate side-effect of dropping leading zeros in our wheels, which we could try hack around in the future. - Switch to Qt 6.7 for the dev repo, as it's the first PyQt version with a Linux/ARM WebEngine wheel. - Unified our macOS deployment target with minimum required for ARM. - Dropped unused fluent python files - Dropped unused python license generation - Dropped helpers to run under Qt 5, as our wheels were already requiring Qt 6 to install. * Build action to create universal uv binary * Drop some PyOxidizer-related files * Use Windows ARM64 cargo/node binaries during build We can't provide ARM64 wheels to users yet due to #4079, but we can at least speed up the build. The rustls -> native-tls change on Windows is because ring requires clang to compile for ARM64, and I figured it's best to keep our Windows deps consistent. We already built the wheels with native-tls. * Make libankihelper a universal library We were shipping a single arch library in a purelib, leading to breakages when running on a different platform. * Use Python wheel for mpv/lame on Windows/Mac This is convenient, but suboptimal on a Mac at the moment. The first run of mpv will take a number of seconds for security checks to run, and our mpv code ends up timing out, repeating the process each time. Our installer stub will need to invoke mpv once first to get it validated. We could address this by distributing the audio with the installer/stub, or perhaps by putting the binaries in a .pkg file that's notarized+stapled and then included in the wheel. * Add some helper scripts to build a fully-locked wheel * Initial macOS launcher prototype * Add a hidden env var to preload our libs and audio helpers on macOS * qt/bundle -> qt/launcher - remove more of the old bundling code - handle app icon * Fat binary, notarization & dmg * Publish wheels on testpypi for testing * Use our Python pin for the launcher too * Python cleanups * Extend launcher to other platforms + more - Switch to Qt 6.8 for repo default, as 6.7 depends on an older libwebp/tiff which is unavailable on newer installs - Drop tools/mac-x86, as we no longer need to test against Qt 5 - Add flags to cross compile wheels on Mac and Linux - Bump glibc target to 2_36, building on Debian Stable - Increase mpv timeout on macOS to allow for initial gatekeeper checks - Ship both arm64 and amd64 uv on Linux, with a bash stub to pick the appropriate arch. * Fix pylint on Linux * Fix failure to run from /usr/local/bin * Remove remaining pyoxidizer refs, and clean up duplicate release folder * Rust dep updates - Rust 1.87 for now (1.88 due out in around a week) - Nom looks involved, so I left it for now - prost-reflect depends on a new prost version that got yanked * Python 3.13 + dep updates Updated protoc binaries + add helper in order to try fix build breakage. Ended up being due to an AI-generated update to pip-system-certs that was not reviewed carefully enough: https://gitlab.com/alelec/pip-system-certs/-/issues/36 The updated mypy/black needed some tweaks to our files. * Windows compilation fixes * Automatically run Anki after installing on Windows * Touch pyproject.toml upon install, so we check for updates * Update Python deps - urllib3 for CVE - pip-system-certs got fixed - markdown/pytest also updated
120 lines
4.1 KiB
Text
120 lines
4.1 KiB
Text
; fileassoc.nsh
|
|
; https://nsis.sourceforge.io/File_Association
|
|
; File association helper macros
|
|
; Written by Saivert
|
|
;
|
|
; Features automatic backup system and UPDATEFILEASSOC macro for
|
|
; shell change notification.
|
|
;
|
|
; |> How to use <|
|
|
; To associate a file with an application so you can double-click it in explorer, use
|
|
; the APP_ASSOCIATE macro like this:
|
|
;
|
|
; Example:
|
|
; !insertmacro APP_ASSOCIATE "txt" "myapp.textfile" "$INSTDIR\myapp.exe,0" \
|
|
; "Open with myapp" "$INSTDIR\myapp.exe $\"%1$\""
|
|
;
|
|
; Never insert the APP_ASSOCIATE macro multiple times, it is only meant
|
|
; to associate an application with a single file and using the
|
|
; the "open" verb as default. To add more verbs (actions) to a file
|
|
; use the APP_ASSOCIATE_ADDVERB macro.
|
|
;
|
|
; Example:
|
|
; !insertmacro APP_ASSOCIATE_ADDVERB "myapp.textfile" "edit" "Edit with myapp" \
|
|
; "$INSTDIR\myapp.exe /edit $\"%1$\""
|
|
;
|
|
; To have access to more options when registering the file association use the
|
|
; APP_ASSOCIATE_EX macro. Here you can specify the verb and what verb is to be the
|
|
; standard action (default verb).
|
|
;
|
|
; And finally: To remove the association from the registry use the APP_UNASSOCIATE
|
|
; macro. Here is another example just to wrap it up:
|
|
; !insertmacro APP_UNASSOCIATE "txt" "myapp.textfile"
|
|
;
|
|
; |> Note <|
|
|
; When defining your file class string always use the short form of your application title
|
|
; then a period (dot) and the type of file. This keeps the file class sort of unique.
|
|
; Examples:
|
|
; Winamp.Playlist
|
|
; NSIS.Script
|
|
; Photoshop.JPEGFile
|
|
;
|
|
; |> Tech info <|
|
|
; The registry key layout for a file association is:
|
|
; HKEY_CLASSES_ROOT
|
|
; <applicationID> = <"description">
|
|
; shell
|
|
; <verb> = <"menu-item text">
|
|
; command = <"command string">
|
|
;
|
|
|
|
!macro APP_ASSOCIATE EXT FILECLASS DESCRIPTION ICON COMMANDTEXT COMMAND
|
|
; Backup the previously associated file class
|
|
ReadRegStr $R0 HKCR ".${EXT}" ""
|
|
WriteRegStr HKCR ".${EXT}" "${FILECLASS}_backup" "$R0"
|
|
|
|
WriteRegStr HKCR ".${EXT}" "" "${FILECLASS}"
|
|
|
|
WriteRegStr HKCR "${FILECLASS}" "" `${DESCRIPTION}`
|
|
WriteRegStr HKCR "${FILECLASS}\DefaultIcon" "" `${ICON}`
|
|
WriteRegStr HKCR "${FILECLASS}\shell" "" "open"
|
|
WriteRegStr HKCR "${FILECLASS}\shell\open" "" `${COMMANDTEXT}`
|
|
WriteRegStr HKCR "${FILECLASS}\shell\open\command" "" `${COMMAND}`
|
|
!macroend
|
|
|
|
!macro APP_ASSOCIATE_EX EXT FILECLASS DESCRIPTION ICON VERB DEFAULTVERB SHELLNEW COMMANDTEXT COMMAND
|
|
; Backup the previously associated file class
|
|
ReadRegStr $R0 HKCR ".${EXT}" ""
|
|
WriteRegStr HKCR ".${EXT}" "${FILECLASS}_backup" "$R0"
|
|
|
|
WriteRegStr HKCR ".${EXT}" "" "${FILECLASS}"
|
|
StrCmp "${SHELLNEW}" "0" +2
|
|
WriteRegStr HKCR ".${EXT}\ShellNew" "NullFile" ""
|
|
|
|
WriteRegStr HKCR "${FILECLASS}" "" `${DESCRIPTION}`
|
|
WriteRegStr HKCR "${FILECLASS}\DefaultIcon" "" `${ICON}`
|
|
WriteRegStr HKCR "${FILECLASS}\shell" "" `${DEFAULTVERB}`
|
|
WriteRegStr HKCR "${FILECLASS}\shell\${VERB}" "" `${COMMANDTEXT}`
|
|
WriteRegStr HKCR "${FILECLASS}\shell\${VERB}\command" "" `${COMMAND}`
|
|
!macroend
|
|
|
|
!macro APP_ASSOCIATE_ADDVERB FILECLASS VERB COMMANDTEXT COMMAND
|
|
WriteRegStr HKCR "${FILECLASS}\shell\${VERB}" "" `${COMMANDTEXT}`
|
|
WriteRegStr HKCR "${FILECLASS}\shell\${VERB}\command" "" `${COMMAND}`
|
|
!macroend
|
|
|
|
!macro APP_ASSOCIATE_REMOVEVERB FILECLASS VERB
|
|
DeleteRegKey HKCR `${FILECLASS}\shell\${VERB}`
|
|
!macroend
|
|
|
|
|
|
!macro APP_UNASSOCIATE EXT FILECLASS
|
|
; Backup the previously associated file class
|
|
ReadRegStr $R0 HKCR ".${EXT}" `${FILECLASS}_backup`
|
|
WriteRegStr HKCR ".${EXT}" "" "$R0"
|
|
|
|
DeleteRegKey HKCR `${FILECLASS}`
|
|
!macroend
|
|
|
|
!macro APP_ASSOCIATE_GETFILECLASS OUTPUT EXT
|
|
ReadRegStr ${OUTPUT} HKCR ".${EXT}" ""
|
|
!macroend
|
|
|
|
|
|
; !defines for use with SHChangeNotify
|
|
!ifdef SHCNE_ASSOCCHANGED
|
|
!undef SHCNE_ASSOCCHANGED
|
|
!endif
|
|
!define SHCNE_ASSOCCHANGED 0x08000000
|
|
!ifdef SHCNF_FLUSH
|
|
!undef SHCNF_FLUSH
|
|
!endif
|
|
!define SHCNF_FLUSH 0x1000
|
|
|
|
!macro UPDATEFILEASSOC
|
|
; Using the system.dll plugin to call the SHChangeNotify Win32 API function so we
|
|
; can update the shell.
|
|
System::Call "shell32::SHChangeNotify(i,i,i,i) (${SHCNE_ASSOCCHANGED}, ${SHCNF_FLUSH}, 0, 0)"
|
|
!macroend
|
|
|
|
;EOF
|