x11/squeekboard: Unbreak with CARGO_BUILD_TARGET in the environment (D31872)

cp: ./release/librs.a: No such file or directory
Traceback (most recent call last):
  File "/wrkdirs/usr/ports/x11/squeekboard/work/squeekboard-8293c5f10dbd5c1fdb071e1f7e4a97a4cd52d592/cargo_build.py", line 45, in <module>
    subprocess.run(['cp', '-a',
  File "/usr/local/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['cp', '-a', './release/librs.a', PosixPath('/wrkdirs/usr/ports/x11/squeekboard/work/squeekboard-8293c5f10dbd5c1fdb071e1f7e4a97a4cd52d592/_build/src/librs.a')]' returned non-zero exit status 1.

http://package18.nyi.freebsd.org/data/122amd64-default-foo/2021-09-09_14h16m24s/logs/errors/squeekboard-1.14.0_2.log

PR:		258337
This commit is contained in:
Tobias Kortkamp 2021-09-10 18:59:48 +02:00
parent 60a8a08888
commit ee6d553d7b
No known key found for this signature in database
GPG key ID: A4F09FB73CC51F61

View file

@ -0,0 +1,19 @@
--- cargo_build.py.orig 2021-09-10 16:56:00 UTC
+++ cargo_build.py
@@ -6,6 +6,7 @@ instead of the source tree.
"""
from pathlib import Path
+import os
import shlex
import subprocess
import sys
@@ -43,7 +44,7 @@ if out_path:
out_basename = out_path.name
filename = filename or out_basename
subprocess.run(['cp', '-a',
- './{}/{}'.format(binary_dir, filename),
+ os.path.join('.', os.getenv('CARGO_BUILD_TARGET', ''), binary_dir, filename),
out_path],
check=True)