Skip to content

Win: replace Win 8.1 SDK with MSVS 2015 Build Tools component #52

Win: replace Win 8.1 SDK with MSVS 2015 Build Tools component

Win: replace Win 8.1 SDK with MSVS 2015 Build Tools component #52

Workflow file for this run

# Build, check and LDView
# Trevor SANDY <[email protected]>
# Last Update: September 09, 2024
# Copyright (C) 2022 - 2024 by Trevor SANDY
#
name: Build LDView
on:
push:
branches:
- lpub3d-build
jobs:
build-linux:
# if: ${{ false }} # uncomment to disable
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Work Paths
run: |
echo "LDRAWDIR=${HOME}/ldraw" >> ${GITHUB_ENV}
echo "LDV_DIST_DIR=lpub3d_linux_3rdparty" >> ${GITHUB_ENV}
echo "LDV_DIST_DIR_CREATE=${HOME}/work/ldview/ldview/lpub3d_linux_3rdparty" >> ${GITHUB_ENV}
- name: Development Packages
run: |
echo "Install development packages..."
$(cd QT; sed -e '/libqt4-dev/d' -e '/qt6-base-dev/d' -e '/^#Qt/d' -e '/qtbase5/s/^#//' -i debian/control)
chmod a+x QT/docker/install-devel-packages.sh && sudo ./QT/docker/install-devel-packages.sh
- name: Cache LDraw
id: cache-ldraw
uses: actions/cache@v4
with:
path: ${{ env.LDRAWDIR }}
key: ldraw-lib
- name: LDraw Library
run: |
if [ ! -d ${LDRAWDIR}/parts ]; then
echo "LDraw library not found at ${LDRAWDIR}. Downloading library..."
curl -s -O https://library.ldraw.org/library/updates/complete.zip
unzip -d ~/ -q complete.zip; rm complete.zip
if test -d ${LDRAWDIR}; then echo "LDraw library extracted, LDRAWDIR defined."; fi
else
echo "LDraw library defined at ${LDRAWDIR}."
fi
- name: Stdlib Patch
run: |
echo "Apply stdlib error patch to LDViewGlobal.pri..."
sed s/' # detect system libraries paths'/' # Suppress fatal error: stdlib.h: No such file or directory\n QMAKE_CFLAGS_ISYSTEM = -I\n\n # detect system libraries paths'/ -i LDViewGlobal.pri
- name: Build LDView
run: |
if [ ! -d "${LDV_DIST_DIR_CREATE}" ]; then mkdir -p "${LDV_DIST_DIR_CREATE}" && echo "${LDV_DIST_DIR_CREATE} created."; fi
qmake -v; $(cd QT ; sed -i 's/kdelibs5-dev, //g' debian/control)
qmake CONFIG+=3RD_PARTY_INSTALL=../${LDV_DIST_DIR} CONFIG+=release CONFIG+=BUILD_CUI_ONLY CONFIG+=USE_SYSTEM_LIBS CONFIG+=BUILD_CHECK
make && make install
build-windows:
# if: ${{ false }} # uncomment to disable
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Work Paths
run: |
Echo "LP3D_DIST_DIR_PATH=$(Join-Path (resolve-path ..\) 'lpub3d_windows_3rdparty')" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
Echo "LP3D_LDRAW_DIR_PATH=$(Join-Path (resolve-path $Env:USERPROFILE\) 'ldraw')" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
Echo "LP3D_3RD_PARTY_PATH=$(resolve-path ..\)" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
If ( -Not (Test-Path -Path $(Join-Path (resolve-path ..\) 'lpub3d_windows_3rdparty') ) ) { New-Item -ItemType directory -Path $(Join-Path (resolve-path ..\) 'lpub3d_windows_3rdparty') }
- name: Cache LDraw
id: cache-ldraw
uses: actions/cache@v4
with:
path: ${{ env.LP3D_LDRAW_DIR_PATH }}
key: ldraw-lib
- name: MSVS 2015 MSVC v140 Build Tools
run: |
Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
$InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
$componentsToAdd= @(
"Microsoft.VisualStudio.Component.VC.140"
)
[string]$workloadArgs = $componentsToAdd | ForEach-Object {" --add " + $_}
$Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",$workloadArgs, '--quiet', '--norestart', '--nocache')
# should be run twice
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
shell: powershell
- name: Build LDView
shell: cmd
run: .\build.cmd -all -chk
build-macos:
# if: ${{ false }} # uncomment to disable
runs-on: macos-13
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Work Paths
run: |
echo "LDRAWDIR=${HOME}/Library/ldraw" >> ${GITHUB_ENV}
echo "LDV_DIST_DIR=lpub3d_macos_3rdparty" >> ${GITHUB_ENV}
echo "LDV_DIST_DIR_CREATE=${HOME}/work/ldview/ldview/lpub3d_macos_3rdparty" >> ${GITHUB_ENV}
- name: Development Packages
run: |
echo "/usr/local/opt/ccache/libexec" >> ${GITHUB_PATH}
echo "Install development packages..."
brew install grep ccache tinyxml gl2ps minizip qt@5
brew link --force qt@5;
if [[ -d /usr/X11/lib && /usr/X11/include ]]; then echo "Good to go - X11 found."; else brew install --cask xquartz; fi
- name: Cache LDraw
id: cache-ldraw
uses: actions/cache@v4
with:
path: ${{ env.LDRAWDIR }}
key: ldraw-lib
- name: LDraw Library
run: |
if [ ! -d ${LDRAWDIR}/parts ]; then
echo "LDraw library not found at ${LDRAWDIR}. Downloading library..."
curl -s -O https://library.ldraw.org/library/updates/complete.zip
unzip -d ~/Library -q complete.zip; rm complete.zip
if test -d ${LDRAWDIR}; then echo "LDraw library extracted, LDRAWDIR defined."; fi
fi
echo "set LDRAWDIR in environment.plist..."
chmod a+x QT/set-ldrawdir.command && sudo ./QT/set-ldrawdir.command
grep -A1 -e 'LDRAWDIR' ~/.MacOSX/environment.plist
echo "LDraw library defined at ${LDRAWDIR}."
- name: Build LDView
run: |
if [ ! -d "${LDV_DIST_DIR_CREATE}" ]; then mkdir -p "${LDV_DIST_DIR_CREATE}" && echo "${LDV_DIST_DIR_CREATE} created."; fi
qmake -v
qmake CONFIG+=3RD_PARTY_INSTALL=../${LDV_DIST_DIR} CONFIG+=release CONFIG+=BUILD_CUI_ONLY CONFIG+=USE_SYSTEM_LIBS CONFIG+=BUILD_CHECK
make && make install