diff --git a/komodo/build.py b/komodo/build.py index 0b3331e78..8278ab740 100644 --- a/komodo/build.py +++ b/komodo/build.py @@ -53,59 +53,6 @@ def dfs(package_name: str, pkg_order: List[str], visited: Set[str]): return pkg_order -# When running cmake we pass the option -DDEST_PREFIX=fakeroot, this is an -# absolute hack to be able to build opm-common and sunbeam with the ~fakeroot -# implementation used by komodo. -# -# See sunbeam/CMakeLists.txt for a more detailed description of the issue. -# When/if the opm project updates the generated opm-common-config.cmake to work -# with "make DESTDIR=" the DEST_PREFIX cmake flag can be removed. - - -def cmake( - package_name, - ver, - pkgpath, - prefix, - builddir, - makeopts, - jobs, - fakeroot, - ld_lib_path=None, - bin_path=None, - cmake="cmake", -): - bdir = f"{package_name}-{ver}-build" - if builddir is not None: - bdir = os.path.join(builddir, bdir) - - fakeprefix = fakeroot + prefix - - flags = [ - "-DCMAKE_BUILD_TYPE=Release", - f"-DBOOST_ROOT={fakeprefix}", - "-DBUILD_SHARED_LIBS=ON", - f"-DCMAKE_PREFIX_PATH={fakeprefix}", - f"-DCMAKE_MODULE_PATH={fakeprefix}/share/cmake/Modules", - f"-DCMAKE_INSTALL_PREFIX={prefix}", - f"-DDEST_PREFIX={fakeroot}", - ] - - Path(bdir).mkdir(parents=True, exist_ok=True) - with pushd(bdir): - os.environ["LD_LIBRARY_PATH"] = ld_lib_path - _pre_PATH = os.environ["PATH"] # pylint: disable=invalid-name - os.environ["PATH"] = bin_path - - print(f"Installing {package_name} ({ver}) from source with cmake") - shell([cmake, pkgpath, *flags, makeopts]) - print(shell(f"make -j{jobs}")) - print(shell(f"make DESTDIR={fakeroot} install")) - - del os.environ["LD_LIBRARY_PATH"] - os.environ["PATH"] = _pre_PATH - - def sh( package_name, ver, @@ -143,20 +90,6 @@ def sh( print(f"Installing {package_name} ({ver}) from sh") shell(cmd) - -def rsync(package_name, ver, pkgpath, prefix, fakeroot, makeopts=None): - print(f"Installing {package_name} ({ver}) with rsync") - # assume a root-like layout in the pkgpath dir, and just copy it - shell( - [ - "rsync -am", - makeopts, - f"{pkgpath}/", - fakeroot + prefix, - ], - ) - - def download(package_name, ver, prefix, url, hash_str, fakeroot, destination): print(f"Installing {package_name} ({ver}) with download") @@ -204,27 +137,6 @@ def download(package_name, ver, prefix, url, hash_str, fakeroot, destination): ) -def pip_install(package_name, ver, prefix, dlprefix, fakeroot, pip="pip", makeopts=""): - ver = strip_version(ver) - if ver == LATEST_PACKAGE_ALIAS: - ver = latest_pypi_version(package_name) - cmd = [ - pip, - f"install {package_name}=={strip_version(ver)}", - f"--root {fakeroot}", - f"--prefix {prefix}", - "--no-index", - "--no-deps", - "--ignore-installed", - f"--cache-dir {dlprefix}", - f"--find-links {dlprefix}", - makeopts, - ] - - print(f"Installing {package_name} ({ver}) from pip") - shell(cmd) - - def noop(package_name, ver): print(f"Doing nothing for noop package {package_name} ({ver})") @@ -317,30 +229,8 @@ def resolve(input_str): makeopts = f"{makeopts} {extra_makeopts}" makeopts = resolve(makeopts) - if make == "cmake": - cmake( - package_name=package_name, - ver=ver, - pkgpath=pkgpath, - prefix=prefix, - builddir=builddir, - makeopts=makeopts, - jobs=jobs, - fakeroot=fakeroot, - ld_lib_path=ld_lib_path, - bin_path=bin_path, - cmake=cmk, - ) - elif make == "pip": - pip_install( - package_name=package_name, - ver=ver, - prefix=prefix, - dlprefix=dlprefix, - fakeroot=fakeroot, - pip=pip, - makeopts=makeopts, - ) + if make == "pip": + continue elif make == "sh": sh( package_name=package_name, @@ -358,15 +248,6 @@ def resolve(input_str): cmake=cmk, makeopts=makeopts, ) - elif make == "rsync": - rsync( - package_name=package_name, - ver=ver, - pkgpath=pkgpath, - prefix=prefix, - fakeroot=fakeroot, - makeopts=makeopts, - ) elif make == "noop": noop(package_name=package_name, ver=ver) elif make == "download": diff --git a/komodo/cli.py b/komodo/cli.py index 3de887ed7..665838320 100755 --- a/komodo/cli.py +++ b/komodo/cli.py @@ -293,6 +293,7 @@ def install_previously_downloaded_pip_packages( str(release_root), "--no-index", "--no-deps", + "--compile", "--ignore-installed", # assuming fetch.py has done "pip download" to this directory: f"--cache-dir {downloads_directory}", diff --git a/komodo/data/setup-py.sh b/komodo/data/setup-py.sh index ac378bb62..596286f67 100755 --- a/komodo/data/setup-py.sh +++ b/komodo/data/setup-py.sh @@ -57,4 +57,5 @@ $PIP install $OPTS . \ --root $FAKEROOT \ --no-deps \ --no-cache-dir \ + --compile \ --prefix $PREFIX 1>&2