Use prebuild aria2c on Windows
This commit is contained in:
parent
5905de35a1
commit
f00fa4cbd6
|
@ -1,27 +1,51 @@
|
|||
from .base import Dependency, ReleaseDownload, MakeBuilder, NoopBuilder
|
||||
|
||||
from kiwixbuild.utils import Remotefile, run_command
|
||||
from kiwixbuild.utils import Remotefile, run_command, pj
|
||||
import platform
|
||||
from shutil import copy2
|
||||
|
||||
|
||||
class Aria2(Dependency):
|
||||
name = "aria2"
|
||||
|
||||
class Source(ReleaseDownload):
|
||||
archive = Remotefile(
|
||||
"aria2-1.37.0.tar.xz",
|
||||
"60a420ad7085eb616cb6e2bdf0a7206d68ff3d37fb5a956dc44242eb2f79b66b",
|
||||
"https://github.com/aria2/aria2/releases/download/release-1.37.0/aria2-1.37.0.tar.xz",
|
||||
)
|
||||
if platform.system() == "Windows":
|
||||
|
||||
def _post_prepare_script(self, context):
|
||||
context.try_skip(self.extract_path)
|
||||
command = ["autoreconf", "-i"]
|
||||
run_command(command, self.extract_path, context)
|
||||
class Source(ReleaseDownload):
|
||||
archive = Remotefile(
|
||||
"aria2-1.37.0-win-64bit-build1.zip",
|
||||
"67d015301eef0b612191212d564c5bb0a14b5b9c4796b76454276a4d28d9b288",
|
||||
"https://github.com/aria2/aria2/releases/download/release-1.37.0/aria2-1.37.0-win-64bit-build1.zip",
|
||||
)
|
||||
|
||||
class Builder(MakeBuilder):
|
||||
dependencies = ["zlib"]
|
||||
configure_options = [
|
||||
"--disable-libaria2",
|
||||
"--disable-websocket",
|
||||
"--without-sqlite3",
|
||||
]
|
||||
class Builder(NoopBuilder):
|
||||
def build(self):
|
||||
self.command("copy_binary", self._copy_binary)
|
||||
|
||||
def _copy_binary(self, context):
|
||||
context.try_skip(self.build_path)
|
||||
copy2(
|
||||
pj(self.source_path, "aria2c.exe"),
|
||||
pj(self.buildEnv.install_dir, "bin"),
|
||||
)
|
||||
|
||||
else:
|
||||
|
||||
class Source(ReleaseDownload):
|
||||
archive = Remotefile(
|
||||
"aria2-1.37.0.tar.xz",
|
||||
"60a420ad7085eb616cb6e2bdf0a7206d68ff3d37fb5a956dc44242eb2f79b66b",
|
||||
"https://github.com/aria2/aria2/releases/download/release-1.37.0/aria2-1.37.0.tar.xz",
|
||||
)
|
||||
|
||||
def _post_prepare_script(self, context):
|
||||
context.try_skip(self.extract_path)
|
||||
command = ["autoreconf", "-i"]
|
||||
run_command(command, self.extract_path, context)
|
||||
|
||||
class Builder(MakeBuilder):
|
||||
dependencies = ["zlib"]
|
||||
configure_options = [
|
||||
"--disable-libaria2",
|
||||
"--disable-websocket",
|
||||
"--without-sqlite3",
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue