gn-dist 2385__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gn_dist-2385/LICENSE +12 -0
- gn_dist-2385/MANIFEST.in +1 -0
- gn_dist-2385/PKG-INFO +17 -0
- gn_dist-2385/README.md +6 -0
- gn_dist-2385/build_gn.py +42 -0
- gn_dist-2385/pyproject.toml +60 -0
- gn_dist-2385/setup.cfg +4 -0
- gn_dist-2385/setup.py +36 -0
- gn_dist-2385/src/gn_dist/__init__.py +6 -0
- gn_dist-2385/src/gn_dist.egg-info/PKG-INFO +17 -0
- gn_dist-2385/src/gn_dist.egg-info/SOURCES.txt +11 -0
- gn_dist-2385/src/gn_dist.egg-info/dependency_links.txt +1 -0
- gn_dist-2385/src/gn_dist.egg-info/top_level.txt +1 -0
gn_dist-2385/LICENSE
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Copyright (c) 2026 geisserml <geisserml@gmail.com>
|
|
2
|
+
Copyright (c) 2015-2026 The Chromium Authors. All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
5
|
+
|
|
6
|
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
7
|
+
|
|
8
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
9
|
+
|
|
10
|
+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
11
|
+
|
|
12
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
gn_dist-2385/MANIFEST.in
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
include build_gn.py
|
gn_dist-2385/PKG-INFO
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gn-dist
|
|
3
|
+
Version: 2385
|
|
4
|
+
Summary: Binary distributions of GN (generate-ninja) for Linux.
|
|
5
|
+
Author-email: pypdfium2-team <geisserml@gmail.com>
|
|
6
|
+
License-Expression: BSD-3-Clause
|
|
7
|
+
Project-URL: repository, https://github.com/pypdfium2-team/gn-dist
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Dynamic: license-file
|
|
11
|
+
|
|
12
|
+
<!-- SPDX-FileCopyrightText: 2026 geisserml <geisserml@gmail.com> -->
|
|
13
|
+
<!-- SPDX-License-Identifier: CC-BY-4.0 -->
|
|
14
|
+
|
|
15
|
+
# gn-dist
|
|
16
|
+
|
|
17
|
+
Binary distributions of GN (generate-ninja) for Linux (glibc and musl).
|
gn_dist-2385/README.md
ADDED
gn_dist-2385/build_gn.py
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 geisserml <geisserml@gmail.com>
|
|
2
|
+
# SPDX-License-Identifier: BSD-3-Clause
|
|
3
|
+
|
|
4
|
+
import os
|
|
5
|
+
import sys
|
|
6
|
+
import stat
|
|
7
|
+
import shutil
|
|
8
|
+
import subprocess
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
PROJECT_DIR = Path(__file__).parent.resolve()
|
|
12
|
+
SBUILD_DIR = PROJECT_DIR/"sbuild"
|
|
13
|
+
GN_DIR = SBUILD_DIR/"gn"
|
|
14
|
+
GN_REV = "9ece3f5254c273cb46606a6571963f931c3b012d"
|
|
15
|
+
|
|
16
|
+
def log(*args, **kwargs):
|
|
17
|
+
print(*args, **kwargs, file=sys.stderr)
|
|
18
|
+
|
|
19
|
+
def run_cmd(command, cwd, **kwargs):
|
|
20
|
+
log(f"{command} (cwd={cwd})")
|
|
21
|
+
return subprocess.run(command, cwd=cwd, check=True, **kwargs)
|
|
22
|
+
|
|
23
|
+
def make_executable(path):
|
|
24
|
+
path.chmod(path.stat().st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
|
|
25
|
+
|
|
26
|
+
def build_gn():
|
|
27
|
+
# GN's build system runs git commands that assume a full checkout
|
|
28
|
+
# --depth 1 checkout would need a manually created sbuild/gn/out/last_commit_position.h and passing "--no-last-commit-position" to build/gen.py - probably not worth the trouble for now.
|
|
29
|
+
SBUILD_DIR.mkdir(exist_ok=True)
|
|
30
|
+
if not GN_DIR.exists():
|
|
31
|
+
run_cmd(["git", "clone", "https://gn.googlesource.com/gn/"], cwd=SBUILD_DIR)
|
|
32
|
+
run_cmd(["git", "checkout", GN_REV], cwd=GN_DIR)
|
|
33
|
+
env = os.environ.copy()
|
|
34
|
+
env["CXX"] = os.environ.get("CXX", "g++")
|
|
35
|
+
run_cmd([sys.executable, "build/gen.py", "--no-static-libstdc++", "--allow-warnings"], cwd=GN_DIR, env=env)
|
|
36
|
+
run_cmd(["ninja", "-C", "out", "gn"], cwd=GN_DIR)
|
|
37
|
+
target_path = PROJECT_DIR/"src"/"gn_dist"/"gn"
|
|
38
|
+
shutil.copyfile(GN_DIR/"out"/"gn", target_path)
|
|
39
|
+
make_executable(target_path)
|
|
40
|
+
|
|
41
|
+
if __name__ == "__main__":
|
|
42
|
+
build_gn()
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 geisserml <geisserml@gmail.com>
|
|
2
|
+
# SPDX-License-Identifier: BSD-3-Clause
|
|
3
|
+
|
|
4
|
+
[build-system]
|
|
5
|
+
build-backend = "setuptools.build_meta"
|
|
6
|
+
requires = ["setuptools"]
|
|
7
|
+
|
|
8
|
+
[project]
|
|
9
|
+
name = "gn-dist"
|
|
10
|
+
version = "2385" # gn --version
|
|
11
|
+
description = "Binary distributions of GN (generate-ninja) for Linux."
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
authors = [{ name = "pypdfium2-team", email = "geisserml@gmail.com" }]
|
|
14
|
+
license = "BSD-3-Clause"
|
|
15
|
+
|
|
16
|
+
[project.urls]
|
|
17
|
+
repository = "https://github.com/pypdfium2-team/gn-dist"
|
|
18
|
+
|
|
19
|
+
[tool.cibuildwheel]
|
|
20
|
+
build-frontend = "build"
|
|
21
|
+
test-command = [
|
|
22
|
+
"python {project}/utils/test.py",
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
# install ninja
|
|
27
|
+
|
|
28
|
+
[[tool.cibuildwheel.overrides]]
|
|
29
|
+
select = "*-manylinux_*"
|
|
30
|
+
before-all = [
|
|
31
|
+
# "dnf clean all && dnf makecache --refresh",
|
|
32
|
+
"dnf -y install ninja-build",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
# manylinux_armv7l uses a Ubuntu-based image, for lack of an RHEL-based one
|
|
36
|
+
[[tool.cibuildwheel.overrides]]
|
|
37
|
+
select = "*-manylinux_armv7l"
|
|
38
|
+
before-all = [
|
|
39
|
+
"apt-get update",
|
|
40
|
+
"apt-get install -y ninja-build",
|
|
41
|
+
]
|
|
42
|
+
manylinux-armv7l-image = "ghcr.io/mayeut/manylinux_2_35:2025.11.03-1"
|
|
43
|
+
|
|
44
|
+
[[tool.cibuildwheel.overrides]]
|
|
45
|
+
select = "*-musllinux_*"
|
|
46
|
+
inherit.before-all = "append"
|
|
47
|
+
before-all = ["apk add ninja-build"]
|
|
48
|
+
environment.PATH = "/usr/lib/ninja-build/bin:$PATH"
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
[[tool.cibuildwheel.overrides]]
|
|
52
|
+
select = "*-*linux_{ppc64le,riscv64,loongarch64,s390x}"
|
|
53
|
+
environment-pass = ["RUNNER_ARCH"]
|
|
54
|
+
inherit.before-all = "append"
|
|
55
|
+
before-all = [
|
|
56
|
+
"bash ./utils/install-static-clang.sh",
|
|
57
|
+
]
|
|
58
|
+
inherit.environment = "append"
|
|
59
|
+
environment.CXX = "clang++"
|
|
60
|
+
environment.PATH = "/opt/clang/bin:$PATH"
|
gn_dist-2385/setup.cfg
ADDED
gn_dist-2385/setup.py
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 geisserml <geisserml@gmail.com>
|
|
2
|
+
# SPDX-License-Identifier: BSD-3-Clause
|
|
3
|
+
|
|
4
|
+
import sys
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
import setuptools
|
|
7
|
+
from setuptools.command.build_py import build_py
|
|
8
|
+
try:
|
|
9
|
+
from setuptools.command.bdist_wheel import bdist_wheel
|
|
10
|
+
except ImportError:
|
|
11
|
+
from wheel.bdist_wheel import bdist_wheel
|
|
12
|
+
|
|
13
|
+
sys.path.insert(0, str(Path(__file__).parent))
|
|
14
|
+
from build_gn import build_gn # local
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class BuildPyClass(build_py):
|
|
18
|
+
def run(self):
|
|
19
|
+
build_gn()
|
|
20
|
+
build_py.run(self)
|
|
21
|
+
|
|
22
|
+
class BdistWheelClass(bdist_wheel):
|
|
23
|
+
def get_tag(self, *args, **kws):
|
|
24
|
+
_py, _abi, plat_tag = bdist_wheel.get_tag(self, *args, **kws)
|
|
25
|
+
return "py3", "none", plat_tag
|
|
26
|
+
|
|
27
|
+
class BinaryDistribution (setuptools.Distribution):
|
|
28
|
+
def has_ext_modules(self):
|
|
29
|
+
return True
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
setuptools.setup(
|
|
33
|
+
package_data = {"gn_dist": ["gn"]},
|
|
34
|
+
cmdclass = {"build_py": BuildPyClass, "bdist_wheel": BdistWheelClass},
|
|
35
|
+
distclass = BinaryDistribution,
|
|
36
|
+
)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gn-dist
|
|
3
|
+
Version: 2385
|
|
4
|
+
Summary: Binary distributions of GN (generate-ninja) for Linux.
|
|
5
|
+
Author-email: pypdfium2-team <geisserml@gmail.com>
|
|
6
|
+
License-Expression: BSD-3-Clause
|
|
7
|
+
Project-URL: repository, https://github.com/pypdfium2-team/gn-dist
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Dynamic: license-file
|
|
11
|
+
|
|
12
|
+
<!-- SPDX-FileCopyrightText: 2026 geisserml <geisserml@gmail.com> -->
|
|
13
|
+
<!-- SPDX-License-Identifier: CC-BY-4.0 -->
|
|
14
|
+
|
|
15
|
+
# gn-dist
|
|
16
|
+
|
|
17
|
+
Binary distributions of GN (generate-ninja) for Linux (glibc and musl).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
gn_dist
|