-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate to PEP517 meson-python build
Bug: https://bugs.gentoo.org/909888 Signed-off-by: Zac Medico <[email protected]>
- Loading branch information
Showing
32 changed files
with
465 additions
and
203 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
This file was deleted.
Oops, something went wrong.
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
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
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,54 @@ | ||
py_bins = [ | ||
'eclean', | ||
'eclean-dist', | ||
'ekeyword', | ||
'enalyze', | ||
'epkginfo', | ||
'equery', | ||
'eread', | ||
'eshowkw', | ||
'imlate', | ||
'merge-driver-ekeyword', | ||
'revdep-rebuild', | ||
] | ||
|
||
ebump = configure_file( | ||
input : 'ebump', | ||
output : 'ebump', | ||
configuration : conf_data | ||
) | ||
|
||
euse = configure_file( | ||
input : 'euse', | ||
output : 'euse', | ||
configuration : conf_data | ||
) | ||
|
||
revdep_rebuild_sh = configure_file( | ||
input : 'revdep-rebuild.sh', | ||
output : 'revdep-rebuild.sh', | ||
configuration : conf_data | ||
) | ||
|
||
other_bins = [ | ||
ebump, | ||
euse, | ||
revdep_rebuild_sh, | ||
] | ||
|
||
# It might seem sensible to use py.install_sources() to install the Python | ||
# scripts, but it's really just a wrapper around install_data that forces the | ||
# install_dir. Meson 1.2.0 and later also optimize to bytecode, but Gentoo does | ||
# this in the ebuild. | ||
|
||
install_data( | ||
py_bins, | ||
install_dir : get_option('bindir'), | ||
install_mode : 'rwxr-xr-x', | ||
) | ||
|
||
install_data( | ||
other_bins, | ||
install_dir : get_option('bindir'), | ||
install_mode : 'rwxr-xr-x', | ||
) |
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
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,20 @@ | ||
install_data( | ||
[ | ||
'99gentoolkit-env', | ||
], | ||
install_dir : sysconfdir / 'env.d' | ||
) | ||
|
||
install_data( | ||
[ | ||
'eclean/packages.exclude', | ||
'eclean/distfiles.exclude', | ||
'revdep-rebuild/99revdep-rebuild', | ||
], | ||
install_dir: sysconfdir, | ||
preserve_path: true | ||
) | ||
|
||
if not system_wide | ||
subdir_done() | ||
endif |
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,23 @@ | ||
man_pages_out = [] | ||
man_pages_in = [ | ||
'ebump.1', | ||
'eclean.1', | ||
'enalyze.1', | ||
'epkginfo.1', | ||
'equery.1', | ||
'eread.1', | ||
'eshowkw.1', | ||
'euse.1', | ||
'imlate.1', | ||
'revdep-rebuild.1', | ||
] | ||
|
||
foreach man_page : man_pages_in | ||
man_pages_out += configure_file( | ||
input : man_page, | ||
output : man_page, | ||
configuration : conf_data | ||
) | ||
endforeach | ||
|
||
install_man(man_pages_out) |
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,79 @@ | ||
project( | ||
'gentoolkit', | ||
'c', | ||
version : '0.6.2', | ||
license : 'GPL-2.0-or-later', | ||
meson_version : '>=0.64.0' | ||
) | ||
|
||
py_mod = import('python') | ||
py = py_mod.find_installation(pure : true) | ||
|
||
sed = find_program('sed', required : true) | ||
|
||
system_wide = get_option('system-wide') | ||
|
||
eprefix = get_option('eprefix') | ||
prefixdir = get_option('prefix') | ||
datadir = get_option('datadir') | ||
docdir = get_option('docdir') | ||
|
||
sysconfdir = system_wide ? get_option('sysconfdir') \ | ||
: datadir / 'etc' | ||
|
||
if docdir == '' | ||
docdir = system_wide ? datadir / 'doc' / 'gentoolkit' \ | ||
: datadir / 'share' / 'gentoolkit' / 'doc' | ||
endif | ||
|
||
# hprefixify is copied from prefix.eclass. | ||
dirs = '/(usr|lib(|[onx]?32|n?64)|etc|bin|sbin|var|opt|run)' | ||
hprefixify = [ | ||
sed, '-r', | ||
'-e', 's,([^[:alnum:]}\\)\\.])' + dirs + ',\\1' + eprefix.replace(',', '\\,') + '/\\2,g', | ||
'-e', 's,^' + dirs + ',' + eprefix.replace(',', '\\,') + '/\\1,', | ||
'@INPUT@' | ||
] | ||
|
||
version = '' | ||
|
||
conf_data = configuration_data({ | ||
'VERSION' : version == '' ? meson.project_version() : version | ||
}) | ||
|
||
if system_wide | ||
conf_data.set('INSTALL_TYPE', 'SYSTEM') | ||
conf_data.set('EPREFIX', eprefix) | ||
else | ||
conf_data.set('INSTALL_TYPE', 'MODULE') | ||
conf_data.set('EPREFIX', '') | ||
endif | ||
|
||
subdir('bin') | ||
subdir('pym') | ||
|
||
test( | ||
'python-unittest', | ||
py, | ||
args : ['-m', 'unittest', 'discover', meson.current_source_dir() / 'pym'], | ||
timeout : 0 | ||
) | ||
|
||
if get_option('code-only') | ||
subdir_done() | ||
endif | ||
|
||
subdir('data') | ||
|
||
install_data( | ||
[ | ||
'NEWS', | ||
], | ||
install_dir : docdir | ||
) | ||
|
||
if not system_wide | ||
subdir_done() | ||
endif | ||
|
||
subdir('man') |
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,15 @@ | ||
option('system-wide', type : 'boolean', value : true, | ||
description : 'Install system-wide rather than isolated inside a Python environment' | ||
) | ||
|
||
option('code-only', type : 'boolean', value : false, | ||
description : 'Do not install additional files such as configuration or documentation' | ||
) | ||
|
||
option('eprefix', type : 'string', | ||
description : 'Prefix directory for gentoolkit to operate under' | ||
) | ||
|
||
option('docdir', type : 'string', | ||
description : 'Documentation directory' | ||
) |
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 |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
+ "modular re-write by: Brian Dolbec (dol-sen)" | ||
) | ||
__email__ = "[email protected], " + "[email protected]" | ||
__version__ = "git" | ||
__version__ = "@VERSION@" | ||
__productname__ = "eclean" | ||
__description__ = "A cleaning tool for Gentoo distfiles and binaries." | ||
|
||
|
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,18 @@ | ||
|
||
cli_py = configure_file( | ||
input : 'cli.py', | ||
output : 'cli.py', | ||
configuration : conf_data | ||
) | ||
|
||
py.install_sources( | ||
[ | ||
'__init__.py', | ||
'clean.py', | ||
cli_py, | ||
'exclude.py', | ||
'output.py', | ||
'search.py', | ||
], | ||
subdir : 'gentoolkit/eclean' | ||
) |
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
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,26 @@ | ||
|
||
ekeyword_py = configure_file( | ||
input : 'ekeyword.py', | ||
output : 'ekeyword.py', | ||
configuration : conf_data | ||
) | ||
|
||
py.install_sources( | ||
[ | ||
'__init__.py', | ||
ekeyword_py, | ||
'test_ekeyword.py', | ||
], | ||
subdir : 'gentoolkit/ekeyword' | ||
) | ||
|
||
install_data( | ||
[ | ||
'Makefile', | ||
'README', | ||
'pytest.ini', | ||
], | ||
install_dir : py.get_install_dir() / 'gentoolkit' / 'ekeyword' | ||
) | ||
|
||
subdir('tests') |
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,12 @@ | ||
install_data( | ||
[ | ||
'process-1.ebuild', | ||
'profiles/arches-desc/profiles/arch.list', | ||
'profiles/arches-desc/profiles/arches.desc', | ||
'profiles/arches-desc/profiles/profiles.desc', | ||
'profiles/both/profiles/arch.list', | ||
'profiles/both/profiles/profiles.desc', | ||
], | ||
preserve_path: true, | ||
install_dir : py.get_install_dir() / 'gentoolkit' / 'ekeyword' / 'tests' | ||
) |
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 |
---|---|---|
|
@@ -12,8 +12,8 @@ | |
|
||
|
||
__docformat__ = "epytext" | ||
# version is dynamically set by distutils sdist | ||
__version__ = "git" | ||
# version is dynamically set by meson dist | ||
__version__ = "@VERSION@" | ||
__productname__ = "enalyze" | ||
__authors__ = "Brian Dolbec, <[email protected]>" | ||
|
||
|
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,18 @@ | ||
|
||
__init__py = configure_file( | ||
input : '__init__.py', | ||
output : '__init__.py', | ||
configuration : conf_data | ||
) | ||
|
||
py.install_sources( | ||
[ | ||
__init__py, | ||
'analyze.py', | ||
'lib.py', | ||
'meson.build', | ||
'output.py', | ||
'rebuild.py', | ||
], | ||
subdir : 'gentoolkit/enalyze' | ||
) |
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
Oops, something went wrong.