[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-announce
Subject:    New pg_msvc_generator tool available
From:       Julien Rouhaud via PostgreSQL Announce <announce-noreply () postgresql ! org>
Date:       2021-08-24 20:10:57
Message-ID: 162983585743.28123.385911417186757165 () wrigleys ! postgresql ! org
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hello,

I'm pleased to announce the release of pg_msvc_generator, version 1.0.0 beta.

[pg_msvc_generator](https://github.com/rjuju/pg_msvc_generator) is a new tool created \
to help extension authors to provide Windows versions of their extensions.  It's \
written in Perl and is open source with a PostgreSQL license.

You can refer to the [project's \
README](https://github.com/rjuju/pg_msvc_generator/blob/master/README.md) for a \
complete description, or the [bug \
tracker](https://github.com/rjuju/pg_msvc_generator/issues) if you experience any \
problem.

This tool is composed of 2 scripts:

* pg_msvc_generator.pl
* release.pl

The main `pg_msvc_generator.pl` script will generate an msvc subdirectory in the \
given extension directory, containing the required **.sln** and **.vcxproj** files to \
be able to compile the extension using Visual Studio 2019, with support for \
Debug/Release and 32/64 bits builds. It will also create copy the `release.pl` and \
generate a `build.bat` scripts that can automatically compile and create release \
archive files and installers for all locally installed PostgreSQL versions.

### Usage

    pg_msvc_generator.pl [ options ]
    
    Options:

    --default version pgver  : default PostgreSQL version. This is only used
                if you compile the project without specifying a specific major
                version, or when the project is opened with Visual Studio
                IDE.  If not provided, a default value based on the year will
                be chosen (13 for 2021, 14 for 2022 and so on).
    -d | --dir ext_directory : root directory of the extension source code.
    -e | --extension         : extension name.  If not provided, the extension
                name will be assumed using the last part of the given root
                directory.
    -h | --help              : Show this message.


For instance:

```
pg_msvc_generator.pl -d C:\git\hypopg
```

### Requirements

**At project generation time**:

  - A Windows host with Perl installed to generate the project files

**At extension compilation time**:

  - Perl
  - Visual Studio 2019
  - All major PostgreSQL versions for which you want to build the extension,
    installed from PGDG packages in the default location
    (`C:\Program Files\PostgreSQL\$MAJOR_VERSION`)
  - Optionally, NSIS installed in the default location
    (`C:\Program Files (x86)\NSIS) to generate installers

### Doing a release of your extension

All you need to do is to execute the `msvc\release.bat` script.  It will setup
the MSVC environment and call the `release.pl` script.  That script will
prepare everything for a release under a
`msvc\${extension_name}-${extension_version}` directory.

It will automatically find the installed PostgreSQL version reading the
`HKLM/SOFTWARE/PostgreSQL/Installations/` registry, compile the extension with
all those versions and for each will generate a subdirectory containing the dll
and the SQL scripts if any, a zip archive with the same content and optionally an \
installer.

For instance, assuming that you have PostgreSQL 12 and 13 installed and
released HypoPG 1.3.2 and NSIS installed, your `msvc` directory will now have
this additional content:

* msvc\hypopg-1.3.2\12-x64\lib\hypopg.dll
* msvc\hypopg-1.3.2\12-x64\share\extension\hypopg.control
* msvc\hypopg-1.3.2\12-x64\share\extension\\*.sql
* msvc\hypopg-1.3.2\13-x64\lib\hypopg.dll
* msvc\hypopg-1.3.2\13-x64\share\extension\hypopg.control
* msvc\hypopg-1.3.2\13-x64\share\extension\\*.sql
* msvc\hypopg-1.3.2\hypopg-1.3.2-pg12-x64.exe
* msvc\hypopg-1.3.2\hypopg-1.3.2-pg12-x64.zip
* msvc\hypopg-1.3.2\hypopg-1.3.2-pg13-x64.exe
* msvc\hypopg-1.3.2\hypopg-1.3.2-pg13-x64.zip


### Installer

If you have [NSIS](https://nsis.sourceforge.io/) installed in the default
location (`C:\Program Files (x86)\NSIS`), the `release.pl` script will generate
a `.nsi` file and compile it using **makensis.exe** to generate an specific
installer for each PostgreSQL major versions found when running the
`release.pl` script.  At execution time, the installer will try to discover the
server's PostgreSQL installation path by reading the registry key
**HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-$architecture-$majorversion\Base
 Directory**.

If the key is found, the installer will inform the user and use it as the
default installation location.  Otherwise, the installer will inform the user
that no installation was automatically found and will force the user to choose
a location before being able to continue the installation.


[Attachment #5 (text/html)]

<!doctype html>
<html>
  <head>
    <meta name="viewport" content="width=device-width">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>New pg_msvc_generator tool available</title>
    <style>

    @media only screen and (max-width: 620px) {
      table[class=body] h1 {
        font-size: 28px !important;
        margin-bottom: 10px !important;
      }
      table[class=body] p,
            table[class=body] ul,
            table[class=body] ol,
            table[class=body] td,
            table[class=body] span,
            table[class=body] a {
        font-size: 16px !important;
      }
      table[class=body] .wrapper,
            table[class=body] .article {
        padding: 10px !important;
      }
      table[class=body] .content {
        padding: 0 !important;
      }
      table[class=body] .container {
        padding: 0 !important;
        width: 100% !important;
      }
      table[class=body] .main {
        border-left-width: 0 !important;
        border-radius: 0 !important;
        border-right-width: 0 !important;
      }
      table[class=body] .btn table {
        width: 100% !important;
      }
      table[class=body] .btn a {
        width: 100% !important;
      }
      table[class=body] .img-responsive {
        height: auto !important;
        max-width: 100% !important;
        width: auto !important;
      }
    }

    @media all {
      .ExternalClass {
        width: 100%;
      }
      .ExternalClass,
            .ExternalClass p,
            .ExternalClass span,
            .ExternalClass font,
            .ExternalClass td,
            .ExternalClass div {
        line-height: 100%;
      }
      .apple-link a {
        color: inherit !important;
        font-family: inherit !important;
        font-size: inherit !important;
        font-weight: inherit !important;
        line-height: inherit !important;
        text-decoration: none !important;
      }
      #MessageViewBody a {
        color: inherit;
        text-decoration: none;
        font-size: inherit;
        font-family: inherit;
        font-weight: inherit;
        line-height: inherit;
      }
      .btn-primary table td:hover {
        background-color: #34495e !important;
      }
      .btn-primary a:hover {
        background-color: #34495e !important;
        border-color: #34495e !important;
      }
    }
    </style>
  </head>
  <body class="" style="background-color: #f6f6f6; font-family: sans-serif; \
-webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.4; margin: 0; \
padding: 0; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;">  <table \
border="0" cellpadding="0" cellspacing="0" class="body" style="border-collapse: \
separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; \
background-color: #f6f6f6;">  <tr>
        <td style="font-family: sans-serif; font-size: 14px; vertical-align: \
top;">&nbsp;</td>  <td class="container" style="font-family: sans-serif; font-size: \
14px; vertical-align: top; display: block; Margin: 0 auto; max-width: 580px; padding: \
                10px; width: 580px;">
          <div class="content" style="box-sizing: border-box; display: block; Margin: \
0 auto; max-width: 580px; padding: 10px;">


            <span class="preheader" style="color: transparent; display: none; height: \
0; max-height: 0; max-width: 0; opacity: 0; overflow: hidden; mso-hide: all; \
visibility: hidden; width: 0;"></span>  <table class="main" style="border-collapse: \
separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background: \
#ffffff; border-radius: 3px;">


              <tr>
                <td class="wrapper" style="font-family: sans-serif; font-size: 14px; \
                vertical-align: top; box-sizing: border-box; padding: 20px;">
                  <table border="0" cellpadding="0" cellspacing="0" \
style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; \
width: 100%;">  <tr>
                      <td style="font-family: sans-serif; font-size: 14px; \
vertical-align: top;">

<div>
<h1 style="color: #000; font-family: sans-serif; line-height: 1.4; margin: 0; \
margin-bottom: 30px; font-size: 25px; font-weight: 300; text-align: center">New \
pg_msvc_generator tool available</h1> </div>
<p style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; \
margin-bottom: 15px">Hello,</p> <p style="font-family: sans-serif; font-size: 14px; \
font-weight: normal; margin: 0; margin-bottom: 15px">I'm pleased to announce the \
release of pg_msvc_generator, version 1.0.0 beta.</p> <p style="font-family: \
sans-serif; font-size: 14px; font-weight: normal; margin: 0; margin-bottom: 15px"><a \
href="https://github.com/rjuju/pg_msvc_generator" style="color: #3498db; \
text-decoration: underline">pg_msvc_generator</a> is a new tool created to help \
extension authors to provide Windows versions of their extensions.  It's written in \
Perl and is open source with a PostgreSQL license.</p> <p style="font-family: \
sans-serif; font-size: 14px; font-weight: normal; margin: 0; margin-bottom: 15px">You \
can refer to the <a href="https://github.com/rjuju/pg_msvc_generator/blob/master/README.md" \
style="color: #3498db; text-decoration: underline">project's README</a> for a \
complete description, or the <a \
href="https://github.com/rjuju/pg_msvc_generator/issues" style="color: #3498db; \
text-decoration: underline">bug tracker</a> if you experience any problem.</p> <p \
style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; \
margin-bottom: 15px">This tool is composed of 2 scripts:</p> <ul style="font-family: \
sans-serif; font-size: 14px; font-weight: normal; margin: 0; margin-bottom: 15px"> \
<li style="list-style-position: inside; margin-left: 5px">pg_msvc_generator.pl</li> \
<li style="list-style-position: inside; margin-left: 5px">release.pl</li> </ul>
<p style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; \
margin-bottom: 15px">The main <code>pg_msvc_generator.pl</code> script will generate \
an msvc subdirectory in the given extension directory, containing the required \
<strong>.sln</strong> and <strong>.vcxproj</strong> files to be able to compile the \
extension using Visual Studio 2019, with support for Debug/Release and 32/64 bits \
builds. It will also create copy the <code>release.pl</code> and generate a \
<code>build.bat</code> scripts that can automatically compile and create release \
archive files and installers for all locally installed PostgreSQL versions.</p> <h3 \
style="color: #000; font-family: sans-serif; font-weight: 400; line-height: 1.4; \
margin: 0; margin-bottom: 30px">Usage</h3> <pre><code>pg_msvc_generator.pl [ options \
]

Options:

--default version pgver  : default PostgreSQL version. This is only used
            if you compile the project without specifying a specific major
            version, or when the project is opened with Visual Studio
            IDE.  If not provided, a default value based on the year will
            be chosen (13 for 2021, 14 for 2022 and so on).
-d | --dir ext_directory : root directory of the extension source code.
-e | --extension         : extension name.  If not provided, the extension
            name will be assumed using the last part of the given root
            directory.
-h | --help              : Show this message.
</code></pre>
<p style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; \
margin-bottom: 15px">For instance:</p> <p style="font-family: sans-serif; font-size: \
14px; font-weight: normal; margin: 0; margin-bottom: 15px"><code>pg_msvc_generator.pl \
-d C:\git\hypopg</code></p> <h3 style="color: #000; font-family: sans-serif; \
font-weight: 400; line-height: 1.4; margin: 0; margin-bottom: 30px">Requirements</h3> \
<p style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; \
margin-bottom: 15px"><strong>At project generation time</strong>:</p> <ul \
style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; \
margin-bottom: 15px"> <li style="list-style-position: inside; margin-left: 5px">A \
Windows host with Perl installed to generate the project files</li> </ul>
<p style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; \
margin-bottom: 15px"><strong>At extension compilation time</strong>:</p> <ul \
style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; \
margin-bottom: 15px"> <li style="list-style-position: inside; margin-left: \
5px">Perl</li> <li style="list-style-position: inside; margin-left: 5px">Visual \
Studio 2019</li> <li style="list-style-position: inside; margin-left: 5px">All major \
PostgreSQL versions for which you want to build the extension,  installed from PGDG \
packages in the default location  (<code>C:\Program \
Files\PostgreSQL\$MAJOR_VERSION</code>)</li> <li style="list-style-position: inside; \
margin-left: 5px">Optionally, NSIS installed in the default location  (`C:\Program \
Files (x86)\NSIS) to generate installers</li> </ul>
<h3 style="color: #000; font-family: sans-serif; font-weight: 400; line-height: 1.4; \
margin: 0; margin-bottom: 30px">Doing a release of your extension</h3> <p \
style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; \
margin-bottom: 15px">All you need to do is to execute the \
<code>msvc\release.bat</code> script.  It will setup the MSVC environment and call \
the <code>release.pl</code> script.  That script will prepare everything for a \
release under a <code>msvc\${extension_name}-${extension_version}</code> \
directory.</p> <p style="font-family: sans-serif; font-size: 14px; font-weight: \
normal; margin: 0; margin-bottom: 15px">It will automatically find the installed \
PostgreSQL version reading the <code>HKLM/SOFTWARE/PostgreSQL/Installations/</code> \
registry, compile the extension with all those versions and for each will generate a \
subdirectory containing the dll and the SQL scripts if any, a zip archive with the \
same content and optionally an installer.</p> <p style="font-family: sans-serif; \
font-size: 14px; font-weight: normal; margin: 0; margin-bottom: 15px">For instance, \
assuming that you have PostgreSQL 12 and 13 installed and released HypoPG 1.3.2 and \
NSIS installed, your <code>msvc</code> directory will now have this additional \
content:</p> <ul style="font-family: sans-serif; font-size: 14px; font-weight: \
normal; margin: 0; margin-bottom: 15px"> <li style="list-style-position: inside; \
margin-left: 5px">msvc\hypopg-1.3.2\12-x64\lib\hypopg.dll</li> <li \
style="list-style-position: inside; margin-left: \
5px">msvc\hypopg-1.3.2\12-x64\share\extension\hypopg.control</li> <li \
style="list-style-position: inside; margin-left: \
5px">msvc\hypopg-1.3.2\12-x64\share\extension\*.sql</li> <li \
style="list-style-position: inside; margin-left: \
5px">msvc\hypopg-1.3.2\13-x64\lib\hypopg.dll</li> <li style="list-style-position: \
inside; margin-left: \
5px">msvc\hypopg-1.3.2\13-x64\share\extension\hypopg.control</li> <li \
style="list-style-position: inside; margin-left: \
5px">msvc\hypopg-1.3.2\13-x64\share\extension\*.sql</li> <li \
style="list-style-position: inside; margin-left: \
5px">msvc\hypopg-1.3.2\hypopg-1.3.2-pg12-x64.exe</li> <li style="list-style-position: \
inside; margin-left: 5px">msvc\hypopg-1.3.2\hypopg-1.3.2-pg12-x64.zip</li> <li \
style="list-style-position: inside; margin-left: \
5px">msvc\hypopg-1.3.2\hypopg-1.3.2-pg13-x64.exe</li> <li style="list-style-position: \
inside; margin-left: 5px">msvc\hypopg-1.3.2\hypopg-1.3.2-pg13-x64.zip</li> </ul>
<h3 style="color: #000; font-family: sans-serif; font-weight: 400; line-height: 1.4; \
margin: 0; margin-bottom: 30px">Installer</h3> <p style="font-family: sans-serif; \
font-size: 14px; font-weight: normal; margin: 0; margin-bottom: 15px">If you have <a \
href="https://nsis.sourceforge.io/" style="color: #3498db; text-decoration: \
underline">NSIS</a> installed in the default location (<code>C:\Program Files \
(x86)\NSIS</code>), the <code>release.pl</code> script will generate a \
<code>.nsi</code> file and compile it using <strong>makensis.exe</strong> to generate \
an specific installer for each PostgreSQL major versions found when running the
<code>release.pl</code> script.  At execution time, the installer will try to \
discover the server's PostgreSQL installation path by reading the registry key
<strong>HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-$architecture-$majorversion\Base
 Directory</strong>.</p>
<p style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; \
margin-bottom: 15px">If the key is found, the installer will inform the user and use \
it as the default installation location.  Otherwise, the installer will inform the \
user that no installation was automatically found and will force the user to choose
a location before being able to continue the installation.</p>

                      </td>
                    </tr>
                  </table>
                </td>
              </tr>

            </table>

            <div class="footer" style="clear: both; Margin-top: 10px; text-align: \
                center; width: 100%;">
              <table border="0" cellpadding="0" cellspacing="0" \
style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; \
width: 100%;">  <tr>
                  <td class="content-block" style="font-family: sans-serif; \
vertical-align: top; padding-bottom: 10px; padding-top: 10px; font-size: 12px; color: \
                #999999; text-align: center;">
                    <span class="apple-link" style="color: #999999; font-size: 12px; \
text-align: center;"> This email was sent to you from Julien Rouhaud. It was \
delivered on their behalf by the PostgreSQL project. Any questions about the content \
of the message should be sent to Julien Rouhaud.
</span>
		    <br><br>
You were sent this email as a subscriber of the <em>pgsql-announce</em> mailinglist, \
for the content tag Related Open Source.
To unsubscribe from
further emails, or change which emails you want to receive, please click the personal \
unsubscribe link that you can find in the headers of this email, or visit
<a href="https://lists.postgresql.org/unsubscribe/" style="color: #3498db; \
text-decoration: underline">https://lists.postgresql.org/unsubscribe/</a>.

                  </td>
                </tr>
              </table>
            </div>

          </div>
        </td>
        <td style="font-family: sans-serif; font-size: 14px; vertical-align: \
top;">&nbsp;</td>  </tr>
    </table>
  </body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic