diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-09-21 19:54:45 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-09-21 20:16:37 -0400 |
commit | d713eacb7ec390d8a0d8610cab61df57e8bd9ae3 (patch) | |
tree | 3731f65b3c0e96c29b54d5e668e195002778403b /setup.py | |
parent | 9e0d797ba7a14ffc4611655008f926f84e896918 (diff) | |
download | python-systemd-d713eacb7ec390d8a0d8610cab61df57e8bd9ae3.tar.gz |
Store id128-constants.h in the repository
Instead of generating the list of message ids anew during every build,
the file is generated manually and committed into the
repository. Also, the list of defines is stored in id128-defines.h,
also kept in the repository. Both files should only grow.
This should make build easier. But it also fixes a problem with
systemd, which occasionally drops message definitions. We will keep
them forever, so it should be safe to rely on the presence of message
definitions which systemd does not use anymore.
Fixes #23.
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 21 |
1 files changed, 2 insertions, 19 deletions
@@ -1,23 +1,7 @@ import sys, os from distutils.core import setup, Extension -from distutils.command.build_ext import build_ext from subprocess import Popen, PIPE, check_output - -class build_ext_generate_id128_header(build_ext): - def run(self): - if not self.dry_run and not os.path.exists("systemd/id128-constants.h"): - constants = [line.split()[1] - for line in open("/usr/include/systemd/sd-messages.h") - if line.startswith('#define SD_MESSAGE_')] - - with open("systemd/id128-constants.h", "w") as f: - for c in constants: - f.write('add_id(m, "{0}", {0}) JOINER\n'.format(c)) - - return build_ext.run(self) - - def call(*cmd): cmd = Popen(cmd, stdout=PIPE, stderr=PIPE, @@ -83,7 +67,7 @@ login = Extension('systemd/login', **lib('libsystemd', 'libsystemd-login', **defines)) setup (name = 'python-systemd', version = version, - description = 'Native interface to the facilities of systemd', + description = 'Python interface for libsystemd', author_email = 'david@davidstrauss.net', maintainer = 'systemd developers', maintainer_email = 'systemd-devel@lists.freedesktop.org', @@ -102,5 +86,4 @@ setup (name = 'python-systemd', _reader, _daemon, id128, - login], - cmdclass = {'build_ext': build_ext_generate_id128_header}) + login]) |