[bug#54635,4/5] gnu: atomic-queue: Do not depend on boost when cross-compiling.
Commit Message
* gnu/packages/cpp.scm (atomic-queue)[arguments]: When cross-compiling, add
do-not-check-for-boost phase and delete the build phase.
[native-inputs]: Do not include boost when cross-compiling.
---
gnu/packages/cpp.scm | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
Comments
Arun Isaac schreef op wo 30-03-2022 om 14:53 [+0530]:
> * gnu/packages/cpp.scm (atomic-queue)[arguments]: When cross-compiling, add
> do-not-check-for-boost phase and delete the build phase.
> [native-inputs]: Do not include boost when cross-compiling.
I think it's simpler and less tedious to just always include test
dependencies in native-inputs, without special-casing cross-
compilation. WYDT?
Also, being header-only does not per-se mean ‘no building’. E.g., what
if some of the headers are generated? I think it's a bit simpler and
less likely to cause trouble to just always run the build phase, even
if sometimes it is a no-op.
Greetings,
Maxime.
> I think it's simpler and less tedious to just always include test
> dependencies in native-inputs, without special-casing cross-
> compilation. WYDT?
Sure, agreed!
> Also, being header-only does not per-se mean ‘no building’. E.g., what
> if some of the headers are generated? I think it's a bit simpler and
> less likely to cause trouble to just always run the build phase, even
> if sometimes it is a no-op.
Agreed too!
Will address both in the next version of my patchset.
@@ -1294,6 +1294,21 @@ (define-public atomic-queue
`(#:configure-flags '("-Dbenchmarks=false")
#:phases
(modify-phases %standard-phases
+ ,@(if (%current-target-system)
+ `(;; boost is a test dependency. We don't run tests when
+ ;; cross-compiling. So, do not check for it.
+ (add-after 'unpack 'do-not-check-for-boost
+ (lambda _
+ (substitute* "meson.build"
+ (("unit_test_framework =" all)
+ (string-append "# " all))
+ ((", unit_test_framework") ""))))
+ ;; atomic-queue is a header-only library. Excepting the
+ ;; tests, no building is required. And since we don't run
+ ;; tests when cross-compiling, delete the build phase
+ ;; entirely.
+ (delete 'build))
+ '())
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
(when tests?
@@ -1303,9 +1318,11 @@ (define-public atomic-queue
(copy-recursively "../source/include/atomic_queue"
(string-append (assoc-ref outputs "out")
"/include/atomic_queue")))))))
- (native-inputs
- (list boost
- pkg-config))
+ (native-inputs
+ (cons pkg-config
+ (if (%current-target-system)
+ '()
+ (list boost))))
(home-page "https://github.com/max0x7ba/atomic_queue")
(synopsis "C++ lockless queue")
(description