Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
chromebrew
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
chromebrew
Commits
0f4d5d2b
Commit
0f4d5d2b
authored
Jan 19, 2018
by
Ed Reel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow -j# overrides in lib/package.rb
Remove environment variable logic
parent
a81480c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
7 deletions
+28
-7
lib/package.rb
lib/package.rb
+28
-7
No files found.
lib/package.rb
View file @
0f4d5d2b
...
...
@@ -101,21 +101,42 @@ class Package
end
def
self
.
system
(
*
args
)
# add "-j#{CREW_NPROC}" argument to "make" at only compile-time
# add "-j#" argument to "make" at compile-time, if necessary
# Order of precendence to assign the number of processors:
# 1. The value of '-j#' from the package make argument
# 2. The value of ENV["CREW_NPROC"]
# 3. The value of `nproc`.strip
# See lib/const.rb for more details
if
@in_build
==
true
nproc
=
''
nproc_opt
=
''
args
.
each
do
|
arg
|
params
=
arg
.
split
(
/\W+/
)
params
.
each
do
|
param
|
if
param
.
match
(
/j(\d)+/
)
nproc_opt
=
param
break
end
end
end
nproc
=
"
#{
CREW_NPROC
}
"
if
nproc_opt
==
''
if
args
[
0
]
==
"make"
# modify ["make", "args", ...] into ["make", "-j#{CREW_NPROC}", "args", ...]
# modify ["make", "args", ...] into ["make", "-j#{nproc}", "args", ...]
args
.
insert
(
1
,
"-j
#{
nproc
}
"
)
if
nproc
!=
''
if
@opt_verbose
then
args
.
insert
(
1
,
"
-j
#{
CREW_NPROC
}
"
,
"
V=1"
)
args
.
insert
(
1
,
"V=1"
)
else
args
.
insert
(
1
,
"
-j
#{
CREW_NPROC
}
"
,
"
V=0"
)
args
.
insert
(
1
,
"V=0"
)
end
elsif
args
.
length
==
1
# modify ["make args..."] into ["make -j#{CREW_NPROC} args..."]
# modify ["make args..."] into ["make -j#{nproc} args..."]
args
[
0
].
gsub!
(
/^make /
,
"make -j
#{
nproc
}
"
)
if
nproc
!=
''
if
@opt_verbose
then
args
[
0
].
gsub!
(
/^make /
,
"make
-j
#{
CREW_NPROC
}
V=1 "
)
args
[
0
].
gsub!
(
/^make /
,
"make V=1 "
)
else
args
[
0
].
gsub!
(
/^make /
,
"make
-j
#{
CREW_NPROC
}
V=0 "
)
args
[
0
].
gsub!
(
/^make /
,
"make V=0 "
)
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment