From ca7a630e20b634baf7f70bb0a799becd4117e04f Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Thu, 3 Jan 2019 09:39:45 -0600 Subject: [PATCH] kits/package: Break LibsolvSolver add-on out * BSolver is implemented by solver add-ons * We may want to (unlikely) leverage another package solver in the future. * We may want to (likely) implement a dummy solver when libsolv is unavailable on new architectures without bootstrap. * This also makes solving missing libsolv a little more graceful vs the "include "libsolv.h" not found. Change-Id: Iedd9d0f022fb743c4c7606bd33a4b6dbef0576f7 Reviewed-on: https://review.haiku-os.org/c/haiku/+/819 Reviewed-by: Adrien Destugues --- src/build/libpackage/solver/Jamfile | 3 +- src/kits/package/Jamfile | 4 --- src/kits/package/solver/Jamfile | 35 ++----------------- src/kits/package/solver/libsolv/Jamfile | 34 ++++++++++++++++++ .../solver/{ => libsolv}/LibsolvSolver.cpp | 0 .../solver/{ => libsolv}/LibsolvSolver.h | 0 .../solver/{ => libsolv}/LibsolvSolver.rdef | 0 7 files changed, 37 insertions(+), 39 deletions(-) create mode 100644 src/kits/package/solver/libsolv/Jamfile rename src/kits/package/solver/{ => libsolv}/LibsolvSolver.cpp (100%) rename src/kits/package/solver/{ => libsolv}/LibsolvSolver.h (100%) rename src/kits/package/solver/{ => libsolv}/LibsolvSolver.rdef (100%) diff --git a/src/build/libpackage/solver/Jamfile b/src/build/libpackage/solver/Jamfile index 51e83eefea..d8d9e36066 100644 --- a/src/build/libpackage/solver/Jamfile +++ b/src/build/libpackage/solver/Jamfile @@ -10,7 +10,7 @@ UsePrivateHeaders shared ; USES_BE_API on libpackage-add-on-libsolv_build.so = true ; SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src kits package solver ] ; - +SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src kits package solver libsolv ] ; MakeLocate libpackage-add-on-libsolv_build.so : $(HOST_BUILD_COMPATIBILITY_LIB_DIR) ; @@ -24,6 +24,5 @@ BuildPlatformSharedLibrary libpackage-add-on-libsolv_build.so libbe_build.so $(HOST_LIBSTDC++) ; - Includes [ FGristFiles LibsolvSolver.cpp ] : [ BuildFeatureAttribute libsolv : headers ] ; diff --git a/src/kits/package/Jamfile b/src/kits/package/Jamfile index 9eb761ebe4..b4d2dce13a 100644 --- a/src/kits/package/Jamfile +++ b/src/kits/package/Jamfile @@ -71,10 +71,6 @@ for architectureObject in [ MultiArchSubDirSetup ] { SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src kits package manager ] ; SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src kits package solver ] ; - AddResources $(libsolv) : - LibsolvSolver.rdef - ; - SharedLibrary [ MultiArchDefaultGristFiles libpackage.so ] : ActivateRepositoryCacheJob.cpp diff --git a/src/kits/package/solver/Jamfile b/src/kits/package/solver/Jamfile index e4e75c28f6..004c374f85 100644 --- a/src/kits/package/solver/Jamfile +++ b/src/kits/package/solver/Jamfile @@ -1,41 +1,10 @@ SubDir HAIKU_TOP src kits package solver ; -# add-on implementing a libsolv based BSolver - -local architectureObject ; -for architectureObject in [ MultiArchSubDirSetup ] { - on $(architectureObject) { - - UseBuildFeatureHeaders libsolv ; - - local libsolvHeaders - = [ BuildFeatureAttribute libsolv : headers : path ] ; - UseHeaders [ FDirName $(libsolvHeaders) solv ] ; - - AddResources $(libsolv) : - LibsolvSolver.rdef - ; - - UsePrivateHeaders shared ; - - SharedLibrary - [ MultiArchDefaultGristFiles libpackage-add-on-libsolv.so ] - : - LibsolvSolver.cpp - : - package - [ BuildFeatureAttribute libsolv : libraries ] - be [ TargetLibstdc++ ] - ; - - Includes [ FGristFiles LibsolvSolver.cpp ] - : [ BuildFeatureAttribute libsolv : headers ] ; - } -} - DoCatalogs libsolv : x-vnd.Haiku-libsolvsolver : SolverProblem.cpp SolverProblemSolution.cpp ; + +HaikuSubInclude libsolv ; diff --git a/src/kits/package/solver/libsolv/Jamfile b/src/kits/package/solver/libsolv/Jamfile new file mode 100644 index 0000000000..67a673ebd5 --- /dev/null +++ b/src/kits/package/solver/libsolv/Jamfile @@ -0,0 +1,34 @@ +SubDir HAIKU_TOP src kits package solver libsolv ; + +# add-on implementing a libsolv based BSolver + +local architectureObject ; +for architectureObject in [ MultiArchSubDirSetup ] { + on $(architectureObject) { + + UseBuildFeatureHeaders libsolv ; + + local libsolvHeaders + = [ BuildFeatureAttribute libsolv : headers : path ] ; + UseHeaders [ FDirName $(libsolvHeaders) solv ] ; + + AddResources $(libsolv) : + LibsolvSolver.rdef + ; + + UsePrivateHeaders shared ; + + SharedLibrary + [ MultiArchDefaultGristFiles libpackage-add-on-libsolv.so ] + : + LibsolvSolver.cpp + : + package + [ BuildFeatureAttribute libsolv : libraries ] + be [ TargetLibstdc++ ] + ; + + Includes [ FGristFiles LibsolvSolver.cpp ] + : [ BuildFeatureAttribute libsolv : headers ] ; + } +} diff --git a/src/kits/package/solver/LibsolvSolver.cpp b/src/kits/package/solver/libsolv/LibsolvSolver.cpp similarity index 100% rename from src/kits/package/solver/LibsolvSolver.cpp rename to src/kits/package/solver/libsolv/LibsolvSolver.cpp diff --git a/src/kits/package/solver/LibsolvSolver.h b/src/kits/package/solver/libsolv/LibsolvSolver.h similarity index 100% rename from src/kits/package/solver/LibsolvSolver.h rename to src/kits/package/solver/libsolv/LibsolvSolver.h diff --git a/src/kits/package/solver/LibsolvSolver.rdef b/src/kits/package/solver/libsolv/LibsolvSolver.rdef similarity index 100% rename from src/kits/package/solver/LibsolvSolver.rdef rename to src/kits/package/solver/libsolv/LibsolvSolver.rdef