summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-03-24 22:34:09 +0100
committerCarl Hetherington <cth@carlh.net>2024-03-24 22:34:10 +0100
commit4bd13cdb881cb3072b002f40f61fcaf4c9a8f893 (patch)
treedc6b487d4ec1688c7585afcb23d8171c1a7a04d0
parentb8a7a0cd31c5f956627af698ebd15f4f418a5609 (diff)
Add LocalTarget, which isn't really that helpful actually.
You end up needing to delete things from /usr/local so they don't get picked up by "local" builds.
-rwxr-xr-xcdist19
1 files changed, 19 insertions, 0 deletions
diff --git a/cdist b/cdist
index 4faa300..637c5a5 100755
--- a/cdist
+++ b/cdist
@@ -910,6 +910,23 @@ class SourceTarget(Target):
zstd = os.path.abspath('%s-%s.tar.zst' % (name, tree.version))
copyfile(zstd, os.path.join(output_dir, os.path.basename(devel_to_git(tree.commit, zstd))))
+
+class LocalTarget(Target):
+ """Build on the local machine with its environment"""
+ def __init__(self, work):
+ super(LocalTarget, self).__init__('local', work)
+ # Hack around ffmpeg.git which sees that the target isn't windows/osx and then assumes
+ # distro will be there.
+ self.distro = None
+ self.set('PKG_CONFIG_PATH', '%s/lib/pkgconfig:%s/bin/pkgconfig' % (self.directory, self.directory))
+
+ def command(self, c):
+ log_normal('host -> %s' % c)
+ command('%s %s' % (self.variables_string(), c))
+
+ def cleanup(self):
+ rmtree(self.directory)
+
# @param s Target string:
# windows-{32,64}
# or ubuntu-version-{32,64}
@@ -956,6 +973,8 @@ def target_factory(args):
target = FlatpakTarget(args.project, args.checkout, args.work)
elif s == 'appimage':
target = AppImageTarget(args.work)
+ elif s == 'local':
+ target = LocalTarget(args.work)
if target is None:
raise Error("Bad target `%s'" % s)