+
+ ;; XXX: The upstream 'patchelf' doesn't support ARM. The only available
+ ;; patch makes significant changes to the algorithm, possibly
+ ;; introducing bugs. So, we apply the patch only on ARM systems.
+ (inputs
+ (if (string-prefix? "arm" (or (%current-target-system) (%current-system)))
+ `(("patch/rework-for-arm" ,(search-patch
+ "patchelf-rework-for-arm.patch")))
+ '()))
+ (arguments
+ (if (string-prefix? "arm" (or (%current-target-system) (%current-system)))
+ `(#:phases (alist-cons-after
+ 'unpack 'patch/rework-for-arm
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((patch-file
+ (assoc-ref inputs "patch/rework-for-arm")))
+ (zero? (system* "patch" "--force" "-p1"
+ "--input" patch-file))))
+ %standard-phases))
+ '()))
+