Source: uhub
Version: 0.4.1-3.2
Severity: normal
Tags: ftbfs patch
Justification: fails to build from source (but built successfully in the past)
X-Debbugs-Cc: i...@hack3r.moe

Dear maintainer,

uhub failed to build on riscv64 due to missing `CPUINFO` macro in src/system.h:

```
[ 67%] Building C object CMakeFiles/uhub.dir/src/core/config.c.o
/usr/bin/cc -DSSL_SUPPORT=1 -DSSL_USE_OPENSSL=1 -I/<<PKGBUILDDIR>>/src -g -O2 
-ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat 
-Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wdate-time 
-D_FORTIFY_SOURCE=2 -O3 -DNDEBUG -MD -MT 
CMakeFiles/uhub.dir/src/core/config.c.o -MF 
CMakeFiles/uhub.dir/src/core/config.c.o.d -o 
CMakeFiles/uhub.dir/src/core/config.c.o -c /<<PKGBUILDDIR>>/src/core/config.c
/<<PKGBUILDDIR>>/src/core/commands.c: In function ‘command_version’:
/<<PKGBUILDDIR>>/src/core/commands.c:395:86: error: expected ‘)’ before 
‘CPUINFO’
  395 |                 buf = cbuf_create_const("Powered by " PRODUCT_STRING " 
on " OPSYS "/" CPUINFO);
      |                                        ~                                
             ^~~~~~~~
      |                                                                         
             )
make[3]: *** [CMakeFiles/uhub.dir/build.make:121: 
CMakeFiles/uhub.dir/src/core/commands.c.o] Error 1
make[3]: *** Waiting for unfinished jobs....
```

Full buildd log: 
https://buildd.debian.org/status/fetch.php?pkg=uhub&arch=riscv64&ver=0.4.1-3.2&stamp=1663851167&raw=0

Attached is a patch that adds RISC-V architecture to system.h and fixes FTBFS.
Please let me know if more help is needed.

Best regards,
Eric
Description: Add RISC-V architecture to CPU list
Author: Eric Long <i...@hack3r.moe>
Last-Update: 2022-09-30
--- a/src/system.h
+++ b/src/system.h
@@ -242,6 +242,10 @@
 #define CPUINFO "s390"
 #endif
 
+#if defined(__riscv)
+#define CPUINFO "RISC-V"
+#endif
+
 /* Misc */
 #ifdef MSG_NOSIGNAL
 #define UHUB_SEND_SIGNAL MSG_NOSIGNAL

Reply via email to