Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build openssl from source #38

Closed
132 changes: 93 additions & 39 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ env:
WORKFLOW_VERSION_POSTGRESQL: '1' # for build steps related to the 'cachePostgres' cache

# Software versions.
POSTGRESQL_SOURCE_TAG: 'REL_17_BETA2'
POSTGRESQL_SOURCE_TAG: 'REL_17_BETA3'
POSTGRESQL_PACKAGE_FILEID: '1259019'
OPENSSL_VERSION: '3_3_1'
OPENSSL_VERSION: '3.3.1'
PKGCONFIGLITE_VERSION: '0.28-1'
WINFLEXBISON_VERSION: '2.5.24'
DIFFUTILS_VERSION: '2.8.7-1'
Expand Down Expand Up @@ -92,20 +92,15 @@ jobs:
key: pkg-config-lite-${{env.PKGCONFIGLITE_VERSION}}-win32
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1
- name: Cache Win32OpenSSL32 for Win32Compile
if: ${{steps.cachePostgres.outputs.cache-hit != 'true'}}
uses: actions/cache@v4
id: cacheWin32OpenSSL
with:
path: C:\OTHERBIN\openssl32
key: Win32OpenSSL-${{env.OPENSSL_VERSION}}
- name: Cache Win64OpenSSL64 for Win64Compile

- name: Cache OpenSSL
if: ${{steps.cachePostgres.outputs.cache-hit != 'true'}}
uses: actions/cache@v4
id: cacheWin64OpenSSL
id: cacheOpenSSL
with:
path: C:\OTHERBIN\openssl64
key: Win64OpenSSL-${{env.OPENSSL_VERSION}}
key: OpenSSL-${{env.OPENSSL_VERSION}}

- name: Cache winflexbison for Compile using msvc
if: ${{steps.cachePostgres.outputs.cache-hit != 'true'}}
uses: actions/cache@v4
Expand All @@ -124,25 +119,94 @@ jobs:
retry-times: 5
url: https://zenlayer.dl.sourceforge.net/project/gnuwin32/diffutils/${{env.DIFFUTILS_VERSION}}/diffutils-${{env.DIFFUTILS_VERSION}}-bin.zip
filename: diffutils-bin.zip

- name: Download openssl32 for win32 compile
if: ${{steps.cacheWin32OpenSSL.outputs.cache-hit != 'true' && steps.cachePostgres.outputs.cache-hit != 'true'}}
- name: Download openssl source
if: ${{steps.cacheOpenSSL.outputs.cache-hit != 'true' && steps.cachePostgres.outputs.cache-hit != 'true'}}
uses: suisei-cn/[email protected]
id: downloadWin32OpenSSL
id: downloadOpenSSL
with:
retry-times: 5
url: https://slproweb.com/download/Win32OpenSSL-${{env.OPENSSL_VERSION}}.exe
filename: Win32OpenSSL.exe

- name: Download openssl64 for win64 compile
if: ${{steps.cacheWin64OpenSSL.outputs.cache-hit != 'true' && steps.cachePostgres.outputs.cache-hit != 'true'}}
uses: suisei-cn/[email protected]
id: downloadWin64OpenSSL
with:
retry-times: 5
url: https://slproweb.com/download/Win64OpenSSL-${{env.OPENSSL_VERSION}}.exe
filename: Win64OpenSSL.exe
url: https://www.openssl.org/source/openssl-${{env.OPENSSL_VERSION}}.tar.gz
filename: openssl-${{ env.OPENSSL_VERSION }}.tar.gz

- name: Configure OpenSSL
if: success()
run: |
tar xzvf openssl-${{ env.OPENSSL_VERSION }}.tar.gz
cd openssl-${{ env.OPENSSL_VERSION }}
perl Configure VC-WIN64A no-asm --prefix=C:\OTHERBIN\openssl64 no-ssl3 no-comp

- name: setup msvc 64
uses: TheMrMilchmann/setup-msvc-dev@v3
with:
arch: x64

- name: build openssl 64
run: |
cd openssl-${{ env.OPENSSL_VERSION }}
nmake

- name: install openssl 64
run: |
cd openssl-${{ env.OPENSSL_VERSION }}
mkdir c:\OTHERBIN\openssl64
nmake install

- name: Create openssl64 pkgconfig File
shell: cmd
run: |
mkdir c:\OTHERBIN\openssl64\lib\pkgconfig

>> c:\OTHERBIN\openssl64\lib\pkgconfig\openssl.pc echo prefix=${pcfiledir}/../..
>> c:\OTHERBIN\openssl64\lib\pkgconfig\openssl.pc echo exec_prefix=${prefix}
>> c:\OTHERBIN\openssl64\lib\pkgconfig\openssl.pc echo libdir=${prefix}/lib
>> c:\OTHERBIN\openssl64\lib\pkgconfig\openssl.pc echo includedir=${prefix}/include
>> c:\OTHERBIN\openssl64\lib\pkgconfig\openssl.pc echo.
>> c:\OTHERBIN\openssl64\lib\pkgconfig\openssl.pc echo Name: openssl
>> c:\OTHERBIN\openssl64\lib\pkgconfig\openssl.pc echo Description: openssl encryption library
>> c:\OTHERBIN\openssl64\lib\pkgconfig\openssl.pc echo Version: ${{ env.OPENSSL_VERSION }}
>> c:\OTHERBIN\openssl64\lib\pkgconfig\openssl.pc echo Libs: -L${libdir} -lcrypto -lssl
>> c:\OTHERBIN\openssl64\lib\pkgconfig\openssl.pc echo Cflags: -I${includedir}

