Re: Putting packages up for adoption

2020-03-19 Thread Marco Atzeri via Cygwin-apps

Am 20.03.2020 um 04:47 schrieb Yaakov Selkowitz:

Hello Cygwin package maintainers,

As you all probably noted, I haven't been around much.  My team at work
has been really busy accomplishing some pretty amazing feats over the
last number of months, most recently:

https://www.ibm.com/blogs/systems/red-hat-openshift-now-available-ibm-z-linuxone/

While it's been great for my career, it obviously hasn't been so good
for you and the community as a whole, as I've really had absolutely no
time to work on Cygwin packaging.  In fact, I've barely used my Windows
machine and VMs at all for quite some time.  And to be completely
honest, it really doesn't look like that's going to change anytime soon
either.

To that end, in the best interest of the community, please consider my
packages up for adoption.  I don't expect that any one person will take
all of them; some are obsolete and due for removal anyway, some should
be picked up as soon as possible, and others might just end up
bitrotting if nobody is interested in them.  However, in whatever there
is interest (or need), hopefully what is there now will serve as a
strong foundation to on which to continue to build.

(And just to be perfectly clear, we're all in good health; this has
nothing to do with the current crisis, except that maybe some of you
have more time at home now to use to the benefit of Cygwin.)

I'll continue lurking on the lists, and with this burden off my
shoulders, try to transition to being a little more active as a mentor.
So, please feel free to ask questions (on list, please), particularly
if you don't understand why I did something in my packaging.  There is
(or at least was at the time!) a good reason for all of it, even though
I often neglected to document why.  I'll try to do what I can to make
this as smooth as possible.

All the best, stay safe, and keep on building!

--
Yaakov



Hi Yaakov,
thanks of letting us know.
I guess that most of us clearly understood that work took over
and as you have clearly a talent to make stuff work together
I am not surprised that Redhat is using that to full speed.

So Long, and Thanks for All the Fish
Marco

PS for all the others:
"Houston we have a problem.."

$ awk '{$1="" ; print }' cygwin-pkg-maint  | sort  | uniq -c |sort -rn
   2691  Yaakov Selkowitz
244  Achim Gratz
165  Marco Atzeri
162  Jari Aalto
140  ORPHANED (Yaakov Selkowitz)
 95  Ken Brown
 82  Achim Gratz/Yaakov Selkowitz
 47  Achim Gratz/Ken Brown
 42  ORPHANED (Dr. Volker Zell)
 33  Corinna Vinschen
 29  Jon Turney
 28  Andrew Schulman
 22  ORPHANED (David Stacey)
 22  Jonathan Yong
 21  Eric Blake
 18  David Rothenberger
  9  ORPHANED
  8  ORPHANED (Charles Wilson)
  8  Christian Franke









Putting packages up for adoption

2020-03-19 Thread Yaakov Selkowitz
Hello Cygwin package maintainers,

As you all probably noted, I haven't been around much.  My team at work
has been really busy accomplishing some pretty amazing feats over the
last number of months, most recently:

https://www.ibm.com/blogs/systems/red-hat-openshift-now-available-ibm-z-linuxone/

While it's been great for my career, it obviously hasn't been so good
for you and the community as a whole, as I've really had absolutely no
time to work on Cygwin packaging.  In fact, I've barely used my Windows
machine and VMs at all for quite some time.  And to be completely
honest, it really doesn't look like that's going to change anytime soon
either.

To that end, in the best interest of the community, please consider my
packages up for adoption.  I don't expect that any one person will take
all of them; some are obsolete and due for removal anyway, some should
be picked up as soon as possible, and others might just end up
bitrotting if nobody is interested in them.  However, in whatever there
is interest (or need), hopefully what is there now will serve as a
strong foundation to on which to continue to build.

(And just to be perfectly clear, we're all in good health; this has
nothing to do with the current crisis, except that maybe some of you
have more time at home now to use to the benefit of Cygwin.)

I'll continue lurking on the lists, and with this burden off my
shoulders, try to transition to being a little more active as a mentor.
So, please feel free to ask questions (on list, please), particularly
if you don't understand why I did something in my packaging.  There is
(or at least was at the time!) a good reason for all of it, even though
I often neglected to document why.  I'll try to do what I can to make
this as smooth as possible.

All the best, stay safe, and keep on building!

--
Yaakov




[PATCH setup] Fix an allocation length error

2020-03-19 Thread Jon Turney
Allow for the terminating null.
---
 archive.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/archive.cc b/archive.cc
