from test_automation_suite.dependencies.unpack_dependency import UnpackDependency

############################
# Cyperpunk
############################

symlink_target = "{{installation_path}}/Prefixes/default/Cyberpunk 2077/"
symlink_origin = "{{installation_path}}/Cyberpunk 2077/pfx/drive_c/users/steamuser/AppData/Local/CD Projekt Red/Cyberpunk 2077/pfx"  # noqa: E501

cyberpunk_dependency = (
    UnpackDependency("CP2077")
    .add_download_path("http://fai-cacher/CP2077.tar.zst")
    .add_after_install_commands(
        [
            "mkdir -p {{installation_path}}/Steam",
            f"ln -sv '{symlink_target}' '{symlink_origin}'",
        ],
    )
)


############################
# Xonotic
############################

xonotic_dependency = UnpackDependency("xonotic").add_download_path(
    "http://fai-cacher/xonotic.tar.zst",
)


############################
# GravityMark
############################

gravitymark_dependency = (
    UnpackDependency("gravitymark")
    .add_download_path("http://fai-cacher/gravitymark.tar.zst")
    .add_after_install_commands(
        [
            """
expect -c "
spawn ./GravityMark.run --noexec --quiet
expect \\"Please type y to accept, n otherwise:\\"
send \\"y\\r\\"
expect eof
"
    """,
            f"ln -sv '{symlink_target}' '{symlink_origin}'",
        ],
    )
)


############################
# FurMark
############################

furmark_dependency = UnpackDependency("furmark").add_download_path(
    "http://fai-cacher/furmark.tar.zst",
)
