xbps-create: added --build-options option, mainly for xbps-src.

This expects a string with the list of used build options.
This commit is contained in:
Juan RP 2013-03-23 08:18:06 +01:00
parent 8d6f3b5029
commit 59006fe86c
3 changed files with 18 additions and 4 deletions

4
NEWS
View File

@ -1,5 +1,9 @@
xbps-0.22 (???): xbps-0.22 (???):
* xbps-create(8): a new option --build-options has been added to add a string
with the build options that were used in package. It's expected to be filled
by xbps-src automatically.
* xbps-query(8): make -o (ownedby) follow symlinks. Fix issue #4 from github. * xbps-query(8): make -o (ownedby) follow symlinks. Fix issue #4 from github.
This works in local and repository mode. This works in local and repository mode.

View File

@ -1,5 +1,5 @@
/*- /*-
* Copyright (c) 2012 Juan Romero Pardines. * Copyright (c) 2012-2013 Juan Romero Pardines.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -90,6 +90,7 @@ usage(void)
" -S --long-desc Long description (80 cols per line).\n" " -S --long-desc Long description (80 cols per line).\n"
" -s --desc Short description (max 80 characters).\n" " -s --desc Short description (max 80 characters).\n"
" -V --version Prints XBPS release version.\n" " -V --version Prints XBPS release version.\n"
" --build-options A string with the used build options.\n"
" --shlib-provides List of provided shared libraries (blank separated list,\n" " --shlib-provides List of provided shared libraries (blank separated list,\n"
" e.g 'libfoo.so.1 libblah.so.2').\n" " e.g 'libfoo.so.1 libblah.so.2').\n"
" --shlib-requires List of required shared libraries (blank separated list,\n" " --shlib-requires List of required shared libraries (blank separated list,\n"
@ -576,6 +577,7 @@ main(int argc, char **argv)
{ "version", no_argument, NULL, 'V' }, { "version", no_argument, NULL, 'V' },
{ "shlib-provides", required_argument, NULL, '0' }, { "shlib-provides", required_argument, NULL, '0' },
{ "shlib-requires", required_argument, NULL, '1' }, { "shlib-requires", required_argument, NULL, '1' },
{ "build-options", required_argument, NULL, '2' },
{ NULL, 0, NULL, 0 } { NULL, 0, NULL, 0 }
}; };
struct archive *ar; struct archive *ar;
@ -585,7 +587,7 @@ main(int argc, char **argv)
const char *conflicts, *deps, *homepage, *license, *maint, *bwith; const char *conflicts, *deps, *homepage, *license, *maint, *bwith;
const char *provides, *pkgver, *replaces, *desc, *ldesc; const char *provides, *pkgver, *replaces, *desc, *ldesc;
const char *arch, *config_files, *mutable_files, *version; const char *arch, *config_files, *mutable_files, *version;
const char *shlib_provides, *shlib_requires; const char *buildopts, *shlib_provides, *shlib_requires;
const char *srcrevs = NULL; const char *srcrevs = NULL;
char *pkgname, *binpkg, *tname, *p, cwd[PATH_MAX-1]; char *pkgname, *binpkg, *tname, *p, cwd[PATH_MAX-1];
bool quiet = false, preserve = false; bool quiet = false, preserve = false;
@ -593,7 +595,7 @@ main(int argc, char **argv)
mode_t myumask; mode_t myumask;
arch = conflicts = deps = homepage = license = maint = NULL; arch = conflicts = deps = homepage = license = maint = NULL;
provides = pkgver = replaces = desc = ldesc = bwith = NULL; provides = pkgver = replaces = desc = ldesc = bwith = buildopts = NULL;
config_files = mutable_files = shlib_provides = shlib_requires = NULL; config_files = mutable_files = shlib_provides = shlib_requires = NULL;
while ((c = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1) { while ((c = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1) {
@ -664,6 +666,9 @@ main(int argc, char **argv)
case '1': case '1':
shlib_requires = optarg; shlib_requires = optarg;
break; break;
case '2':
buildopts = optarg;
break;
case '?': case '?':
default: default:
usage(); usage();
@ -729,6 +734,9 @@ main(int argc, char **argv)
"source-revisions", srcrevs); "source-revisions", srcrevs);
if (preserve) if (preserve)
prop_dictionary_set_bool(pkg_propsd, "preserve", true); prop_dictionary_set_bool(pkg_propsd, "preserve", true);
if (buildopts)
prop_dictionary_set_cstring_nocopy(pkg_propsd,
"build-options", buildopts);
/* Optional arrays */ /* Optional arrays */
process_array("run_depends", deps); process_array("run_depends", deps);

View File

@ -1,4 +1,4 @@
.Dd January 31, 2013 .Dd March 23, 2013
.Os Void Linux .Os Void Linux
.Dt xbps-create 8 .Dt xbps-create 8
.Sh NAME .Sh NAME
@ -66,6 +66,8 @@ A long description for this package.
A short description for this package, one line with less than 80 characters. A short description for this package, one line with less than 80 characters.
.It Fl V, Fl -version .It Fl V, Fl -version
Shows the XBPS version. Shows the XBPS version.
.It Fl -build-options Ar string
A string containing the build options used in package.
.It Fl -shlib-provides Ar list .It Fl -shlib-provides Ar list
A list of provided shared libraries, separated by a single blank. Example: A list of provided shared libraries, separated by a single blank. Example:
.Ar 'libfoo.so.2 libblah.so.1' . .Ar 'libfoo.so.2 libblah.so.1' .