1 |
commit: cb7eb2d9bba3a28ef8c241ab0e6c6a9caf959991 |
2 |
Author: Louis Sautier <sbraz <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Sep 9 11:23:38 2021 +0000 |
4 |
Commit: Louis Sautier <sbraz <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Sep 9 21:00:28 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cb7eb2d9 |
7 |
|
8 |
app-misc/rmlint: fix build and tests without native symlinks |
9 |
|
10 |
Closes: https://bugs.gentoo.org/812197 |
11 |
Signed-off-by: Louis Sautier <sbraz <AT> gentoo.org> |
12 |
|
13 |
app-misc/rmlint/files/rmlint-2.10.1-fix-cc.patch | 40 ++++++++++++++++++++++++ |
14 |
app-misc/rmlint/rmlint-2.10.1.ebuild | 4 ++- |
15 |
2 files changed, 43 insertions(+), 1 deletion(-) |
16 |
|
17 |
diff --git a/app-misc/rmlint/files/rmlint-2.10.1-fix-cc.patch b/app-misc/rmlint/files/rmlint-2.10.1-fix-cc.patch |
18 |
new file mode 100644 |
19 |
index 00000000000..78aac09ce2a |
20 |
--- /dev/null |
21 |
+++ b/app-misc/rmlint/files/rmlint-2.10.1-fix-cc.patch |
22 |
@@ -0,0 +1,40 @@ |
23 |
+commit 41056d132ae772b3c050020d68b7daa585e4143c |
24 |
+Author: Louis Sautier <sautier.louis@×××××.com> |
25 |
+Date: Thu Sep 9 13:29:37 2021 +0200 |
26 |
+ |
27 |
+ Never hardcode compiler, select it based on CC environment variable |
28 |
+ |
29 |
+diff --git a/SConstruct b/SConstruct |
30 |
+index 7e12d413..20b080da 100755 |
31 |
+--- a/SConstruct |
32 |
++++ b/SConstruct |
33 |
+@@ -37,8 +37,9 @@ Export('VERSION_MAJOR VERSION_MINOR VERSION_PATCH VERSION_NAME') |
34 |
+ def check_gcc_version(context): |
35 |
+ context.Message('Checking for GCC version... ') |
36 |
+ |
37 |
++ gcc = os.environ.get("CC", "gcc") |
38 |
+ try: |
39 |
+- v = subprocess.check_output("printf '%s\n' __GNUC__ | gcc -E -P -", shell=True) |
40 |
++ v = subprocess.check_output("printf '%s\n' __GNUC__ | {} -E -P -".format(gcc), shell=True) |
41 |
+ try: |
42 |
+ v = int(v) |
43 |
+ context.Result(str(v)) |
44 |
+diff --git a/tests/test_types/test_nonstripped.py b/tests/test_types/test_nonstripped.py |
45 |
+index a18648c9..d3190d1b 100644 |
46 |
+--- a/tests/test_types/test_nonstripped.py |
47 |
++++ b/tests/test_types/test_nonstripped.py |
48 |
+@@ -21,8 +21,12 @@ def create_binary(path, stripped=False): |
49 |
+ path = path + '.stripped' if stripped else path + '.nonstripped' |
50 |
+ full_path = os.path.join(TESTDIR_NAME, path) |
51 |
+ |
52 |
+- command = 'echo \'{src}\' | cc -o {path} {option} -std=c99 -xc -'.format( |
53 |
+- src=SOURCE, path=full_path, option=('-s' if stripped else '-ggdb3') |
54 |
++ cc = os.environ.get("CC", "cc") |
55 |
++ command = 'echo \'{src}\' | {cc} -o {path} {option} -std=c99 -xc -'.format( |
56 |
++ cc=cc, |
57 |
++ src=SOURCE, |
58 |
++ path=full_path, |
59 |
++ option=('-s' if stripped else '-ggdb3') |
60 |
+ ) |
61 |
+ subprocess.call(command, shell=True) |
62 |
+ |
63 |
|
64 |
diff --git a/app-misc/rmlint/rmlint-2.10.1.ebuild b/app-misc/rmlint/rmlint-2.10.1.ebuild |
65 |
index 11a0d0b2e17..aaa9a53dd04 100644 |
66 |
--- a/app-misc/rmlint/rmlint-2.10.1.ebuild |
67 |
+++ b/app-misc/rmlint/rmlint-2.10.1.ebuild |
68 |
@@ -68,6 +68,8 @@ PATCHES=( |
69 |
"${FILESDIR}/${PN}-2.10.1-skip-tests.patch" |
70 |
# https://github.com/sahib/rmlint/pull/523 |
71 |
"${FILESDIR}/${PN}-2.10.1-x86-fix-size.patch" |
72 |
+ # https://github.com/sahib/rmlint/pull/526 |
73 |
+ "${FILESDIR}/${PN}-2.10.1-fix-cc.patch" |
74 |
) |
75 |
|
76 |
src_prepare() { |
77 |
@@ -82,7 +84,7 @@ src_prepare() { |
78 |
|
79 |
src_configure() { |
80 |
# Needed for USE=-native-symlinks |
81 |
- tc-export CC |
82 |
+ tc-export AR CC |
83 |
scons_opts=( |
84 |
VERBOSE=1 |
85 |
$(use_with doc docs) |