]> granicus.if.org Git - nethack/commitdiff
Added mingw build.
authorBart House <bart@barthouse.com>
Mon, 14 Dec 2020 08:28:36 +0000 (00:28 -0800)
committerBart House <bart@barthouse.com>
Mon, 14 Dec 2020 08:28:36 +0000 (00:28 -0800)
azure-pipelines.yml

index eee36229036d5e978a3f78fcd158d8c3ad93acfe..cfcb1911c943d62761a1692b7b7205bb87203810 100644 (file)
@@ -25,7 +25,7 @@ strategy:
       ccName: gcc-7
       cxxName: g++-7
       buildMinimalSetting: false
-# build is currently broken build
+# build is currently broken
 #    mac_catalina_gcc8_all:
 #      imageName: 'macOS-10.15'
 #      ccName: gcc-8
@@ -36,15 +36,32 @@ strategy:
       ccName: clang
       cxxName: clang++
       buildMinimalSetting: false
-    windows:
-      imageName: 'windows-latest'
+    windows-visualstudio:
+      imageName: 'windows-2019'
       buildMinimalSetting: false
+      vsBuildSetting: true
+      mingwBuildSetting: false
+    windows-mingw:
+      imageName: 'windows-2019'
+      buildMinimalSetting: false
+      vsBuildSetting: false
+      mingwBuildSetting: true
 
 pool:
   vmImage: $(imageName)
 
+resources:
+  repositories:
+  - repository: pdcursesrepo
+    type: github
+    name: wmcbrine/PDCurses
+    ref: refs/heads/master
+    endpoint: github.com_barthouse
+
 variables:
   buildMinimal: $(buildMinimalSetting)
+  mingwBuild: $(mingwBuildSetting)
+  vsBuild: $(vsBuildSetting)
   ${{ if eq( variables['Agent.OS'], 'Windows_NT') }}:
     NetHackPath: s\NetHack
   ${{ if ne( variables['Agent.OS'], 'Windows_NT') }}:
@@ -53,10 +70,22 @@ variables:
     CXX: $(cxxName)
 
 steps:
+- bash: |
+    echo 'mingwBuildSetting' '$(mingwBuildSetting)'
+    echo 'mingwBuild' '$(mingwBuild)'
+    echo 'vsBuild' '$(vsBuild)'
+    echo 'NetHackPath' '$(NetHackPath)'
+    echo 'CC' '$(CC)'
+    echo 'CXX' '$(CXX)'
+
 - checkout: git://NetHack/NetHack@NetHack-3.7  # $(Agent.BuildDirectory)\s\NetHack
   submodules: true
   path: $(NetHackPath)
 
+- checkout: pdcursesrepo
+  path: s\NetHack\lib\pdcurses
+  condition: and( eq( variables['Agent.OS'], 'Windows_NT' ), eq( variables.mingwBuild, true))
+
 - task: DownloadSecureFile@1
   name: storeKey
   displayName: 'Store Key Download'
@@ -65,18 +94,45 @@ steps:
   condition: eq( variables['Agent.OS'], 'Windows_NT' )
 
 - task: CopyFiles@2
-  inputs: 
+  inputs:
     contents: NetHackPackage_StoreKey.pfx
     SourceFolder: $(Agent.TempDirectory)
     TargetFolder: $(Agent.BuildDirectory)\s\NetHack\win\win32\vs
   condition: eq( variables['Agent.OS'], 'Windows_NT' )
+  displayName: 'Copying store key'
+
+# Temporary need to copy lua files for minGW build
+- task: CopyFiles@2
+  inputs:
+    SourceFolder: $(Agent.BuildDirectory)\s\NetHack\submodules\lua
+    TargetFolder: $(Agent.BuildDirectory)\s\NetHack\lib\lua-5.4.2\src
+  condition: and( eq( variables['Agent.OS'], 'Windows_NT' ), eq( variables.mingwBuild, true))
+  displayName: 'Copying lua files'
 
 - task: MSBuild@1
   inputs:
     solution: $(Agent.BuildDirectory)\s\NetHack\win\win32\vs\NetHack.sln
     platform: Win32
     configuration: Debug
-  condition: eq( variables['Agent.OS'], 'Windows_NT' )
+  condition: and( eq( variables['Agent.OS'], 'Windows_NT' ), eq( variables.vsBuild, true))
+  displayName: 'Windows MSBuild'
+
+- bash: |
+    echo '/mingw64/bin'
+    ls /mingw64/bin
+    echo '/usr/bin'
+    ls /usr/bin
+    echo 'gcc --version'
+    gcc --version
+    export ADD_CURSES=Y
+    export PDCURSES_TOP=../lib/pdcurses
+    export LUA_VERSION=5.4.2
+    export TRAVIS_COMPILER=1
+    cd NetHack/src
+    cp ../sys/winnt/Makefile.gcc ./Makefile
+    mingw32-make LUA_VERSION=$LUA_VERSION install
+  condition: and( eq( variables['Agent.OS'], 'Windows_NT' ), eq( variables.mingwBuild, true))
+  displayName: 'Windows MinGW Build'
 
 - bash: |
     sudo apt-get -qq -y update
@@ -86,7 +142,7 @@ steps:
   displayName: 'Getting linux build dependencies'
 
 - bash: |
-    cd sys/unix
+    cd NetHack/sys/unix
     sh setup.sh hints/linux-minimal
     cd ../..
     sed -i '/^#define CLIPPING/d'       include/config.h
@@ -112,10 +168,10 @@ steps:
     make fetch-lua
     make WANT_WIN_ALL=1 all
   condition: and(eq( variables['Agent.OS'], 'Linux' ), eq( variables.buildMinimal, true))
-  displayName: 'Buildig linux minimal build'
+  displayName: 'Building linux minimal build'
 
 - bash: |
-    cd sys/unix
+    cd NetHack/sys/unix
     sh setup.sh hints/linux.2020
     cd ../..
     make fetch-lua
@@ -124,7 +180,7 @@ steps:
   displayName: 'Building linux full build'
 
 - bash: |
-    cd sys/unix
+    cd NetHack/sys/unix
     sh setup.sh hints/macos.2020
     cd ../..
     make fetch-lua