Source: ndctl
Version: 73-1
Tags: patch
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

ndctl regressed cross building. It added a meson check using cc.runs to
test for typeof. Such tests make cross builds fail. However, the test
can be easily rewritten as a compile check. Beyond that, debian/rules
confuses the terms "build" and "host". Please refer to man
dpkg-architecture for their definitions. I'm attaching a patch that
fixes both for your convenience.

Helmut
diff --minimal -Nru ndctl-74/debian/changelog ndctl-74/debian/changelog
--- ndctl-74/debian/changelog   2022-08-24 12:53:47.000000000 +0200
+++ ndctl-74/debian/changelog   2022-09-10 06:31:41.000000000 +0200
@@ -1,3 +1,12 @@
+ndctl (74-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + cross.patch: Avoid an unnecessary compiler run test.
+    + Fix confusion of build and host.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Sat, 10 Sep 2022 06:31:41 +0200
+
 ndctl (74-1) unstable; urgency=medium
 
   * New upstream release.
diff --minimal -Nru ndctl-74/debian/patches/cross.patch 
ndctl-74/debian/patches/cross.patch
--- ndctl-74/debian/patches/cross.patch 1970-01-01 01:00:00.000000000 +0100
+++ ndctl-74/debian/patches/cross.patch 2022-09-10 06:31:39.000000000 +0200
@@ -0,0 +1,26 @@
+--- ndctl-74.orig/meson.build
++++ ndctl-74/meson.build
+@@ -231,19 +231,18 @@
+ conf.set('ENABLE_LOGGING', get_option('logging').enabled())
+ conf.set('ENABLE_DEBUG', get_option('dbg').enabled())
+ 
+-typeof = cc.run('''
+-  int main() {
++typeof_code = '''
++  void func() {
+     struct {
+       char a[16];
+     } x;
+     typeof(x) y;
+ 
+-    return sizeof(x) == sizeof(y);
++    char static_assert[2 * (sizeof(x) == sizeof(y)) - 1];
+   }
+   '''
+-)
+ 
+-if typeof.compiled() and typeof.returncode() == 1
++if cc.compiles(typeof_code)
+   conf.set('HAVE_TYPEOF', 1)
+   conf.set('HAVE_STATEMENT_EXPR', 1)
+ endif
diff --minimal -Nru ndctl-74/debian/patches/series 
ndctl-74/debian/patches/series
--- ndctl-74/debian/patches/series      1970-01-01 01:00:00.000000000 +0100
+++ ndctl-74/debian/patches/series      2022-09-10 06:25:33.000000000 +0200
@@ -0,0 +1 @@
+cross.patch
diff --minimal -Nru ndctl-74/debian/rules ndctl-74/debian/rules
--- ndctl-74/debian/rules       2022-08-24 12:21:41.000000000 +0200
+++ ndctl-74/debian/rules       2022-09-10 06:31:41.000000000 +0200
@@ -27,7 +27,7 @@
        dh_installinit -p ndctl --init-script=ndctl-monitor
 
 override_dh_install:
-       mv debian/tmp/usr/$(DEB_BUILD_MULTIARCH)/* 
debian/tmp/usr/lib/$(DEB_BUILD_MULTIARCH)/
+       mv debian/tmp/usr/$(DEB_HOST_MULTIARCH)/* 
debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/
        dh_install
 
 override_dh_makeshlibs:

Reply via email to