index e4af4f7..1ceb355 100644
--- a/archive.cc
+++ b/archive.cc
@@ -173,7 +173,7 @@ archive::extract_file (archive * source, const std::string& 
prefixURL,
  break;
case ARCHIVE_FILE_DIRECTORY:
  {
-   char *path = (char *) alloca (destfilename.size());
+   char *path = (char *) alloca (destfilename.size() + 1);
strcpy (path, destfilename.c_str());
while (path[0] && path[strlen (path) - 1] == '/')
  path[strlen (path) - 1] = 0;
-- 
2.21.0



[PATCH setup 0/2] Use a separate Start Menu folder for WoW64 installs

2020-03-19 Thread Jon Turney
This avoids setup trying to make shortcuts with the same pathname, when both 
32-bit and 64-bit installs exist on a 64-bit system.

Jon Turney (2):
  Factor out WoW detection
  Rename Start Menu folder for 32-bit installs on WoW64

 desktop.cc | 13 ++---
 nio-ie5.cc | 45 -
 win32.cc   | 26 ++
 win32.h|  2 ++
 4 files changed, 54 insertions(+), 32 deletions(-)

-- 
2.21.0



[PATCH setup 2/2] Rename Start Menu folder for 32-bit installs on WoW64

2020-03-19 Thread Jon Turney
This is not totally straightforward: Since setup can install Cygwin with
either bitness (using the '--arch 32|64' option), we must do the right
thing if this is a 64-bit installer being used to install 32-bit Cygwin,
which will run under WoW, even if the installer isn't...

(Naming things like this makes things consistent with Cygwin-X, which
already names it's Start Menu folder 'Cygwin-X (32-bit)' on WoW64. It
also ensures that there aren't collisions between any setup created
shortcuts for 32-bit and 64-bits.)

The desktop icon is already named 'Cygwin Terminal' or 'Cygwin64
Terminal' so doesn't need attention.

Start menu links made in the 'Cygwin' folder by cygwin-doc, and possibly
other packages will also need adjusting.
---
 desktop.cc | 13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/desktop.cc b/desktop.cc
index eec8ca9..29dbf63 100644
--- a/desktop.cc
+++ b/desktop.cc
@@ -95,6 +95,14 @@ make_link (const std::string& linkpath,
   icon.c_str(), fname.c_str());
 }
 
+static const char *startmenudir()
+{
+  if (!is_64bit && (WowNativeMachine() != IMAGE_FILE_MACHINE_I386))
+return "/Cygwin (32-bit)";
+  else
+return "/Cygwin";
+}
+
 static void
 start_menu (const std::string& title, const std::string& target,
const std::string& arg, const std::string& iconpath)
@@ -107,7 +115,7 @@ start_menu (const std::string& title, const std::string& 
target,
  issystem ? CSIDL_COMMON_PROGRAMS :
  CSIDL_PROGRAMS, );
   SHGetPathFromIDList (id, path);
-  strncat (path, "/Cygwin", MAX_PATH - strlen(path) - 1);
+  strncat (path, startmenudir(), MAX_PATH - strlen(path) - 1);
   LogBabblePrintf ("Program directory for program link: %s", path);
   make_link (path, title, target, arg, iconpath);
 }
@@ -194,7 +202,6 @@ save_icon (std::string , const char *resource_name)
 #define TERMINALICON   "/Cygwin-Terminal.ico"
 #define TERMINALTITLE  (is_64bit ? "Cygwin64 Terminal" \
  : "Cygwin Terminal")
-#define STARTMENUDIR   "/Cygwin"
 
 static void
 do_desktop_setup ()
@@ -300,7 +307,7 @@ check_startmenu (const std::string title, const std::string 
target)
  CSIDL_PROGRAMS, );
   SHGetPathFromIDList (id, path);
   LogBabblePrintf ("Program directory for program link: %s", path);
-  strcat (path, STARTMENUDIR);
+  strcat (path, startmenudir());
   std::string fname = std::string(path) + "/" + title + ".lnk";
 
   if (_access (fname.c_str(), 0) == 0)
-- 
2.21.0



[PATCH setup 1/2] Factor out WoW detection

2020-03-19 Thread Jon Turney
Factor out WoW detection as a separate function
---
 nio-ie5.cc | 45 -
 win32.cc   | 26 ++
 win32.h|  2 ++
 3 files changed, 44 insertions(+), 29 deletions(-)

diff --git a/nio-ie5.cc b/nio-ie5.cc
index f5ad020..fe61b77 100644
--- a/nio-ie5.cc
+++ b/nio-ie5.cc
@@ -52,37 +52,24 @@ determine_default_useragent(void)
 #ifdef __x86_64__
   bitness = "Win64";
 #else
