Skip to content

Commit

Permalink
More polish, adds pipz
Browse files Browse the repository at this point in the history
  • Loading branch information
boberfly committed Jun 24, 2019
1 parent d4af011 commit 9908857
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 9 deletions.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ FROM centos:7

RUN yum install -y centos-release-scl && \
yum install -y devtoolset-6 && \
yum install -y epel-release && \
yum install -y patch && \
yum install -y epel-release
RUN yum install -y patch && \
yum install -y wget && \
yum install -y curl && \
yum install -y nano && \
yum install -y zip
yum install -y zip && \
yum install -y git

# Copy over build script and set an entry point that
# will use the compiler we want.
Expand Down
22 changes: 18 additions & 4 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,13 @@ def releaseId() :

# Perform the build.

pythonEnvs = "PYTHONHOME=/install/{platform} PYTHONPATH=/install/{platform}/lib/python2.7 LD_LIBRARY_PATH=/install/{platform}/lib".format( **formatVariables )
pythonEnvs = "REZ_CONFIG_FILE=/tmp/myrezconfig.py PATH=/install/{platform}/bin:$PATH PYTHONHOME=/install/{platform} PYTHONPATH=/install/{platform}/lib/python2.7 LD_LIBRARY_PATH=/install/{platform}/lib".format( **formatVariables )

depCommands = [
"curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py",
"python get-pip.py".format( env=pythonEnvs, **formatVariables ),
"pip install cmake".format( env=pythonEnvs, **formatVariables ),
"python get-pip.py",
"pip install cmake",
"git clone https://github.com/mottosso/rez-pipz.git",
"cmake -E make_directory install/{platform}".format( **formatVariables ),

"cd dependencies && "
Expand All @@ -229,11 +230,24 @@ def releaseId() :
"cd /install/{platform}/bin && {env} ./python /get-pip.py".format( env=pythonEnvs, **formatVariables ),
"cd /install/{platform}/bin && {env} ./pip install bleeding-rez --pre".format( env=pythonEnvs, **formatVariables ),
"cd /install/{platform}/bin && /fix-shebang rez* pip _rez* bez easy_install wheel".format( **formatVariables ),
"mv /run /install/{platform}/run".format( **formatVariables ),
"mv /run /install/{platform}/run && "
"mkdir /install/{platform}/packages".format( **formatVariables ),

"rm -f /install/{platform}/lib/python2.7/config/libpython2.7.a".format( **formatVariables ),
"cd /install/{platform}/bin && mv python rezpy && "
"rm -f python2.7 python2 && ln -s rezpy rezpy2 && ln -s rezpy rezpy2.7".format( **formatVariables ),

"echo 'packages_path = [\"/install/{platform}/packages\"]' > /tmp/myrezconfig.py".format( **formatVariables ),
"cd /install/{platform}/bin && "
"{env} ./rez bind -i /install/{platform}/packages platform && "
"{env} ./rez bind -i /install/{platform}/packages arch && "
"{env} ./rez bind -i /install/{platform}/packages os".format( env=pythonEnvs, **formatVariables ),
"mv /python /install/{platform}/packages/ && "
"cd /install/{platform}/packages/python/2.7.16/platform-linux/arch-x86_64/bin && ln -s ../../../../../../bin/rezpy python && rm .keepme && "
"cd /install/{platform}/packages/python/2.7.16/platform-linux/arch-x86_64/python && ln -s ../../../../../../lib/python2.7 lib && rm .keepme && "
"cd /install/{platform}/packages/python/2.7.16/platform-linux/arch-x86_64/python && ln -s ../../../../../../lib/python2.7/site-packages extra && "
"cd /rez-pipz && {env} PYTHONHTTPSVERIFY=0 /install/{platform}/bin/rez build --install -p /install/{platform}/packages".format( env=pythonEnvs, **formatVariables ),

"cd /install/{platform} && "
"rm -f bin/openssl && "
"rm -rf ssl && rm -rf share && "
Expand Down
2 changes: 2 additions & 0 deletions dependencies/Python/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
" -D Py_UNICODE_SIZE=4"
" -D USE_LIB64=OFF"
" -D INSTALL_TEST=OFF"
" -D OPENSSL_INCLUDE_DIR={buildDir}/include"
" -D OPENSSL_LIBRARIES={buildDir}/libcrypto.a {buildDir}/libssl.a"
" ..",
"cd build && cmake --build . --config {cmakeBuildType} --target install -- -j {jobs}",
"cmake -E copy ./Python-2.7.16/LICENSE {buildDir}/doc/licenses/Python",
Expand Down
24 changes: 24 additions & 0 deletions scripts/python/2.7.16/package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-

name = 'python'

version = 'rezpy-2.7.16'

tools = ['python']

variants = [['platform-linux', 'arch-x86_64']]

def commands():
env.PATH.append('{this.root}/bin')

def post_commands():
# these are the builtin modules for this python executable. If we don't
# include these, some python behavior can be incorrect.
import os, os.path

path = os.path.join(this.root, "python")
for dirname in os.listdir(path):
path_ = os.path.join(path, dirname)
env.PYTHONPATH.append(path_)

format_version = 2
Empty file.
Empty file.
4 changes: 2 additions & 2 deletions scripts/run
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash

echo 'packages_path = ["~/packages", "'$(dirname $0)'/packages"]' > /tmp/myrezconfig.py
REZ_CONFIG_FILE=/tmp/myrezconfig.py PATH=`dirname $0`/bin:$PATH x-terminal-emulator
echo 'packages_path = ["~/packages", "'$(dirname $(readlink -f $0))'/packages"]' > /tmp/myrezconfig.py
REZ_CONFIG_FILE=/tmp/myrezconfig.py PATH=`dirname $(readlink -f $0)`/bin:$PATH x-terminal-emulator

0 comments on commit 9908857

Please sign in to comment.