diff --git a/LICENSE b/LICENSE index 1ed2981..f288702 100644 --- a/LICENSE +++ b/LICENSE @@ -1,8 +1,3 @@ -Additional licenses to git submodules not explicitly shipped with the source code: -python-a2s: https://raw.githubusercontent.com/Yepoleb/python-a2s/refs/heads/master/LICENSE -dayzquery: https://raw.githubusercontent.com/Yepoleb/dayzquery/refs/heads/master/LICENSE - - GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 diff --git a/scripts/concat_licenses.py b/scripts/concat_licenses.py index 4ce0fd7..9406824 100644 --- a/scripts/concat_licenses.py +++ b/scripts/concat_licenses.py @@ -1,14 +1,16 @@ from pathlib import Path def concat_license() -> str: + combined = "" root = Path(__file__).resolve().parents[1] licenses = root.joinpath("licenses") - combined = "" + self_license = root.joinpath("LICENSE") + combined += "--- DZGUI application license ---\n\n" + combined += self_license.read_text() for _dir in licenses.iterdir(): - docs = _dir.glob("*.md") + docs = _dir.glob("*") doc = list(docs)[0] header = f"\n--- The verbatim license for bundled dependency '{_dir.name}' follows ---\n\n" combined += header combined += doc.read_text() return combined - diff --git a/scripts/release.py b/scripts/release.py index 2863dcc..5965da0 100644 --- a/scripts/release.py +++ b/scripts/release.py @@ -5,6 +5,7 @@ import tarfile from pathlib import Path +from concat_licenses import concat_license from prebuild import get_pyapp, rebuild_cpython @@ -44,17 +45,25 @@ env["PYAPP_FULL_ISOLATION"] = "true" env["PYAPP_DISTRIBUTION_PATH"] = str(cpython) env["PYAPP_DISTRIBUTION_PYTHON_PATH"] = "python/bin/python3" +subfolder = output.joinpath(stem) +subfolder.mkdir(parents=True) + +combined_licenses = concat_licenses() +license_file = subfolder.joinpath("LICENSE") +license_file.write_text(combined_licenses) + + proc = subprocess.run(["cargo", "build", "--release"], env=env, cwd=pyapp_dir) if proc.returncode == 0: output_exe = build_dir.joinpath("pyapp-latest/target/release/pyapp") - release_exe = output.joinpath(appname) + release_exe = subfolder.joinpath(appname) output_exe.rename(release_exe) tarpath = output.joinpath(tarname) with tarfile.open(tarpath, "w:gz") as tar: - info = tar.gettarinfo(release_exe) + info = tar.gettarinfo(subfile) info.uname = appname info.name = appname - with open(release_exe, "rb") as f: + with open(subfolder, "rb") as f: tar.addfile(info, f) print(f"Wrote tarfile to '{tarpath}'")