-  typedef BOOL (WINAPI *PFNISWOW64PROCESS2)(HANDLE, USHORT *, USHORT *);
-  PFNISWOW64PROCESS2 pfnIsWow64Process2 = 
(PFNISWOW64PROCESS2)GetProcAddress(GetModuleHandle("kernel32"), 
"IsWow64Process2");
-
-  typedef BOOL (WINAPI *PFNISWOW64PROCESS)(HANDLE, PBOOL);
-  PFNISWOW64PROCESS pfnIsWow64Process = 
(PFNISWOW64PROCESS)GetProcAddress(GetModuleHandle("kernel32"), 
"IsWow64Process");
-
+  USHORT nativeMachine = WowNativeMachine();
   std::stringstream native_desc;
 
-  USHORT processMachine, nativeMachine;
-  if ((pfnIsWow64Process2) &&
-  (pfnIsWow64Process2(GetCurrentProcess(), , 
))) {
-switch (nativeMachine)
-  {
-  case IMAGE_FILE_MACHINE_I386:
-bitness = "Win32";
-break;
-  case IMAGE_FILE_MACHINE_AMD64:
-bitness = "WoW64";
-break;
-  case IMAGE_FILE_MACHINE_ARM64:
-bitness = "WoW64-ARM64";
-break;
-  default:
-native_desc << "WoW64-" << std::hex << nativeMachine;
-bitness = native_desc.str();
-  }
-  } else if (pfnIsWow64Process) {
-BOOL bIsWow64 = FALSE;
-if (pfnIsWow64Process(GetCurrentProcess(), ))
-  bitness = bIsWow64 ? "WoW64" : "Win32";
-  }
+  switch (nativeMachine)
+{
+case IMAGE_FILE_MACHINE_I386:
+  bitness = "Win32";
+  break;
+case IMAGE_FILE_MACHINE_AMD64:
+  bitness = "WoW64";
+  break;
+case IMAGE_FILE_MACHINE_ARM64:
+  bitness = "WoW64-ARM64";
+  break;
+default:
+  native_desc << "WoW64-" << std::hex << nativeMachine;
+  bitness = native_desc.str();
+}
 #endif
   default_useragent = std::string("Cygwin-Setup/") + setup_version + " (" + 
os.str() + ";" + bitness + ")";
   return default_useragent;
diff --git a/win32.cc b/win32.cc
index 6a551ba..45c7bf1 100644
--- a/win32.cc
+++ b/win32.cc
@@ -393,3 +393,29 @@ VersionInfo& GetVer ()
   static VersionInfo *vi = new VersionInfo ();
   return *vi;
 }
+
+/* Identify native machine arch if we are running under WoW */
+USHORT
+WowNativeMachine ()
+{
+#ifdef __x86_64__
+  return IMAGE_FILE_MACHINE_AMD64;
+#else
+  typedef BOOL (WINAPI *PFNISWOW64PROCESS2)(HANDLE, USHORT *, USHORT *);
+  PFNISWOW64PROCESS2 pfnIsWow64Process2 = 
(PFNISWOW64PROCESS2)GetProcAddress(GetModuleHandle("kernel32"), 
"IsWow64Process2");
+
+  typedef BOOL (WINAPI *PFNISWOW64PROCESS)(HANDLE, PBOOL);
+  PFNISWOW64PROCESS pfnIsWow64Process = 
(PFNISWOW64PROCESS)GetProcAddress(GetModuleHandle("kernel32"), 
"IsWow64Process");
+
+  USHORT processMachine, nativeMachine;
+  if ((pfnIsWow64Process2) &&
+  (pfnIsWow64Process2(GetCurrentProcess(), , 
)))
+return nativeMachine;
+  else if (pfnIsWow64Process) {
+BOOL bIsWow64 = FALSE;
+if (pfnIsWow64Process(GetCurrentProcess(), ))
+  return bIsWow64 ? IMAGE_FILE_MACHINE_AMD64 : IMAGE_FILE_MACHINE_I386;
+  }
+  return IMAGE_FILE_MACHINE_I386;
+#endif
+}
diff --git a/win32.h b/win32.h
index 1b9db49..a7d025d 100644
--- a/win32.h
+++ b/win32.h
@@ -177,6 +177,8 @@ VersionInfo& GetVer ();
 #define OSMinorVersion() (GetVer ().minor ())
 #define OSBuildNumber() (GetVer ().buildNumber ())
 
+USHORT WowNativeMachine ();
+
 static inline void
 GetDlgItemRect (HWND h, int item, LPRECT r)
 {
-- 
2.21.0



[PATCH setup 2/2] Disable old Cygwin setup signing key by default

2020-03-19 Thread Jon Turney
Add a new option '--enable-old-keys', for if you really need to install
from an old mirror for some reason.

'--disable-old-keys' is still accepted, but is the default now.
---
 crypto.cc | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/crypto.cc b/crypto.cc
index 2e4ba21..88ced38 100644
--- a/crypto.cc
+++ b/crypto.cc
@@ -52,8 +52,9 @@ static BoolOption UntrustedKeysOption (false, 'u', 
"untrusted-keys",
"Use untrusted saved extra keys");
 static BoolOption KeepUntrustedKeysOption (false, 'U', "keep-untrusted-keys",
"Use untrusted keys and retain all");
-static BoolOption DisableOldKeysOption (false, '\0', "disable-old-keys",
-"Disable old cygwin.com keys");
+static BoolOption EnableOldKeysOption (false, '\0', "old-keys",
+   "Enable old cygwin.com keys",
+   BoolOption::BoolOptionType::pairedAble);
 
 /*  Embedded public half of Cygwin signing key.  */
 static const char *cygwin_pubkey_sexpr =
@@ -708,7 +709,7 @@ verify_ini_file_sig (io_stream *ini_file, io_stream 
*ini_sig_file, HWND owner)
 
   /* If not disabled, also try the old built-in key */
   gcry_sexp_t cygwin_old_key;
-  if (!DisableOldKeysOption)
+  if (EnableOldKeysOption)
 {
   rv = gcry_sexp_new (_old_key, cygwin_old_pubkey_sexpr, strlen 
(cygwin_old_pubkey_sexpr), 1);
   if (rv != GPG_ERR_NO_ERROR)
-- 
2.21.0



[PATCH setup 1/2] Implement paired boolean options

2020-03-19 Thread Jon Turney
Add some infrastructure for options which may appear with multiple
prefixes.

Add an implementation of paired boolean options like '--enable-foo' and
'--disable-foo', or '--bar' and '--no-bar'.

Add/fix tests
---
 libgetopt++/include/getopt++/BoolOption.h | 17 +--
 libgetopt++/include/getopt++/Option.h |  6 ++-
 libgetopt++/include/getopt++/OptionSet.h  |  3 +-
 .../include/getopt++/StringArrayOption.h  |  2 +-
 libgetopt++/include/getopt++/StringOption.h   |  2 +-
 libgetopt++/src/BoolOption.cc | 40 ---
 libgetopt++/src/Option.cc |  7 +++
 libgetopt++/src/OptionSet.cc  | 50 ---
 libgetopt++/src/StringArrayOption.cc  |  2 +-
 libgetopt++/src/StringOption.cc   |  2 +-
 libgetopt++/tests/BoolOptionTest.cc   | 26 --
 libgetopt++/tests/OptionSet.cc|  4 +-
 12 files changed, 118 insertions(+), 43 deletions(-)

diff --git a/libgetopt++/include/getopt++/BoolOption.h 
b/libgetopt++/include/getopt++/BoolOption.h
index 35227cb..8b20e1c 100644
--- a/libgetopt++/include/getopt++/BoolOption.h
+++ b/libgetopt++/include/getopt++/BoolOption.h
@@ -23,17 +23,25 @@
 class BoolOption : public Option
 {
 public:
+  enum class BoolOptionType
+{
+ simple,
+ pairedAble,
+ pairedNo,
+};
+
   BoolOption(bool const defaultvalue, char shortopt, char const *longopt = 0,
-std::string const  = std::string(), 
-OptionSet =GetOption::GetInstance());
+ std::string const  = std::string(),
+ BoolOptionType type = BoolOptionType::simple,
+ OptionSet =GetOption::GetInstance());
   virtual ~ BoolOption ();
   virtual std::string const shortOption () const;
   virtual std::string const longOption () const;
+  virtual std::vector const & longOptionPrefixes () const;
   virtual std::string const shortHelp () const;
-  virtual Result Process (char const *);
+  virtual Result Process (char const *, int);
   virtual Argument argument () const;
   operator bool () const;
- 
 
 private:
   bool _value;
@@ -41,6 +49,7 @@ private:
   char _shortopt;
   char const *_longopt;
   std::string _shorthelp;
+  BoolOptionType _type;
 };
 
 #endif // _BOOLOPTION_H_
diff --git a/libgetopt++/include/getopt++/Option.h 
b/libgetopt++/include/getopt++/Option.h
index a32f949..b3b140f 100644
--- a/libgetopt++/include/getopt++/Option.h
+++ b/libgetopt++/include/getopt++/Option.h
@@ -21,9 +21,10 @@
 #endif
 #if HAVE_STRING_H
 #include 
-#else 
+#else
 #error " required"
 #endif
+#include 
 
 // Each registered option must implement this class.
 class Option
@@ -32,13 +33,14 @@ public:
   virtual ~ Option ();
   virtual std::string const shortOption () const = 0;
   virtual std::string const longOption () const = 0;
+  virtual std::vector const & longOptionPrefixes () const;
   virtual std::string const shortHelp () const = 0;
   enum Result {
   Failed,
   Ok,
   Stop
   };
-  virtual Result Process (char const *) = 0;
+  virtual Result Process (char const *, int) = 0;
   enum Argument {
   None,
   Optional,
diff --git a/libgetopt++/include/getopt++/OptionSet.h 
b/libgetopt++/include/getopt++/OptionSet.h
index 4ccadda..dbd8046 100644
--- a/libgetopt++/include/getopt++/OptionSet.h
+++ b/libgetopt++/include/getopt++/OptionSet.h
@@ -44,7 +44,8 @@ private:
   bool isOption(std::string::size_type) const;
   void doOption(std::string , std::string::size_type const );
   bool doNoArgumentOption(std::string , std::string::size_type const 
);
-  Option * findOption(std::string , std::string::size_type const ) 
const;
+  void findOption(std::string , std::string::size_type const ,
+  Option *, int & prefixIndex) const;
   std::vector options;
   std::vector argv;
   std::vector nonoptions;
diff --git a/libgetopt++/include/getopt++/StringArrayOption.h 
b/libgetopt++/include/getopt++/StringArrayOption.h
index d3f87c0..b589d28 100644
--- a/libgetopt++/include/getopt++/StringArrayOption.h
+++ b/libgetopt++/include/getopt++/StringArrayOption.h
@@ -29,7 +29,7 @@ public:
   virtual std::string const shortOption () const;
   virtual std::string const longOption () const;
   virtual std::string const shortHelp () const;
-  virtual Result Process (char const *);
+  virtual Result Process (char const *, int);
   virtual Argument argument () const;
   operator std::vector () const;
 
diff --git a/libgetopt++/include/getopt++/StringOption.h 
b/libgetopt++/include/getopt++/StringOption.h
index f13be8c..37e723a 100644
--- a/libgetopt++/include/getopt++/StringOption.h
+++ b/libgetopt++/include/getopt++/StringOption.h
@@ -30,7 +30,7 @@ public:
   virtual std::string const shortOption () const;
   virtual std::string const longOption () const;
   virtual std::string const shortHelp () const;
-  virtual Result Process (char const *);
+  virtual Result Process (char const *, int);
   virtual Argument argument () const;
   operator 

[PATCH setup 0/2] Disable old Cygwin setup signing key by default

2020-03-19 Thread Jon Turney
Jon Turney (2):
  Implement paired boolean options
  Disable old Cygwin setup signing key by default

 crypto.cc |  7 +--
 libgetopt++/include/getopt++/BoolOption.h | 17 +--
 libgetopt++/include/getopt++/Option.h |  6 ++-
 libgetopt++/include/getopt++/OptionSet.h  |  3 +-
 .../include/getopt++/StringArrayOption.h  |  2 +-
 libgetopt++/include/getopt++/StringOption.h   |  2 +-
 libgetopt++/src/BoolOption.cc | 40 ---
 libgetopt++/src/Option.cc |  7 +++
 libgetopt++/src/OptionSet.cc  | 50 ---
 libgetopt++/src/StringArrayOption.cc  |  2 +-
 libgetopt++/src/StringOption.cc   |  2 +-
 libgetopt++/tests/BoolOptionTest.cc   | 26 --
 libgetopt++/tests/OptionSet.cc|  4 +-
 13 files changed, 122 insertions(+), 46 deletions(-)

-- 
2.21.0



wxPython 3.0.1 needs a rebuild and issues building 4.0

2020-03-19 Thread Hamish McIntyre-Bhatty via Cygwin-apps
Hello,

Just making a note here that wxPython 3 seems to need a rebuild - it
complains about an ABI mismatch with wxwidgets when starting, but does
seem to work okay once started.

Would also like to ask if anyone here could help with building wxPython
4 (Phoenix) in Cygwin. There's a relatively long thread between me and
Robin Dunn at
https://discuss.wxpython.org/t/building-wxpython-4-0-1-in-cygwin/30680/29
where we were methodically going through and trying to fix the build
issues, but we hit a bit of a roadblock. I shall have some time to work
on this soon, but I thought that one of you will probably have found and
fixed issues like this in the past and may have some insights.

Hamish McIntyre-Bhatty



0x87B761FE07F548D6.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature