Skip to content

Commit

Permalink
unified package.py
Browse files Browse the repository at this point in the history
  • Loading branch information
anderslanglands committed Jul 3, 2022
1 parent 23b74f4 commit afad65a
Show file tree
Hide file tree
Showing 36 changed files with 1,045 additions and 755 deletions.
61 changes: 59 additions & 2 deletions alembic/1.8.3/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,63 @@
version = "1.8.3"

requires = ["imath"]
build_requires = ["cmake"]

variants = [["platform-windows", "arch-AMD64", "vs"]]
@early()
def build_requires():
import platform

if platform.system() == "Windows":
return ["cmake", "vs"]
else:
return ["cmake"]


@early()
def variants():
import os, ast

cook_variant = os.getenv("REZ_COOK_VARIANT")
if cook_variant:
# If we're building the package, we want to use the variant supplied to us
return [ast.literal_eval(cook_variant)]
else:
# Otherwise tell rez-cook what variants we are capable of building
return [
["platform-linux", "arch-x86_64", "cxx11abi", "cfg"],
["platform-windows", "arch-AMD64", "vs", "cfg"],
]



def commands():
import platform

env.ALEMBIC_ROOT = "{root}"
env.ALEMBIC_DIR = "{root}"
env.CMAKE_PREFIX_PATH.prepend("{root}")
env.PATH.prepend("{root}/bin")

if platform.system() == "Linux":
env.LD_LIBRARY_PATH.prepend("{root}/lib")


config_args = [
"cmake",
"{root}",
"-DCMAKE_INSTALL_PREFIX={install_path}",
"-DCMAKE_MODULE_PATH=$env:CMAKE_MODULE_PATH",
"-DCMAKE_BUILD_TYPE=Release",
"-DUSE_TESTS=OFF",
"-DUSE_PYALEMBIC=OFF",
" -G Ninja",
]

build_command = (
" ".join(config_args) + " && cmake --build . --target install --config Release"
)


def pre_cook():
download_and_unpack(
f"https://github.com/alembic/alembic/archive/refs/tags/{version}.zip"
)
28 changes: 25 additions & 3 deletions alembic/1.8.3/platform-windows/arch-AMD64/vs/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,45 @@
version = "1.8.3"

requires = ["imath"]
build_requires = ["cmake", "vs"]

@early()
def build_requires():
import platform

if platform.system() == "Windows":
return ["cmake", "vs"]
else:
return ["cmake"]


@early()
def variants():
import os, ast

variant = ast.literal_eval(os.getenv("REZ_COOK_VARIANT"))
return [variant]
cook_variant = os.getenv("REZ_COOK_VARIANT")
if cook_variant:
# If we're building the package, we want to use the variant supplied to us
return [ast.literal_eval(cook_variant)]
else:
# Otherwise tell rez-cook what variants we are capable of building
return [
["platform-linux", "arch-x86_64", "cxx11abi", "cfg"],
["platform-windows", "arch-AMD64", "vs", "cfg"],
]



def commands():
import platform

env.ALEMBIC_ROOT = "{root}"
env.ALEMBIC_DIR = "{root}"
env.CMAKE_PREFIX_PATH.prepend("{root}")
env.PATH.prepend("{root}/bin")

if platform.system() == "Linux":
env.LD_LIBRARY_PATH.prepend("{root}/lib")


config_args = [
"cmake",
Expand Down
56 changes: 54 additions & 2 deletions blosc/1.21.1/package.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,59 @@
name = "blosc"
version = "1.21.1"

build_requires = ["cmake", "vs"]

variants = [["platform-windows", "arch-AMD64", "vs"]]
@early()
def build_requires():
import platform

if platform.system() == "Windows":
return ["cmake", "vs"]
else:
return ["cmake"]


@early()
def variants():
import os, ast

cook_variant = os.getenv("REZ_COOK_VARIANT")
if cook_variant:
# If we're building the package, we want to use the variant supplied to us
return [ast.literal_eval(cook_variant)]
else:
# Otherwise tell rez-cook what variants we are capable of building
return [
["platform-linux", "arch-x86_64", "cxx11abi", "cfg"],
["platform-windows", "arch-AMD64", "vs", "cfg"],
]


def commands():
import platform

env.BLOSC_ROOT = "{root}"
env.CMAKE_PREFIX_PATH.prepend("{root}")
env.PATH.prepend("{root}/bin")

if platform.system():
env.LD_LIBRARY_PATH.prepend("{root}/lib")


config_args = [
"cmake",
"{root}",
"-DCMAKE_INSTALL_PREFIX={install_path}",
"-DCMAKE_MODULE_PATH=$env:CMAKE_MODULE_PATH",
"-DCMAKE_BUILD_TYPE=Release",
" -G Ninja",
]

build_command = (
" ".join(config_args) + " && cmake --build . --target install --config Release"
)


def pre_cook():
download_and_unpack(
f"https://github.com/Blosc/c-blosc/archive/refs/tags/v{version}.zip"
)
19 changes: 0 additions & 19 deletions blosc/1.21.1/platform-windows/arch-AMD64/vs/package.py

This file was deleted.

67 changes: 63 additions & 4 deletions boost/1.70.0/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,66 @@

requires = ["python<3.8"]

variants = [
["platform-linux", "arch-x86_64", "cxx11abi", "python", "cfg"],
["platform-windows", "arch-AMD64", "vs", "python", "cfg"],
]

@early()
def build_requires():
import platform

if platform.system() == "Windows":
return ["vs"]
else:
return []


@early()
def variants():
import os, ast

cook_variant = os.getenv("REZ_COOK_VARIANT")
if cook_variant:
# If we're building the package, we want to use the variant supplied to us
return [ast.literal_eval(cook_variant)]
else:
# Otherwise tell rez-cook what variants we are capable of building
return [
["platform-linux", "arch-x86_64", "cxx11abi", "python", "cfg"],
["platform-windows", "arch-AMD64", "vs", "python", "cfg"],
]


def commands():
import platform

env.Boost_ROOT = "{root}"
env.BOOST_ROOT = "{root}"
env.CMAKE_PREFIX_PATH.prepend("{root}")

if platform.system() == "Windows":
env.PATH.prepend("{root}/lib")
elif platform.system() == "Linux":
env.LD_LIBRARY_PATH.prepend("{root}/lib")


def pre_cook():
download_and_unpack(
f"https://boostorg.jfrog.io/artifactory/main/release/{version}/source/boost_{version.replace('.', '_')}.tar.bz2",
)


def env(var: str):
import platform

if platform.system() == "Windows":
return f"$env:{var}"
else:
return f"${var}"


@early()
def build_command():
import platform

if platform.system() == "Windows":
return f"cd $env:REZ_BUILD_SOURCE_PATH && ./bootstrap.bat && ./b2 install --prefix=\"$env:REZ_BUILD_INSTALL_PATH\" address-model=64 link=shared threading=multi --layout=system variant=\"$env:REZ_BUILD_CONFIG\" -d0"
else:
return f"cd $REZ_BUILD_SOURCE_PATH && ./bootstrap.sh --with-python=$Python_EXECUTABLE && ./b2 install --prefix=$REZ_BUILD_INSTALL_PATH address-model=64 link=shared threading=multi --layout=system variant=$REZ_BUILD_CONFIG -j$REZ_BUILD_THREAD_COUNT -d0"

This file was deleted.

32 changes: 0 additions & 32 deletions boost/1.70.0/platform-windows/arch-AMD64/vs/python/cfg/package.py

This file was deleted.

Loading

0 comments on commit afad65a

Please sign in to comment.