diff options
-rwxr-xr-x | scripts/spmbuild | 9 | ||||
-rw-r--r-- | src/install.c | 13 | ||||
-rw-r--r-- | src/resolve.c | 2 | ||||
-rw-r--r-- | src/rpath.c | 13 |
4 files changed, 32 insertions, 5 deletions
diff --git a/scripts/spmbuild b/scripts/spmbuild index c600703..01ba947 100755 --- a/scripts/spmbuild +++ b/scripts/spmbuild @@ -158,13 +158,17 @@ function spm_build_initialize_stage2() { function spm_build_cleanup() { #: + if [[ ${keep} != 0 ]]; then + echo "Temporary storage not destroyed" + return + fi [[ -d ${SPM_BUILD_ROOT_BASE} ]] && rm -rf ${SPM_BUILD_ROOT_BASE} [[ -d ${SPM_BUILD_RUNTIME_BASE} ]] && rm -rf ${SPM_BUILD_RUNTIME_BASE} [[ -d ${SPM_BUILD_PKGDIR_BASE} ]] && rm -rf ${SPM_BUILD_PKGDIR_BASE} } function spm_build_install() { - ${SPM} --yes --override-manifests --manifest "${SPM_BUILD_STORE_PACKAGES}" --install $@ --root "${SPM_BUILD_RUNTIME}" + ${SPM} --verbose --yes --override-manifests --manifest "${SPM_BUILD_STORE_PACKAGES}" --install $@ --root "${SPM_BUILD_RUNTIME}" } function spm_build_mkprefixbin() { @@ -336,6 +340,7 @@ function spm_build_do_stage_archive() { } # -- main -- +export keep=${keep:-0} export SPM_BUILD_SCRIPT="build.sh" export SPM_BUILD_SCRIPT_ROOT="$1" @@ -362,6 +367,8 @@ package_final="${package_target}/${package_archive}" if [[ ! -d "${package_target}" ]]; then mkdir -p ${package_target} + spm_build_mkmanifest "${package_target}" "${package_target}" + fi msg2 "Downloading source files..." diff --git a/src/install.c b/src/install.c index a6b76ca..0858c5c 100644 --- a/src/install.c +++ b/src/install.c @@ -231,8 +231,19 @@ int spm_do_install(SPM_Hierarchy *fs, ManifestList *mf, StrList *packages) { int fetched = 0; char *package_dir = strdup(SPM_GLOBAL.package_dir); for (size_t i = 0; requirements != NULL && requirements[i] != NULL; i++) { - char *package_path = join((char *[]) {requirements[i]->origin, requirements[i]->archive, NULL}, DIRSEPS); + char *package_origin = calloc(PATH_MAX, sizeof(char)); + strncpy(package_origin, requirements[i]->origin, PATH_MAX); + + if (strstr(package_origin, SPM_GLOBAL.repo_target) == NULL) { + if (!endswith(package_origin, DIRSEPS)) { + strcat(package_origin, DIRSEPS); + } + strcat(package_origin, SPM_GLOBAL.repo_target); + } + + char *package_path = join((char *[]) {package_origin, requirements[i]->archive, NULL}, DIRSEPS); char *package_localpath = join_ex(DIRSEPS, package_dir, requirements[i]->archive, NULL); + free(package_origin); // Download the archive if necessary if (strstr(package_path, "://") != NULL && exists(package_localpath) != 0) { diff --git a/src/resolve.c b/src/resolve.c index ef1f15b..0f6dfc0 100644 --- a/src/resolve.c +++ b/src/resolve.c @@ -30,7 +30,7 @@ ManifestPackage **resolve_dependencies(ManifestList *manifests, const char *spec ManifestPackage *package = manifestlist_search(manifests, spec); ManifestPackage *requirement = NULL; if (package == NULL) { - return NULL; + return requirements; } for (size_t i = 0; i < package->requirements_records && i < SPM_REQUIREMENT_MAX; i++) { diff --git a/src/rpath.c b/src/rpath.c index 42a4c07..fbfdb18 100644 --- a/src/rpath.c +++ b/src/rpath.c @@ -209,6 +209,7 @@ char *rpath_autodetect(const char *filename) { char *start = realpath(rootdir, NULL); char *cwd = realpath(".", NULL); char *result = NULL; + int multilib_os = (exists("/lib64") == 0); // Change directory to the requested root chdir(start); @@ -228,7 +229,11 @@ char *rpath_autodetect(const char *filename) { } // Using the current visit path, check if it contains a lib directory - char *path = join((char *[]) {visit, "lib", NULL}, DIRSEPS); + char *path = NULL; + if (multilib_os) + path = join((char *[]) {visit, "lib64", NULL}, DIRSEPS); + else + path = join((char *[]) {visit, "lib", NULL}, DIRSEPS); if (access(path, F_OK) == 0) { // Check whether the lib directory contains one of `filename`'s libraries @@ -248,7 +253,11 @@ char *rpath_autodetect(const char *filename) { // Stop processing when a good lib directory is found if (has_real_libdir != 0) { - strcat(relative, "lib"); + if (multilib_os) { + strcat(relative, "lib64"); + } else { + strcat(relative, "lib"); + } free(path); free(visit); break; |