13 Commits

6 changed files with 93 additions and 99 deletions

View File

@ -20,29 +20,30 @@
name: C/C++ CI (DOS DJGPP)
on: workflow_dispatch
on:
workflow_call:
env:
CMAKE_C_COMPILER: ${{ github.workspace }}/djgpp/bin/i586-pc-msdosdjgpp-gcc
CMAKE_CXX_COMPILER: ${{ github.workspace }}/djgpp/bin/i586-pc-msdosdjgpp-g++
CC: ${{ github.workspace }}/djgpp/bin/i586-pc-msdosdjgpp-gcc
CXX: ${{ github.workspace }}/djgpp/bin/i586-pc-msdosdjgpp-g++
CMAKE_FIND_ROOT_PATH: ${{ github.workspace }}/djgpp
CMAKE_FIND_ROOT_PATH_MODE_PROGRAM: NEVER
CMAKE_FIND_ROOT_PATH_MODE_LIBRARY: ONLY
CMAKE_FIND_ROOT_PATH_MODE_INCLUDE: ONLY
CMAKE_FIND_ROOT_PATH_MODE_PACKAGE: ONLY
WATT_ROOT: ${{ github.workspace }}/djgpp/watt32
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Source Tree
uses: actions/checkout@v3
- name: Setup build environment
run: |
sudo apt -y update
sudo apt -y install build-essential cmake wget 7zip git flex nasm libslang2-dev pkg-config libslang2-modules gcc-multilib
sudo apt -y install build-essential cmake wget 7zip git flex libfl-dev nasm libslang2-dev pkg-config libslang2-modules gcc-multilib
- name: Download and Setup DJGPP Toolchain
run: |
pushd ${{ github.workspace }}
wget https://github.com/andrewwutw/build-djgpp/releases/download/v3.4/djgpp-linux64-gcc1220.tar.bz2
tar xjf djgpp-linux64-gcc1220.tar.bz2
cd ${{ github.workspace }}/djgpp
@ -50,40 +51,34 @@ jobs:
cd watt32/util
make clean && make linux
cd ../src
source ${{ github.workspace }}/djgpp/setenv.sh
source ${{ github.workspace }}/djgpp/setenv
./configur.sh djgpp
make -f djgpp.mak
ln -s ${{ github.workspace }}/djgpp/watt32/lib/libwatt.a ${{ github.workspace }}/djgpp/lib
ln -s ${WATT_ROOT}/lib/libwatt.a ${{ github.workspace }}/djgpp/lib
- name: Checkout and Cross Compile OpenSSL 3.1
- name: Checkout and Cross Compile OpenSSL 3.1.2
run: |
git clone https://github.com/UMSKT/openssl.git openssl
pushd openssl
git checkout openssl-3.1.1
source ${{ github.workspace }}/djgpp/setenv
./Configure no-threads -DOPENSSL_DEV_NO_ATOMICS --prefix=${{ github.workspace }}/djgpp DJGPP
make && make install
popd
- name: Checkout Source Tree
uses: actions/checkout@v3
- name: Build
uses: threeal/cmake-action@v1.2.0
with:
c-compiler: ${{ github.workspace }}/djgpp/i586-pc-msdosdjgpp/bin/gcc
cxx-compiler: ${{ github.workspace }}/djgpp/i586-pc-msdosdjgpp/bin/g++
options: OPENSSL_ROOT_DIR:string=${{ github.workspace }}/djgpp DJGPP_WATT32=ON
run-build: true
run: |
source ${{ github.workspace }}/djgpp/setenv
pushd build
cmake ../ -D DJGPP_WATT32=${WATT_ROOT}/lib/libwatt.a -D CMAKE_FIND_ROOT_PATH=${CMAKE_FIND_ROOT_PATH}
make
- name: Move files to correct directory
- name: Move executable to upload directory
run: |
mkdir build/actions_upload
tar -czf WindowsXPKg_linux_x86_64.tar.gz -C build xpkey keys.json
mv WindowsXPKg_linux_x86_64.tgz build/actions_upload/
mv build/umskt.exe build/actions_upload/
- name: Upload build artifact
uses: actions/upload-artifact@v3.1.2
with:
name: Build
name: UMSKT-DOS
path: build/actions_upload

View File

@ -60,7 +60,7 @@ jobs:
run-build: true
shell: alpine-target.sh {0}
- name: Move files to correct directory
- name: Move executable to upload directory
run: |
mkdir -p build/actions_upload
mv build/umskt build/actions_upload/umskt

View File

@ -27,90 +27,91 @@ on:
branches: [ "master" ]
jobs:
build-32bit:
build-djgpp:
uses: ./.github/workflows/dos-djgpp.yml
build:
runs-on: windows-latest
needs: build-djgpp
strategy:
matrix:
include:
- arch: Win32
OpenSSL-File: Win32OpenSSL-3_1_1.exe
msbuild-arch: Win32
cmake-args: -D MSVC_MSDOS_STUB=..\umskt.exe
- arch: Win64
OpenSSL-File: Win64OpenSSL-3_1_1.exe
msbuild-arch: x64
cmake-args: ""
steps:
- name: Install v141_xp
- name: Checkout Source Tree
uses: actions/checkout@v3
- name: Install Windows XP Support for Visual Studio
uses: thepwrtank18/install-vs-components@v1.0.0
with:
components: Microsoft.VisualStudio.Component.WinXP
- name: Download And Install 32-bit OpenSSL 3.1.1
- name: Download And Install ${{ matrix.OpenSSL-File }}
run: |
$installDir = "$Env:ProgramFiles\OpenSSL"
$installerURL = "https://slproweb.com/download/Win32OpenSSL-3_1_1.exe"
$installerName = "Win32OpenSSL-3_1_1.exe"
$installerURL = "https://slproweb.com/download/${{ matrix.OpenSSL-File }}"
$installerName = "${{ matrix.OpenSSL-File }}"
$installerPath = Join-Path -Path "${env:Temp}" -ChildPath "$installerName"
(New-Object System.Net.WebClient).DownloadFile($installerURL, $installerPath)
Remove-Item "$installDir" -Force -Recurse
$installerArgs = '/silent', '/sp-', '/suppressmsgboxes', "/DIR=`"$installDir`""
Start-Process -FilePath $installerPath -ArgumentList $installerArgs -Wait -PassThru
- name: Checkout Source Tree
uses: actions/checkout@v3
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1
- name: Download UMSKT-DJGPP compiled artifact
if: matrix.arch == 'Win32'
uses: actions/download-artifact@v3
with:
name: UMSKT-DOS
- name: List build directory contents
if: matrix.arch == 'Win32'
run: |
Get-ChildItem
- name: Configure UMSKT
uses: threeal/cmake-action@v1.2.0
with:
working-directory: build
generator: "Visual Studio 17 2022"
options: CMAKE_SYSTEM_VERSION="5.1.2600"
args: -A "Win32" -T v141_xp
args: -A ${{ matrix.msbuild-arch }} -T v141_xp ${{ matrix.cmake-args }}
- name: Build UMSKT
working-directory: build
run: msbuild ALL_BUILD.vcxproj /P:Configuration=Release /P:XPDeprecationWarning=false
- name: Upload build artifact
uses: actions/upload-artifact@v3.1.2
with:
name: UMSKT-Win32
path: build/Release
build-64bit:
runs-on: windows-latest
steps:
- name: Install v141_xp
uses: thepwrtank18/install-vs-components@v1.0.0
with:
components: Microsoft.VisualStudio.Component.WinXP
- name: Download And Install 64-bit OpenSSL 3.1.1
- name: Move executable to upload directory
run: |
$installDir = "$Env:ProgramFiles\OpenSSL"
$installerURL = "https://slproweb.com/download/Win64OpenSSL-3_1_1.exe"
$installerName = "Win64OpenSSL-3_1_1.exe"
$installerPath = Join-Path -Path "${env:Temp}" -ChildPath "$installerName"
(New-Object System.Net.WebClient).DownloadFile($installerURL, $installerPath)
Remove-Item "$installDir" -Force -Recurse
$installerArgs = '/silent', '/sp-', '/suppressmsgboxes', "/DIR=`"$installDir`""
Start-Process -FilePath $installerPath -ArgumentList $installerArgs -Wait -PassThru
- name: Checkout Source Tree
uses: actions/checkout@v3
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1
- name: Configure UMSKT
uses: threeal/cmake-action@v1.2.0
with:
generator: "Visual Studio 17 2022"
args: -A "x64" -T v141_xp
- name: Build UMSKT
working-directory: build
run: msbuild ALL_BUILD.vcxproj /P:Configuration=Release /P:XPDeprecationWarning=false
mkdir build/actions_upload
Move-Item build/Release/umskt.exe build/actions_upload
- name: Upload build artifact
uses: actions/upload-artifact@v3.1.2
with:
name: UMSKT-Win64
path: build/Release
name: UMSKT-${{ matrix.arch }}
path: build/actions_upload
- name: Move Win32+DOS executable to upload directory
if: matrix.arch == 'Win32'
run: |
Remove-Item "build/actions_upload" -Force -Recurse
mkdir build/actions_upload
Move-Item build/Release/umskt_win32_dos.exe build/actions_upload/umskt.exe
- name: Upload build artifact
if: matrix.arch == 'Win32'
uses: actions/upload-artifact@v3.1.2
with:
name: UMSKT-Win32+DOS
path: build/actions_upload

View File

@ -41,6 +41,10 @@ ENDIF()
IF(DJGPP_WATT32)
SET(CMAKE_SYSTEM_NAME MSDOS)
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
SET(UMSKT_LINK_LIBS ${UMSKT_LINK_LIBS} ${DJGPP_WATT32})
SET(UMSKT_LINK_DIRS ${UMSKT_LINK_DIRS} ${WATT_ROOT}/lib)
ENDIF()
@ -141,7 +145,7 @@ SET(LIBUMSKT_SRC src/libumskt/libumskt.cpp src/libumskt/pidgen3/BINK1998.cpp src
IF (EMSCRIPTEN)
ADD_EXECUTABLE(umskt ${LIBUMSKT_SRC})
TARGET_INCLUDE_DIRECTORIES(umskt PUBLIC ${OPENSSL_INCLUDE_DIR})
TARGET_LINK_LIBRARIES(umskt -static OpenSSL::Crypto cryptopp::cryptopp fmt)
TARGET_LINK_LIBRARIES(umskt -static OpenSSL::Crypto fmt)
SET(CMAKE_EXECUTABLE_SUFFIX ".html")
SET_TARGET_PROPERTIES(umskt PROPERTIES COMPILE_FLAGS "-Os -sEXPORTED_RUNTIME_METHODS=ccall,cwrap")
@ -165,8 +169,14 @@ ELSE()
TARGET_INCLUDE_DIRECTORIES(umskt PUBLIC ${OPENSSL_INCLUDE_DIR})
TARGET_LINK_LIBRARIES(umskt _umskt OpenSSL::Crypto fmt nlohmann_json::nlohmann_json umskt::rc ${UMSKT_LINK_LIBS})
TARGET_LINK_DIRECTORIES(umskt PUBLIC ${UMSKT_LINK_DIRS})
### UMSKT with specified DOS Stub compilation
IF(MSVC AND MSVC_MSDOS_STUB)
SET_PROPERTY(TARGET umskt APPEND PROPERTY LINK_FLAGS /STUB:${MSVC_MSDOS_STUB})
ADD_EXECUTABLE(umskt_win32_dos src/main.cpp src/cli.cpp ${UMSKT_EXE_WINDOWS_EXTRA})
TARGET_INCLUDE_DIRECTORIES(umskt_win32_dos PUBLIC ${OPENSSL_INCLUDE_DIR})
TARGET_LINK_LIBRARIES(umskt_win32_dos _umskt OpenSSL::Crypto fmt nlohmann_json::nlohmann_json umskt::rc ${UMSKT_LINK_LIBS})
TARGET_LINK_DIRECTORIES(umskt_win32_dos PUBLIC ${UMSKT_LINK_DIRS})
SET_PROPERTY(TARGET umskt_win32_dos APPEND PROPERTY LINK_FLAGS /STUB:${MSVC_MSDOS_STUB})
ENDIF()
### Copy Shared Libraries and dependency files

View File

@ -54,16 +54,9 @@ WORKDIR /tmp
# Stage 2: compile djgpp for muslc
ENV DJGPP_PREFIX=/djgpp BUILD_VER=12.2.0-i386
RUN git clone https://github.com/andrewwutw/build-djgpp.git djgpp \
RUN git clone https://github.com/UMSKT/build-djgpp.git djgpp \
&& cd djgpp \
&& cd script \
&& wget https://gist.github.com/Neo-Desktop/4cfd708f61f5847a7bf457d38db3b59f/raw/25d24cf509b0fc486d5d18ecb6656f120c3d0e51/12.2.0-i386 -O 12.2.0-i386 \
&& chmod +x 12.2.0-i386 \
&& cd ../patch \
&& wget https://gist.github.com/Neo-Desktop/4cfd708f61f5847a7bf457d38db3b59f/raw/25d24cf509b0fc486d5d18ecb6656f120c3d0e51/patch-alpine-Fix-attempt-to-use-poisoned-calloc-error-in-libgccji.patch -O patch-alpine-Fix-attempt-to-use-poisoned-calloc-error-in-libgccji.patch \
&& cd .. \
&& sed -i 's/i586/i386/g' setenv/setenv \
&& sed -i 's/i586/i386/g' setenv/setenv.bat \
&& chmod +x script/$BUILD_VER \
&& ./build-djgpp.sh $BUILD_VER \
&& rm -rf /tmp/djgpp
@ -72,15 +65,12 @@ FROM djgpp as watt32
WORKDIR /djgpp
ENV WATT_ROOT=/djgpp/watt32 DJGPP_PREFIX=i386-pc-msdosdjgpp
SHELL ["/bin/bash", "-c"]
RUN git clone https://github.com/gvanem/Watt-32.git watt32 \
RUN git clone https://github.com/UMSKT/Watt-32.git watt32 \
&& cd watt32/util \
&& make clean && make linux \
&& cd ../src \
&& source /djgpp/setenv \
&& ./configur.sh djgpp \
&& sed -i 's/i586/i386/g' djgpp.mak \
&& wget https://gist.github.com/Neo-Desktop/ad26e888d64b22a59c743ab4e21ac186/raw/c9a73e1eb75ba8857883ac5c08691d2fe5b82594/djgpp.err -O ../inc/sys/djgpp.err \
&& wget https://gist.github.com/Neo-Desktop/ad26e888d64b22a59c743ab4e21ac186/raw/c9a73e1eb75ba8857883ac5c08691d2fe5b82594/syserr.c -O build/djgpp/syserr.c \
&& make -f djgpp.mak \
&& ln -s /djgpp/watt32/lib/libwatt.a /djgpp/lib
@ -88,12 +78,9 @@ RUN git clone https://github.com/gvanem/Watt-32.git watt32 \
FROM watt32 as openssl
WORKDIR /tmp
SHELL ["/bin/bash", "-c"]
RUN git clone https://github.com/openssl/openssl.git openssl \
RUN git clone https://github.com/umskt/openssl.git openssl \
&& cd openssl \
&& git checkout openssl-3.1.1 \
&& source /djgpp/setenv \
&& wget https://gist.github.com/Neo-Desktop/ad26e888d64b22a59c743ab4e21ac186/raw/c9a73e1eb75ba8857883ac5c08691d2fe5b82594/50-djgpp.conf.patch -O Configurations/50-djgpp.conf.patch \
&& git apply Configurations/50-djgpp.conf.patch \
&& ./Configure no-threads -DOPENSSL_DEV_NO_ATOMICS --prefix=/djgpp DJGPP \
&& make && make install

View File

@ -78,6 +78,7 @@ RUN C:\BuildTools\Common7\Tools\VsDevCmd.bat && `
FROM mcr.microsoft.com/dotnet/framework/runtime:4.8.1 as output
COPY --from=Build32 C:\umskt\build\Release\umskt.exe C:\umskt\umskt.exe
COPY --from=Build32 C:\umskt\build\Release\umskt_win32_dos.exe C:\umskt\umskt_win32_dos.exe
COPY --from=Build64 C:\umskt\build\Release\umskt.exe C:\umskt\umskt64.exe
#invoke via