From d713eacb7ec390d8a0d8610cab61df57e8bd9ae3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 21 Sep 2016 19:54:45 -0400 Subject: 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. --- setup.py | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index eed7c06..d114935 100644 --- a/setup.py +++ b/setup.py @@ -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]) -- cgit v1.2.1