diff --git a/net-misc/wget/patches/wget-1.14-gcc2.patch b/net-misc/wget/patches/wget-1.14-build-fixes.patch similarity index 87% rename from net-misc/wget/patches/wget-1.14-gcc2.patch rename to net-misc/wget/patches/wget-1.14-build-fixes.patch index 057eff0bf..4737e4a37 100644 --- a/net-misc/wget/patches/wget-1.14-gcc2.patch +++ b/net-misc/wget/patches/wget-1.14-build-fixes.patch @@ -1,16 +1,16 @@ -From 1d23e4b72c66f22da3a87ba2b14bb1b6ffe78b16 Mon Sep 17 00:00:00 2001 +From 106dffb05519f44684f5f9dc09b0970b8c68a2d9 Mon Sep 17 00:00:00 2001 From: Luke Date: Wed, 11 Dec 2013 03:03:50 +0000 -Subject: [PATCH] Make wget gcc2-friendly +Subject: [PATCH] Fix build errors --- - lib/regcomp.c | 2 +- - src/http.c | 9 ++++-- - src/main.c | 25 +++++++++------ - src/retr.c | 3 +- - src/utils.c | 2 ++ - src/warc.c | 99 +++++++++++++++++++++++++++++++++++++---------------------- - 6 files changed, 89 insertions(+), 51 deletions(-) + lib/regcomp.c | 2 +- + src/http.c | 9 ++++-- + src/main.c | 25 ++++++++------ + src/retr.c | 3 +- + src/utils.c | 2 ++ + src/warc.c | 102 ++++++++++++++++++++++++++++++++++++---------------------- + 6 files changed, 91 insertions(+), 52 deletions(-) diff --git a/lib/regcomp.c b/lib/regcomp.c index 1d7a522..76ed566 100644 @@ -186,7 +186,7 @@ index 567dc35..736f6e2 100644 # include #endif diff --git a/src/warc.c b/src/warc.c -index 69f80be..0cf9e53 100644 +index 69f80be..17a48aa 100644 --- a/src/warc.c +++ b/src/warc.c @@ -154,10 +154,11 @@ warc_write_buffer (const char *buffer, size_t size) @@ -202,7 +202,7 @@ index 69f80be..0cf9e53 100644 if (n != warc_write_buffer (str, n)) warc_write_ok = false; -@@ -246,6 +247,9 @@ warc_write_block_from_file (FILE *data_in) +@@ -246,8 +247,11 @@ warc_write_block_from_file (FILE *data_in) { /* Add the Content-Length header. */ char *content_length; @@ -210,8 +210,11 @@ index 69f80be..0cf9e53 100644 + size_t s; + fseeko (data_in, 0L, SEEK_END); - if (! asprintf (&content_length, "%ld", ftello (data_in))) +- if (! asprintf (&content_length, "%ld", ftello (data_in))) ++ if (! asprintf (&content_length, "%ld", (long int)ftello (data_in))) { + warc_write_ok = false; + return false; @@ -262,8 +266,6 @@ warc_write_block_from_file (FILE *data_in) warc_write_ok = false; @@ -322,20 +325,23 @@ index 69f80be..0cf9e53 100644 #endif /* If max size is enabled, we add a serial number to the file names. */ -@@ -811,9 +823,9 @@ static bool +@@ -811,12 +823,13 @@ static bool warc_parse_cdx_header (char *lineptr, int *field_num_original_url, int *field_num_checksum, int *field_num_record_id) { -- *field_num_original_url = -1; -- *field_num_checksum = -1; -- *field_num_record_id = -1; -+ off_t *field_num_original_url = -1; -+ off_t *field_num_checksum = -1; -+ off_t *field_num_record_id = -1; ++ char *token; ++ char *save_ptr; ++ + *field_num_original_url = -1; + *field_num_checksum = -1; + *field_num_record_id = -1; - char *token; - char *save_ptr; -@@ -860,10 +872,12 @@ warc_process_cdx_line (char *lineptr, int field_num_original_url, +- char *token; +- char *save_ptr; + token = strtok_r (lineptr, CDX_FIELDSEP, &save_ptr); + + if (token != NULL && strcmp (token, "CDX") == 0) +@@ -860,10 +873,12 @@ warc_process_cdx_line (char *lineptr, int field_num_original_url, char *token; char *save_ptr; @@ -349,7 +355,7 @@ index 69f80be..0cf9e53 100644 while (token != NULL) { char **val; -@@ -926,10 +940,7 @@ warc_process_cdx_line (char *lineptr, int field_num_original_url, +@@ -926,10 +941,7 @@ warc_process_cdx_line (char *lineptr, int field_num_original_url, static bool warc_load_cdx_dedup_file (void) { @@ -361,7 +367,7 @@ index 69f80be..0cf9e53 100644 int field_num_original_url = -1; int field_num_checksum = -1; int field_num_record_id = -1; -@@ -938,6 +949,10 @@ warc_load_cdx_dedup_file (void) +@@ -938,6 +950,10 @@ warc_load_cdx_dedup_file (void) size_t n = 0; ssize_t line_length; @@ -372,7 +378,7 @@ index 69f80be..0cf9e53 100644 /* The first line should contain the CDX header. Format: " CDX x x x x x" where x are field type indicators. For our purposes, we only -@@ -965,6 +980,7 @@ _("CDX file does not list record ids. (Missing column 'u'.)\n")); +@@ -965,6 +981,7 @@ _("CDX file does not list record ids. (Missing column 'u'.)\n")); } else { @@ -380,7 +386,7 @@ index 69f80be..0cf9e53 100644 /* Initialize the table. */ warc_cdx_dedup_table = hash_table_new (1000, warc_hash_sha1_digest, warc_cmp_sha1_digest); -@@ -982,7 +998,7 @@ _("CDX file does not list record ids. (Missing column 'u'.)\n")); +@@ -982,7 +999,7 @@ _("CDX file does not list record ids. (Missing column 'u'.)\n")); while (line_length != -1); /* Print results. */ @@ -389,7 +395,7 @@ index 69f80be..0cf9e53 100644 logprintf (LOG_VERBOSE, ngettext ("Loaded %d record from CDX.\n\n", "Loaded %d records from CDX.\n\n", nrecords), -@@ -1002,12 +1018,14 @@ _("CDX file does not list record ids. (Missing column 'u'.)\n")); +@@ -1002,12 +1019,14 @@ _("CDX file does not list record ids. (Missing column 'u'.)\n")); static struct warc_cdx_record * warc_find_duplicate_cdx_record (char *url, char *sha1_digest_payload) { @@ -407,7 +413,7 @@ index 69f80be..0cf9e53 100644 &key, &rec_existing); if (found && strcmp (rec_existing->url, url) == 0) -@@ -1079,11 +1097,13 @@ warc_init (void) +@@ -1079,11 +1098,13 @@ warc_init (void) static void warc_write_metadata (void) { @@ -422,7 +428,7 @@ index 69f80be..0cf9e53 100644 warc_uuid_str (manifest_uuid); fflush (warc_manifest_fp); -@@ -1093,7 +1113,7 @@ warc_write_metadata (void) +@@ -1093,7 +1114,7 @@ warc_write_metadata (void) warc_manifest_fp, -1); /* warc_write_resource_record has closed warc_manifest_fp. */ @@ -431,7 +437,7 @@ index 69f80be..0cf9e53 100644 if (warc_tmp_fp == NULL) { logprintf (LOG_NOTQUIET, _("Could not open temporary WARC file.\n")); -@@ -1148,10 +1168,11 @@ FILE * +@@ -1148,10 +1169,11 @@ FILE * warc_tempfile (void) { char filename[100]; @@ -444,7 +450,7 @@ index 69f80be..0cf9e53 100644 if (fd < 0) return NULL; -@@ -1210,8 +1231,10 @@ warc_write_cdx_record (const char *url, const char *timestamp_str, +@@ -1210,8 +1232,10 @@ warc_write_cdx_record (const char *url, const char *timestamp_str, off_t offset, const char *warc_filename, const char *response_uuid) { @@ -456,7 +462,7 @@ index 69f80be..0cf9e53 100644 memcpy (timestamp_str_cdx , timestamp_str , 4); /* "YYYY" "-" */ memcpy (timestamp_str_cdx + 4, timestamp_str + 5, 2); /* "mm" "-" */ memcpy (timestamp_str_cdx + 6, timestamp_str + 8, 2); /* "dd" "T" */ -@@ -1221,7 +1244,6 @@ warc_write_cdx_record (const char *url, const char *timestamp_str, +@@ -1221,7 +1245,6 @@ warc_write_cdx_record (const char *url, const char *timestamp_str, timestamp_str_cdx[14] = '\0'; /* Rewrite the checksum. */ @@ -464,7 +470,16 @@ index 69f80be..0cf9e53 100644 if (payload_digest != NULL) checksum = payload_digest + 5; /* Skip the "sha1:" */ else -@@ -1260,10 +1282,11 @@ warc_write_revisit_record (char *url, char *timestamp_str, +@@ -1235,7 +1258,7 @@ warc_write_cdx_record (const char *url, const char *timestamp_str, + /* Print the CDX line. */ + fprintf (warc_current_cdx_file, "%s %s %s %s %d %s %s - %ld %s %s\n", url, + timestamp_str_cdx, url, mime_type, response_code, checksum, +- redirect_location, offset, warc_current_filename, response_uuid); ++ redirect_location, (long int)offset, warc_current_filename, response_uuid); + fflush (warc_current_cdx_file); + + return true; +@@ -1260,10 +1283,11 @@ warc_write_revisit_record (char *url, char *timestamp_str, char *refers_to, ip_address *ip, FILE *body) { char revisit_uuid [48]; @@ -478,7 +493,7 @@ index 69f80be..0cf9e53 100644 sha1_stream (body, sha1_res_block); block_digest = warc_base32_sha1_digest (sha1_res_block); -@@ -1314,6 +1337,9 @@ warc_write_response_record (char *url, char *timestamp_str, +@@ -1314,6 +1338,9 @@ warc_write_response_record (char *url, char *timestamp_str, char sha1_res_block[SHA1_DIGEST_SIZE]; char sha1_res_payload[SHA1_DIGEST_SIZE]; @@ -488,7 +503,7 @@ index 69f80be..0cf9e53 100644 if (opt.warc_digests_enabled) { /* Calculate the block and payload digests. */ -@@ -1357,11 +1383,10 @@ warc_write_response_record (char *url, char *timestamp_str, +@@ -1357,11 +1384,10 @@ warc_write_response_record (char *url, char *timestamp_str, /* Not a revisit, just store the record. */ diff --git a/net-misc/wget/wget-1.14.recipe b/net-misc/wget/wget-1.14.recipe index 9b172237e..5a1f51073 100644 --- a/net-misc/wget/wget-1.14.recipe +++ b/net-misc/wget/wget-1.14.recipe @@ -11,6 +11,7 @@ LICENSE="GNU GPL v3" COPYRIGHT="1996-2012 Free Software Foundation" REVISION="1" ARCHITECTURES="x86_gcc2 ?x86 ?x86_64" +SECONDARY_ARCHITECTURES="x86" PROVIDES=" wget$secondaryArchSuffix = $portVersion @@ -42,7 +43,7 @@ BUILD_PREREQUIRES=" PATCHES=" wget-1.14.patch - wget-1.14-gcc2.patch + wget-1.14-build-fixes.patch wget-1.14-pod-fixes.patch "