Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev-python/setuptools-golang: new package, add 2.7.0
- Loading branch information
1 parent
36ab289
commit e85b8be
Showing
5 changed files
with
141 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
AUX setuptools-golang-2.7.0-remove-build_manylinux_wheels.patch 2776 BLAKE2B 910bb6e287a6cf902810fac8852d8196fadab20803fcb24144d28af387921e5e0205631ef59405f7bf9da49918f5491bed6479ba304b617c18aed806d2f0f0ac SHA512 2933e25537bb4d525529935c8f53b8485b9083e2480c7a4be0e90479c52cd1a4f5045a616e6b7f9b4071f629e9519f9057e422112ed25d87e4fc75eb9355cc2b | ||
AUX setuptools-golang-2.7.0-remove-go-get.patch 480 BLAKE2B 85195279ea126a3bbfc8b472880dba332045d6780adbb34a685c0981a5e957f8ceda38d7f8d704fe5b55a5d324e9f55c222e308bef502cab02942c9431b3315a SHA512 cff039f390efd1d848bfb3e495ff980da8c0ccadfa9ab8b4854702b282673deb14439b9353c86746f22f605aa4af41435741d9ec2625cc28d040c6e08dcf68a3 | ||
DIST setuptools_golang-2.7.0.tar.gz 6929 BLAKE2B 88f2d1d75817957415aebcff18c17a1dcfef0b404b681260310419d6082854e2eeb7ab1b009c769e0743d2d4dcfc7fa307c3bc62739faeca541409cf7174804a SHA512 b2f6407d3f3a74625d8d257352f3b26e15b01bb5c01efd442bd0d34c82a5a2c4a8e284f1dd5e134050b63425c328c8e8c4b3e671e3861755ac9bebd127b15291 | ||
EBUILD setuptools-golang-2.7.0.ebuild 699 BLAKE2B 5dc5d6b8469f496453f493465f887e0f435aefe3af02e73242be86207ab4a7bdb235845ef4b3997568a62870f1f1060ecb0f51a2946ad64d3460d2cdc4be6305 SHA512 ce1186998064cca09b88d7cd5b4bd5ceef17c272e4d8c7ac560d176d870ec1de216aa114bfedde065acf4760432f2c6663e2ca5c89211669a2e5964411f586fc |
84 changes: 84 additions & 0 deletions
84
...ython/setuptools-golang/files/setuptools-golang-2.7.0-remove-build_manylinux_wheels.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
diff --git a/setup.cfg b/setup.cfg | ||
index 69b7082..2617168 100644 | ||
--- a/setup.cfg | ||
+++ b/setup.cfg | ||
@@ -25,8 +25,6 @@ py_modules = setuptools_golang | ||
python_requires = >=3.6.1 | ||
|
||
[options.entry_points] | ||
-console_scripts = | ||
- setuptools-golang-build-manylinux-wheels = setuptools_golang:build_manylinux_wheels | ||
distutils.setup_keywords = | ||
build_golang = setuptools_golang:set_build_ext | ||
|
||
diff --git a/setuptools_golang.egg-info/entry_points.txt b/setuptools_golang.egg-info/entry_points.txt | ||
index 09f39fb..4ccdcba 100644 | ||
--- a/setuptools_golang.egg-info/entry_points.txt | ||
+++ b/setuptools_golang.egg-info/entry_points.txt | ||
@@ -1,6 +1,3 @@ | ||
-[console_scripts] | ||
-setuptools-golang-build-manylinux-wheels = setuptools_golang:build_manylinux_wheels | ||
- | ||
[distutils.setup_keywords] | ||
build_golang = setuptools_golang:set_build_ext | ||
|
||
diff --git a/setuptools_golang.py b/setuptools_golang.py | ||
index a30e0c9..1af81d6 100644 | ||
--- a/setuptools_golang.py | ||
+++ b/setuptools_golang.py | ||
@@ -191,55 +191,3 @@ def set_build_ext( | ||
) -> None: | ||
base = dist.cmdclass.get('build_ext', _build_ext) | ||
dist.cmdclass['build_ext'] = _get_build_ext_cls(base, **value) | ||
- | ||
- | ||
-GOLANG = 'https://storage.googleapis.com/golang/go{}.linux-amd64.tar.gz' | ||
-SCRIPT = '''\ | ||
-cd /tmp | ||
-curl {golang} --silent --location | tar -xz | ||
-export PATH="/tmp/go/bin:$PATH" HOME=/tmp | ||
-for py in {pythons}; do | ||
- "/opt/python/$py/bin/pip" wheel --no-deps --wheel-dir /tmp /dist/*.tar.gz | ||
-done | ||
-ls *.whl | xargs -n1 --verbose auditwheel repair --wheel-dir /dist | ||
-ls -al /dist | ||
-''' | ||
- | ||
- | ||
-def build_manylinux_wheels( | ||
- argv: Optional[Sequence[str]] = None, | ||
-) -> int: # pragma: no cover | ||
- parser = argparse.ArgumentParser() | ||
- parser.add_argument( | ||
- '--golang', default='1.17.1', | ||
- help='Override golang version (default %(default)s)', | ||
- ) | ||
- parser.add_argument( | ||
- '--pythons', default='cp36-cp36m', | ||
- help='Override pythons to build (default %(default)s)', | ||
- ) | ||
- args = parser.parse_args(argv) | ||
- | ||
- golang = GOLANG.format(args.golang) | ||
- pythons = ' '.join(args.pythons.split(',')) | ||
- | ||
- assert os.path.exists('setup.py') | ||
- if os.path.exists('dist'): | ||
- shutil.rmtree('dist') | ||
- os.makedirs('dist') | ||
- _check_call(('python', 'setup.py', 'sdist'), cwd='.', env={}) | ||
- _check_call( | ||
- ( | ||
- 'docker', 'run', '--rm', | ||
- '--volume', f'{os.path.abspath("dist")}:/dist:rw', | ||
- '--user', f'{os.getuid()}:{os.getgid()}', | ||
- 'quay.io/pypa/manylinux1_x86_64:latest', | ||
- 'bash', '-o', 'pipefail', '-euxc', | ||
- SCRIPT.format(golang=golang, pythons=pythons), | ||
- ), | ||
- cwd='.', env={}, | ||
- ) | ||
- print('*' * 79) | ||
- print('Your wheels have been built into ./dist') | ||
- print('*' * 79) | ||
- return 0 |
13 changes: 13 additions & 0 deletions
13
dev-python/setuptools-golang/files/setuptools-golang-2.7.0-remove-go-get.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/setuptools_golang.py b/setuptools_golang.py | ||
index 02cf980..0a946b7 100644 | ||
--- a/setuptools_golang.py | ||
+++ b/setuptools_golang.py | ||
@@ -149,8 +149,6 @@ def _get_build_extension_method( | ||
|
||
gopath = os.environ.get('SETUPTOOLS_GOLANG_GOPATH', tempdir) | ||
env = {'GOPATH': gopath} | ||
- cmd_get = ('go', 'get', '-d') | ||
- _check_call(cmd_get, cwd=pkg_path, env=env) | ||
|
||
env.update({ | ||
'CGO_CFLAGS': _get_cflags( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> | ||
<pkgmetadata> | ||
<maintainer type="person"> | ||
<email>gentoo@flut.nl.eu.org</email> | ||
<name>Osiris Inferi</name> | ||
</maintainer> | ||
<upstream> | ||
<remote-id type="pypi">setuptools-golang</remote-id> | ||
</upstream> | ||
</pkgmetadata> |
29 changes: 29 additions & 0 deletions
29
dev-python/setuptools-golang/setuptools-golang-2.7.0.ebuild
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Copyright 1999-2018 Gentoo Authors | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
EAPI=8 | ||
|
||
PYTHON_COMPAT=( python3_{8..10} ) | ||
|
||
inherit distutils-r1 | ||
|
||
MY_PN=${PN//-/_} | ||
|
||
DESCRIPTION="A setuptools extension for building cpython extensions written in golang" | ||
HOMEPAGE="https://pypi.org/project/setuptools-golang/ https://github.com/asottile/setuptools-golang/" | ||
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${MY_PN}-${PV}.tar.gz" | ||
|
||
SLOT="0" | ||
LICENSE="MIT" | ||
KEYWORDS="~amd64 ~x86" | ||
|
||
S="${WORKDIR}/${MY_PN}-${PV}" | ||
|
||
RDEPEND="" | ||
DEPEND="dev-python/setuptools[${PYTHON_USEDEP}] | ||
${RDEPEND}" | ||
|
||
PATCHES=( | ||
"${FILESDIR}/${P}-remove-build_manylinux_wheels.patch" | ||
"${FILESDIR}/${P}-remove-go-get.patch" | ||
) |