Skip to content

Commit

Permalink
Proton support
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin PARIS committed Jan 4, 2019
1 parent 8abf710 commit 65c1ed1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 13 additions & 2 deletions core/Container.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def __init__(self, environment):
self.environment = environment
self._logfile = None
self._output_callback = lambda line: print(line, end='')
self.containerEnvironmentVariables = {}
self.with_docker_client(DockerClient.from_env())

def with_output_callback(self, output_callback):
Expand All @@ -37,6 +38,9 @@ def start(self):
self.container = self.docker_client.client.containers.run(self.environment.full_name(), detach=True,
stdin_open=True, tty=True)

def env(self, key, value):
self.containerEnvironmentVariables[key] = value

def run(self, command, workdir=None):
buffer = LineBuffer()

Expand All @@ -60,8 +64,15 @@ def do_output(chunk):

try:
resp = self.docker_client.api_client.exec_create(
self.container.id, command, stdout=True, stderr=True, stdin=False, tty=False,
privileged=True, user='', environment=None,
self.container.id,
command,
stdout=True,
stderr=True,
stdin=False,
tty=False,
privileged=True,
user='',
environment=self.containerEnvironmentVariables,
workdir=workdir
)
exec_output = self.docker_client.api_client.exec_start(
Expand Down
2 changes: 1 addition & 1 deletion hooks/proton/AddProtonIncludes.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ def event(self):

def patch(self, container, operating_system, arch, version, distribution):
container.run(["git", "clone", "--progress", "https://github.com/ValveSoftware/Proton/", "/root/proton"])
container.run(["export", "C_INCLUDE_PATH=/root/proton/contrib/include"])
container.env("C_INCLUDE_PATH", "/root/proton/contrib/include")

0 comments on commit 65c1ed1

Please sign in to comment.