diff options
-rw-r--r-- | .SRCINFO | 34 | ||||
-rw-r--r-- | 0001-nl_langinfo.mingw32.patch | 44 | ||||
-rw-r--r-- | 197416.all.patch | 11 | ||||
-rw-r--r-- | 217602.all.patch | 32 | ||||
-rw-r--r-- | 278402-manpage.all.patch | 30 | ||||
-rw-r--r-- | 318833.all.patch | 66 | ||||
-rw-r--r-- | 356669.all.patch | 134 | ||||
-rw-r--r-- | 367153-manpage.all.patch | 49 | ||||
-rw-r--r-- | PKGBUILD | 69 | ||||
-rw-r--r-- | get-w32-console-maxcols.mingw32.patch | 35 | ||||
-rw-r--r-- | no-uid-stuff-on.mingw32.patch | 25 |
11 files changed, 529 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..26dba5b4479b --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,34 @@ +pkgbase = mingw-w64-popt + pkgdesc = A commandline option parser (mingw-w64) + pkgver = 1.16 + pkgrel = 1 + url = http://rpm5.org + arch = any + license = custom + makedepends = mingw-w64-gcc + options = !strip + options = !buildflags + options = staticlibs + source = http://rpm5.org/files/popt/popt-1.16.tar.gz + source = 0001-nl_langinfo.mingw32.patch + source = 197416.all.patch + source = 217602.all.patch + source = 278402-manpage.all.patch + source = 318833.all.patch + source = 356669.all.patch + source = 367153-manpage.all.patch + source = get-w32-console-maxcols.mingw32.patch + source = no-uid-stuff-on.mingw32.patch + sha1sums = cfe94a15a2404db85858a81ff8de27c8ff3e235e + sha1sums = 62640c0a0845cea5f3cd5646d26fd681ea36cadf + sha1sums = bd7c8872f0bb80ec2a8b78596eb3ba5706795133 + sha1sums = 977fbbe108cf817103f706dd314236e6bace7557 + sha1sums = 18d169ff43b6ef4ee613272fdb2bbdc01df1f166 + sha1sums = a446c763439fe97459c6ea9bea22054a69ea9cc6 + sha1sums = 2664b32cd6882e3c7da2d1ed3d40b14807a2c604 + sha1sums = 63e5fdae8160445794458b03fc5a61e7354efada + sha1sums = 6599adf3797d7bfb4534bc910372c431fc0efced + sha1sums = 4c3b7b302044bd45decec78f7f7d4ece15d9f3f7 + +pkgname = mingw-w64-popt + diff --git a/0001-nl_langinfo.mingw32.patch b/0001-nl_langinfo.mingw32.patch new file mode 100644 index 000000000000..eaf51547fd16 --- /dev/null +++ b/0001-nl_langinfo.mingw32.patch @@ -0,0 +1,44 @@ +--- popt-1.16/poptint.c.orig 2010-01-19 04:39:10 +0400 ++++ popt-1.16/poptint.c 2012-05-05 22:02:40 +0400 +@@ -86,8 +86,20 @@ + if (istr == NULL) + return NULL; + +-#ifdef HAVE_LANGINFO_H ++#if defined(HAVE_LANGINFO_H) ++# if !defined(WIN32) + codeset = nl_langinfo ((nl_item)CODESET); ++# else ++ { ++ static char __langinfo[251]; ++ unsigned int cp = GetACP(); ++ if (cp) ++ sprintf(__langinfo, "CP%u", cp); ++ else ++ strcpy(__langinfo, "UTF-8"); /* ? */ ++ codeset = __langinfo; ++ } ++# endif + #endif + + if (codeset != NULL && strcmp(codeset, "UTF-8") != 0 +--- popt-1.16/poptint.h.orig 2010-01-19 04:39:10 +0400 ++++ popt-1.16/poptint.h 2012-05-05 22:07:21 +0400 +@@ -172,7 +173,7 @@ + #endif + #endif + +-#ifdef HAVE_LANGINFO_H ++#if defined(HAVE_LANGINFO_H) && !defined(WIN32) + #include <langinfo.h> + #if defined(__LCLINT__) + /*@-declundef -incondefs @*/ +@@ -180,6 +181,8 @@ + /*@*/; + /*@=declundef =incondefs @*/ + #endif ++#elif defined(WIN32) ++#include <windows.h> + #endif + + #if defined(HAVE_DCGETTEXT) && !defined(__LCLINT__) diff --git a/197416.all.patch b/197416.all.patch new file mode 100644 index 000000000000..99c18017259a --- /dev/null +++ b/197416.all.patch @@ -0,0 +1,11 @@ +--- popt-1.16/popthelp.c.orig 2009-08-28 04:06:33 +0400 ++++ popt-1.16/popthelp.c 2012-03-31 08:39:03 +0400 +@@ -312,7 +312,7 @@ + { + size_t maxLeftCol = columns->cur; + size_t indentLength = maxLeftCol + 5; +- size_t lineLength = columns->max - indentLength; ++ size_t lineLength = (indentLength >= columns->max) ? 1 : columns->max - indentLength; + const char * help = D_(translation_domain, opt->descrip); + const char * argDescrip = getArgDescrip(opt, translation_domain); + /* Display shortName iff printable non-space. */ diff --git a/217602.all.patch b/217602.all.patch new file mode 100644 index 000000000000..142bad71ea19 --- /dev/null +++ b/217602.all.patch @@ -0,0 +1,32 @@ +Index: popt-1.16/popt.c +=================================================================== +--- popt-1.16.orig/popt.c 2010-05-13 04:57:52.006009545 +0100 ++++ popt-1.16/popt.c 2010-05-13 04:58:15.027009502 +0100 +@@ -1023,8 +1023,13 @@ + + int poptSaveLong(long * arg, unsigned int argInfo, long aLong) + { ++#if 0 + /* XXX Check alignment, may fail on funky platforms. */ + if (arg == NULL || (((unsigned long)arg) & (sizeof(*arg)-1))) ++#else ++ /* It does! pm@debian.org */ ++ if (arg == NULL) ++#endif + return POPT_ERROR_NULLARG; + + if (aLong != 0 && LF_ISSET(RANDOM)) { +@@ -1056,8 +1061,13 @@ + + int poptSaveInt(/*@null@*/ int * arg, unsigned int argInfo, long aLong) + { ++#if 0 + /* XXX Check alignment, may fail on funky platforms. */ + if (arg == NULL || (((unsigned long)arg) & (sizeof(*arg)-1))) ++#else ++ /* It does! pm@debian.org */ ++ if (arg == NULL) ++#endif + return POPT_ERROR_NULLARG; + + if (aLong != 0 && LF_ISSET(RANDOM)) { diff --git a/278402-manpage.all.patch b/278402-manpage.all.patch new file mode 100644 index 000000000000..3125474de4fc --- /dev/null +++ b/278402-manpage.all.patch @@ -0,0 +1,30 @@ +Index: popt-1.16/popt.3 +=================================================================== +--- popt-1.16.orig/popt.3 2010-05-13 04:58:04.357009234 +0100 ++++ popt-1.16/popt.3 2010-05-13 04:58:09.716009057 +0100 +@@ -657,21 +657,22 @@ + .nf + #include <popt.h> + #include <stdio.h> ++#include <stdlib.h> + + void usage(poptContext optCon, int exitcode, char *error, char *addl) { + poptPrintUsage(optCon, stderr, 0); +- if (error) fprintf(stderr, "%s: %s\n", error, addl); ++ if (error) fprintf(stderr, "%s: %s\\n", error, addl); + exit(exitcode); + } + + int main(int argc, char *argv[]) { +- char c; /* used for argument parsing */ ++ int c; /* used for argument parsing */ + int i = 0; /* used for tracking options */ +- char *portname; + int speed = 0; /* used in argument parsing to set speed */ + int raw = 0; /* raw mode? */ + int j; + char buf[BUFSIZ+1]; ++ const char *portname; + poptContext optCon; /* context for parsing command-line options */ + + struct poptOption optionsTable[] = { diff --git a/318833.all.patch b/318833.all.patch new file mode 100644 index 000000000000..21d401c7e1a4 --- /dev/null +++ b/318833.all.patch @@ -0,0 +1,66 @@ +Index: popt-1.16/popt.c +=================================================================== +--- popt-1.16.orig/popt.c 2010-05-13 04:57:46.853009777 +0100 ++++ popt-1.16/popt.c 2010-05-13 04:57:52.006009545 +0100 +@@ -184,6 +184,7 @@ + con->os->next = 1; /* skip argv[0] */ + + con->leftovers = calloc( (size_t)(argc + 1), sizeof(*con->leftovers) ); ++ con->allocLeftovers = argc + 1; + /*@-dependenttrans -assignexpose@*/ /* FIX: W2DO? */ + con->options = options; + /*@=dependenttrans =assignexpose@*/ +@@ -1358,7 +1359,19 @@ + return 0; + } + if (con->leftovers != NULL) /* XXX can't happen */ +- con->leftovers[con->numLeftovers++] = origOptString; ++ /* One might think we can never overflow the leftovers ++ array. Actually, that's true, as long as you don't ++ use poptStuffArgs()... */ ++ if ((con->numLeftovers + 1) >= (con->allocLeftovers)) { ++ con->allocLeftovers += 10; ++ con->leftovers = ++ realloc(con->leftovers, ++ sizeof(*con->leftovers) * con->allocLeftovers); ++ } ++ con->leftovers[con->numLeftovers++] ++ = xstrdup(origOptString); /* so a free of a stuffed ++ argv doesn't give us a ++ dangling pointer */ + continue; + } + +@@ -1612,6 +1625,8 @@ + + poptContext poptFreeContext(poptContext con) + { ++ int i; ++ + if (con == NULL) return con; + poptResetContext(con); + con->os->argb = _free(con->os->argb); +@@ -1622,7 +1637,11 @@ + con->execs = poptFreeItems(con->execs, con->numExecs); + con->numExecs = 0; + ++ for (i = 0; i < con->numLeftovers; i++) { ++ con->leftovers[i] = _free(&con->leftovers[i]); ++ } + con->leftovers = _free(con->leftovers); ++ + con->finalArgv = _free(con->finalArgv); + con->appName = _free(con->appName); + con->otherHelp = _free(con->otherHelp); +Index: popt-1.16/poptint.h +=================================================================== +--- popt-1.16.orig/poptint.h 2010-05-13 04:57:46.878010140 +0100 ++++ popt-1.16/poptint.h 2010-05-13 04:57:52.008009414 +0100 +@@ -119,6 +119,7 @@ + /*@owned@*/ /*@null@*/ + poptArgv leftovers; + int numLeftovers; ++ int allocLeftovers; + int nextLeftover; + /*@keep@*/ + const struct poptOption * options; diff --git a/356669.all.patch b/356669.all.patch new file mode 100644 index 000000000000..c73ff10f2057 --- /dev/null +++ b/356669.all.patch @@ -0,0 +1,134 @@ +Index: popt-1.16/po/ca.po +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ popt-1.16/po/ca.po 2010-05-13 04:59:13.757009036 +0100 +@@ -0,0 +1,116 @@ ++# Catalan translation of popt. ++# Copyright © Free Software Foundation, Inc. ++# This file is distributed under the same license as the popt package. ++# Jordi Mallach <jordi@sindominio.net>, 2006. ++# ++msgid "" ++msgstr "" ++"Project-Id-Version: popt 1.7\n" ++"POT-Creation-Date: 2002-09-16 13:31-0400\n" ++"PO-Revision-Date: 2006-03-13 10:22+0000\n" ++"Last-Translator: Jordi Mallach <jordi@sindominio.net>\n" ++"Language-Team: Catalan <ca@dodds.net>\n" ++"MIME-Version: 1.0\n" ++"Content-Type: text/plain; charset=UTF-8\n" ++"Content-Transfer-Encoding: 8bit\n" ++ ++#: popt.c:34 ++msgid "unknown errno" ++msgstr "número d'error desconegut" ++ ++#: popt.c:940 ++#, c-format ++msgid "option type (%d) not implemented in popt\n" ++msgstr "el tipus d'opció (%d) no està implementat en popt\n" ++ ++#: popt.c:1160 ++msgid "missing argument" ++msgstr "manca un argument" ++ ++#: popt.c:1162 ++msgid "unknown option" ++msgstr "opció desconeguda" ++ ++#: popt.c:1164 ++msgid "mutually exclusive logical operations requested" ++msgstr "s'ha demanat operacions lògiques mutuament excloents" ++ ++#: popt.c:1166 ++msgid "opt->arg should not be NULL" ++msgstr "opt->arg no hauria de ser NULL" ++ ++#: popt.c:1168 ++msgid "aliases nested too deeply" ++msgstr "la recursió d'àlias és massa profunda" ++ ++#: popt.c:1170 ++msgid "error in parameter quoting" ++msgstr "hi ha un error en l'entrecomillat dels paràmetres" ++ ++#: popt.c:1172 ++msgid "invalid numeric value" ++msgstr "el valor numèric és invàlid" ++ ++#: popt.c:1174 ++msgid "number too large or too small" ++msgstr "el número és massa gran o massa petit" ++ ++#: popt.c:1176 ++msgid "memory allocation failed" ++msgstr "l'assignació de memòria ha fallat" ++ ++#: popt.c:1180 ++msgid "unknown error" ++msgstr "s'ha produït un error desconegut" ++ ++#: popthelp.c:57 ++msgid "Show this help message" ++msgstr "Mostra aquest missatge d'ajuda" ++ ++#: popthelp.c:58 ++msgid "Display brief usage message" ++msgstr "Mostra un missatge breu d'ús" ++ ++#: popthelp.c:61 ++msgid "Display option defaults in message" ++msgstr "Mostra els valors predeterminats de les opcions al missatge" ++ ++#: popthelp.c:103 ++msgid "NONE" ++msgstr "CAP" ++ ++#: popthelp.c:105 ++msgid "VAL" ++msgstr "VAL" ++ ++#: popthelp.c:109 ++msgid "INT" ++msgstr "INT" ++ ++#: popthelp.c:110 ++msgid "LONG" ++msgstr "LONG" ++ ++#: popthelp.c:111 ++msgid "STRING" ++msgstr "STRING" ++ ++#: popthelp.c:112 ++msgid "FLOAT" ++msgstr "FLOAT" ++ ++#: popthelp.c:113 ++msgid "DOUBLE" ++msgstr "DOUBLE" ++ ++#: popthelp.c:114 ++msgid "ARG" ++msgstr "ARG" ++ ++#: popthelp.c:486 ++msgid "Usage:" ++msgstr "Forma d'ús:" ++ ++#: popthelp.c:510 ++msgid "[OPTION...]" ++msgstr "[OPCIÓ...]" +Index: popt-1.16/configure +=================================================================== +--- popt-1.16.orig/configure 2010-05-04 21:55:59.000000000 +0100 ++++ popt-1.16/configure 2010-05-13 04:59:47.938008097 +0100 +@@ -2765,7 +2765,7 @@ + LT_AGE=8 + + +-ALL_LINGUAS="cs da de eo es fi fr ga gl hu id is it ja ko lv nb nl pl pt ro ru sk sl sv th tr uk vi wa zh_TW zh_CN" ++ALL_LINGUAS="ca cs da de eo es fi fr ga gl hu id is it ja ko lv nb nl pl pt ro ru sk sl sv th tr uk vi wa zh_TW zh_CN" + + DEPDIR="${am__leading_dot}deps" + diff --git a/367153-manpage.all.patch b/367153-manpage.all.patch new file mode 100644 index 000000000000..4763fc7938aa --- /dev/null +++ b/367153-manpage.all.patch @@ -0,0 +1,49 @@ +Index: popt-1.16/popt.3 +=================================================================== +--- popt-1.16.orig/popt.3 2010-05-13 04:57:46.665009784 +0100 ++++ popt-1.16/popt.3 2010-05-13 04:58:04.357009234 +0100 +@@ -200,7 +200,7 @@ + .RB "This macro includes another option table (via " POPT_ARG_INCLUDE_TABLE + ; see below) in the main one which provides the table entries for these + .RB "arguments. When " --usage " or " --help " are passed to programs which +-use popt's automatical help, popt displays the appropriate message on ++use popt's automatic help, popt displays the appropriate message on + stderr as soon as it finds the option, and exits the program with a + return code of 0. If you want to use popt's automatic help generation in + a different way, you need to explicitly add the option entries to your programs +@@ -210,7 +210,7 @@ + the argument will not be shown in help output. + .sp + If the \fIargInfo\fR value is bitwise or'd with \fBPOPT_ARGFLAG_SHOW_DEFAULT\fR, +-the inital value of the arg will be shown in help output. ++the initial value of the arg will be shown in help output. + .sp + The final structure in the table should have all the pointer values set + .RB "to " NULL " and all the arithmetic values set to 0, marking the " +@@ -233,7 +233,7 @@ + contain a overall description of the option table being included. + .sp + The other special option table entry type tells popt to call a function (a +-callback) when any option in that table is found. This is especially usefull ++callback) when any option in that table is found. This is especially useful + when included option tables are being used, as the program which provides + the top-level option table doesn't need to be aware of the other options + which are provided by the included table. When a callback is set for +@@ -517,7 +517,7 @@ + applications. When an error is detected from most of the functions, + an error message is printed along with the error string from + .BR poptStrerror() ". When an error occurs during argument parsing, " +-code similiar to the following displays a useful error message: ++code similar to the following displays a useful error message: + .sp + .nf + fprintf(stderr, "%s: %s\\n", +@@ -608,7 +608,7 @@ + .RI "an " argv "-style array, some programs need to parse strings that " + are formatted identically to command lines. To facilitate this, popt + provides a function that parses a string into an array of strings, +-using rules similiar to normal shell parsing. ++using rules similar to normal shell parsing. + .sp + .nf + .B "#include <popt.h>" diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..c4b84a09862d --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,69 @@ +# Maintainer: Sebastian Morr <sebastian@morr.cc> + +pkgname=mingw-w64-popt +_pkgname=popt +pkgver=1.16 +pkgrel=1 +arch=('any') +pkgdesc="A commandline option parser (mingw-w64)" +makedepends=('mingw-w64-gcc') +license=('custom') +url="http://rpm5.org" +options=(!strip !buildflags staticlibs) +source=("http://rpm5.org/files/${_pkgname}/${_pkgname}-${pkgver}.tar.gz" + "0001-nl_langinfo.mingw32.patch" + "197416.all.patch" + "217602.all.patch" + "278402-manpage.all.patch" + "318833.all.patch" + "356669.all.patch" + "367153-manpage.all.patch" + "get-w32-console-maxcols.mingw32.patch" + "no-uid-stuff-on.mingw32.patch" + ) +sha1sums=('cfe94a15a2404db85858a81ff8de27c8ff3e235e' + '62640c0a0845cea5f3cd5646d26fd681ea36cadf' + 'bd7c8872f0bb80ec2a8b78596eb3ba5706795133' + '977fbbe108cf817103f706dd314236e6bace7557' + '18d169ff43b6ef4ee613272fdb2bbdc01df1f166' + 'a446c763439fe97459c6ea9bea22054a69ea9cc6' + '2664b32cd6882e3c7da2d1ed3d40b14807a2c604' + '63e5fdae8160445794458b03fc5a61e7354efada' + '6599adf3797d7bfb4534bc910372c431fc0efced' + '4c3b7b302044bd45decec78f7f7d4ece15d9f3f7') + +_architectures="i686-w64-mingw32" +_targetarch64=x86_64-w64-mingw32 + +build() { + cd "$srcdir/${_pkgname}-$pkgver" + + patch -p1 -i ../0001-nl_langinfo.mingw32.patch + patch -p1 -i ../197416.all.patch + patch -p1 -i ../217602.all.patch + patch -p1 -i ../278402-manpage.all.patch + patch -p1 -i ../318833.all.patch + patch -p1 -i ../356669.all.patch + patch -p1 -i ../367153-manpage.all.patch + patch -p1 -i ../get-w32-console-maxcols.mingw32.patch + patch -p1 -i ../no-uid-stuff-on.mingw32.patch + + for _arch in ${_architectures}; do + mkdir -p "${srcdir}/build-${_arch}" + cd "${srcdir}/build-${_arch}" + ../${_pkgname}-${pkgver}/configure --host=${_arch} --prefix=/usr/${_arch} + make + done +} + +package () { + for _arch in ${_architectures}; do + cd "${srcdir}/build-${_arch}" + make install DESTDIR="${pkgdir}" + rm -rf "${pkgdir}/usr/${_arch}/share/man" + ${_arch}-strip -x -g "${pkgdir}/usr/${_arch}/bin/"*.dll + ${_arch}-strip -g "${pkgdir}/usr/${_arch}/lib/"*.a + done + + install -D -m644 "${srcdir}/${_pkgname}-${pkgver}/COPYING" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +} diff --git a/get-w32-console-maxcols.mingw32.patch b/get-w32-console-maxcols.mingw32.patch new file mode 100644 index 000000000000..9819f664d9a9 --- /dev/null +++ b/get-w32-console-maxcols.mingw32.patch @@ -0,0 +1,35 @@ +--- popt-1.16/popthelp.c.orig 2012-03-31 08:51:34 +0400 ++++ popt-1.16/popthelp.c 2012-03-31 09:08:28 +0400 +@@ -10,9 +10,11 @@ + + #include "system.h" + +-#define POPT_USE_TIOCGWINSZ ++#undef POPT_USE_TIOCGWINSZ + #ifdef POPT_USE_TIOCGWINSZ + #include <sys/ioctl.h> ++#elif defined(_WIN32_WINNT) && !defined(__CYGWIN__) ++#include <windows.h> + #endif + + #define POPT_WCHAR_HACK +@@ -123,8 +125,18 @@ + if (ws_col > maxcols && ws_col < (size_t)256) + maxcols = ws_col - 1; + } +-#endif + return maxcols; ++#elif defined(_WIN32_WINNT) && !defined(__CYGWIN__) ++ HANDLE hStdout; ++ CONSOLE_SCREEN_BUFFER_INFO cbi; ++ hStdout = GetStdHandle (STD_OUTPUT_HANDLE); ++ if (hStdout == INVALID_HANDLE_VALUE) ++ return maxcols; ++ if (0 == GetConsoleScreenBufferInfo (hStdout, &cbi)) ++ return maxcols; ++ else ++ return cbi.dwSize.X; ++#endif + } + + /** diff --git a/no-uid-stuff-on.mingw32.patch b/no-uid-stuff-on.mingw32.patch new file mode 100644 index 000000000000..7bbb6f9f713b --- /dev/null +++ b/no-uid-stuff-on.mingw32.patch @@ -0,0 +1,25 @@ +--- popt-1.16/poptconfig.c.orig 2009-05-20 17:18:07 +0400 ++++ popt-1.16/poptconfig.c 2012-03-31 08:50:54 +0400 +@@ -141,17 +141,17 @@ + int poptSaneFile(const char * fn) + { + struct stat sb; +- uid_t uid = getuid(); ++/* uid_t uid = getuid();*/ + + if (stat(fn, &sb) == -1) + return 1; +- if ((uid_t)sb.st_uid != uid) +- return 0; ++/* if ((uid_t)sb.st_uid != uid) ++ return 0;*/ + if (!S_ISREG(sb.st_mode)) + return 0; + /*@-bitwisesigned@*/ +- if (sb.st_mode & (S_IWGRP|S_IWOTH)) +- return 0; ++/* if (sb.st_mode & (S_IWGRP|S_IWOTH)) ++ return 0;*/ + /*@=bitwisesigned@*/ + return 1; + } |