Skip to content

Commit e06fd2d

Browse files
committed
Make C extension non-optional for RPM, .deb builds
Patch setup.py during build of .rpm or .deb packages to make the C extension non-optional once again. This should fail the package build if building the extension fails.
1 parent abef471 commit e06fd2d

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/setup.py b/setup.py
2+
index 6e96b27..c149947 100755
3+
--- a/setup.py
4+
+++ b/setup.py
5+
@@ -27,7 +27,7 @@ mod = [Extension("ihm._format",
6+
extra_compile_args=cargs,
7+
swig_opts=['-keyword', '-nodefaultctor',
8+
'-nodefaultdtor', '-noproxy'],
9+
- optional=True)]
10+
+ optional=False)]
11+
12+
with open("README.md", "r") as fh:
13+
long_description = fh.read()

util/debian/patches/series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ihm-force-c-ext.patch

util/python-ihm.spec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Summary: Package for handling IHM mmCIF and BinaryCIF files
77
Packager: Ben Webb <ben@salilab.org>
88
URL: https://pypi.python.org/pypi/ihm
99
Source: ihm-%{version}.tar.gz
10+
Patch0: ihm-force-c-ext.patch
1011
BuildRequires: python3-devel, python3-setuptools, gcc
1112
%if 0%{?rhel} != 7
1213
BuildRequires: python3-msgpack
@@ -25,6 +26,7 @@ with Python 3.6 or later.
2526

2627
%prep
2728
%setup -n ihm-%{version}
29+
%patch -P 0 -p1
2830
%if 0%{?rhel} == 7
2931
sed -i -e "s/install_requires=\['msgpack'\]/#/" setup.py
3032
%endif

0 commit comments

Comments
 (0)