- name: setup msvc 86
uses: TheMrMilchmann/setup-msvc-dev@v3
with:
arch: x86

- name: configure openssl 32
run: |
cd openssl-${{ env.OPENSSL_VERSION }}
nmake clean
perl Configure VC-WIN32 no-asm --prefix=C:\OTHERBIN\openssl32 no-ssl3 no-comp

- name: build openssl 32
run: |
cd openssl-${{ env.OPENSSL_VERSION }}
nmake

- name: install openssl 32
run: |
cd openssl-${{ env.OPENSSL_VERSION }}
mkdir c:\OTHERBIN\openssl32
nmake install

- name: Create openssl32 pkgconfig File
shell: cmd
run: |
mkdir c:\OTHERBIN\openssl32\lib\pkgconfig

>> c:\OTHERBIN\openssl32\lib\pkgconfig\openssl.pc echo prefix=${pcfiledir}/../..
>> c:\OTHERBIN\openssl32\lib\pkgconfig\openssl.pc echo exec_prefix=${prefix}
>> c:\OTHERBIN\openssl32\lib\pkgconfig\openssl.pc echo libdir=${prefix}/lib
>> c:\OTHERBIN\openssl32\lib\pkgconfig\openssl.pc echo includedir=${prefix}/include
>> c:\OTHERBIN\openssl32\lib\pkgconfig\openssl.pc echo.
>> c:\OTHERBIN\openssl32\lib\pkgconfig\openssl.pc echo Name: openssl
>> c:\OTHERBIN\openssl32\lib\pkgconfig\openssl.pc echo Description: openssl encryption library
>> c:\OTHERBIN\openssl32\lib\pkgconfig\openssl.pc echo Version: ${{ env.OPENSSL_VERSION }}
>> c:\OTHERBIN\openssl32\lib\pkgconfig\openssl.pc echo Libs: -L${libdir} -lcrypto -lssl
>> c:\OTHERBIN\openssl32\lib\pkgconfig\openssl.pc echo Cflags: -I${includedir}


- name: Download pkgconfiglite for Compile using msvc and meson
if: ${{steps.cachePkgConfigLiteZip.outputs.cache-hit != 'true' && steps.cachePostgres.outputs.cache-hit != 'true'}}
uses: suisei-cn/[email protected]
Expand Down Expand Up @@ -200,16 +264,6 @@ jobs:
rem - man7.org/linux/man-pages/man1/printf.1.html
printf "C:\\OTHERBIN\\pkgconfiglite\\pkg-config-lite-%PKGCONFIGLITE_VERSION%\\bin" >> %GITHUB_PATH%

- name: Install Win32OpenSSL
if: ${{steps.cacheWin32OpenSSL.outputs.cache-hit != 'true' && steps.cachePostgres.outputs.cache-hit != 'true'}}
shell: cmd
run: Win32OpenSSL.exe /sp /silent /dir=c:\OTHERBIN\openssl32

- name: Install Win64OpenSSL
if: ${{steps.cacheWin64OpenSSL.outputs.cache-hit != 'true' && steps.cachePostgres.outputs.cache-hit != 'true'}}
shell: cmd
run: Win64OpenSSL.exe /sp /silent /dir=c:\OTHERBIN\openssl64

# Choco Install winflexbison
# BUT the "crazy-max/ghaction-chocolatey@v2" "install pkgconfiglite" file download often times-out
- name: Extract winflexbison for Compile using msvc
Expand All @@ -236,7 +290,7 @@ jobs:
if: ${{steps.cachePostgres.outputs.cache-hit != 'true'}}
working-directory: postgres
run: |
meson setup buildx86 -Dssl=openssl -Dextra_lib_dirs=c:\OTHERBIN\openssl32\lib\VC\x86\MT -Dextra_include_dirs=c:\OTHERBIN\openssl32\include --prefix=d:\postgresql86
meson setup --wipe buildx86 -Dssl=openssl -Dextra_lib_dirs=c:\OTHERBIN\openssl32\lib -Dextra_include_dirs=c:\OTHERBIN\openssl32\include --prefix=d:\postgresql86
cd buildx86
ninja -v
ninja -v install
Expand All @@ -250,7 +304,7 @@ jobs:
if: ${{steps.cachePostgres.outputs.cache-hit != 'true'}}
working-directory: postgres
run: |
meson setup build -Dssl=openssl -Dextra_lib_dirs=c:\OTHERBIN\openssl64\lib\VC\x64\MT -Dextra_include_dirs=c:\OTHERBIN\openssl64\include --prefix=d:\postgresql
meson setup --wipe build -Dssl=openssl -Dextra_lib_dirs=c:\OTHERBIN\openssl64\lib -Dextra_include_dirs=c:\OTHERBIN\openssl64\include --prefix=d:\postgresql
cd build
ninja
ninja install
Expand Down
Loading