source_dl = https://source.ipfire.org/source-3.x/
-
-[build]
-
-requires = pakfire-build, gcc, filesystem, ccache, /bin/bash, filesystem, coreutils, util-linux, diffutils, make, gcc, kernel-headers, tar, patch, xz, gzip, bzip2, strace, less, vim
-
[repo:stable]
description = IPFire 3 - stable
baseurl = https://pakfire.ipfire.org/files/repos/ipfire-3/stable/%{arch}
static int pakfire_build_install_packages(struct pakfire_build* build,
int* snapshot_needs_update) {
- char** packages = NULL;
- int r = 1;
-
- // Fetch configuration
- struct pakfire_config* config = pakfire_get_config(build->pakfire);
- if (!config) {
- ERROR(build->pakfire, "Could not fetch configuration: %m\n");
- r = 1;
- goto ERROR;
- }
-
- // Fetch build environment
- const char* requires = pakfire_config_get(config, "build", "requires", NULL);
- if (!requires) {
- ERROR(build->pakfire, "No build requirements have been defined\n");
- goto ERROR;
- }
+ int r;
- // Split requirements into packages
- packages = pakfire_string_split(requires, ',');
- if (!packages)
- goto ERROR;
+ const char* packages[] = {
+ "build-essential",
+ NULL,
+ };
int changed = 0;
// Install everything
- r = pakfire_install(build->pakfire, 0, 0, (const char**)packages, NULL, 0,
+ r = pakfire_install(build->pakfire, 0, 0, packages, NULL, 0,
&changed, NULL, NULL);
if (r) {
ERROR(build->pakfire, "Could not install build dependencies: %m\n");
- goto ERROR;
+ return r;
}
// Mark snapshot as changed if new packages were installed
r = pakfire_sync(build->pakfire, 0, 0, &changed, NULL, NULL);
if (r) {
ERROR(build->pakfire, "Could not update packages: %m\n");
- goto ERROR;
+ return r;
}
// Has anything changed?
if (changed)
*snapshot_needs_update = 1;
- // Success
- r = 0;
-
-ERROR:
- if (config)
- pakfire_config_unref(config);
-
- if (packages) {
- for (char** package = packages; *package; package++)
- free(*package);
- free(packages);
- }
-
- return r;
+ return 0;
}
/*