Skip to content

Commit

Permalink
Work on windows build with gitlab CI
Browse files Browse the repository at this point in the history
  • Loading branch information
eminence committed Feb 12, 2017
1 parent 4259c5e commit 884f854
Show file tree
Hide file tree
Showing 4 changed files with 127 additions and 2 deletions.
83 changes: 81 additions & 2 deletions .gitlab-ci.yml
Expand Up @@ -9,16 +9,35 @@ variables:
EXMAPLE_REPO: "https://github.com/overviewer/Minecraft-Overviewer-Addons"
MC_VERSION: "1.11"

build:
build:linux:
image: code.em32.net:14567/overviewer/minecraft-overviewer:base
stage: build
tags:
- linux
script:
- python2 setup.py build
- python2 overviewer.py --verbose --version

build:windows:
stage: build
tags:
- windows
script:
- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
- set DISTUTILS_USE_SDK=1
- set MSSdk=1
- set PIL_INCLUDE_DIR=c:\devel\pillow\libImaging
- c:\Python27\python.exe c:\devel\virtualenv\virtualenv.py ci_env
- ci_env\scripts\pip.exe install numpy Pillow
- ci_env\Scripts\python.exe setup.py build
- ci_env\Scripts\python.exe overviewer.py --verbose --version


build:docs:
image: code.em32.net:14567/overviewer/minecraft-overviewer:base
stage: build
tags:
- linux
script:
- cd docs
- make
Expand All @@ -31,8 +50,10 @@ build:docs:
test:
image: code.em32.net:14567/overviewer/minecraft-overviewer:base
stage: test
tags:
- linux
dependencies:
- build
- build:linux
script:
- python2 setup.py build
- python2 test/test_all.py
Expand All @@ -42,6 +63,8 @@ test:
package:src:
image: code.em32.net:14567/overviewer/minecraft-overviewer:base
stage: package
tags:
- linux
script:
- python2 setup.py sdist
- ls -lh dist
Expand All @@ -52,6 +75,8 @@ package:src:
package:centos7rpm:
image: code.em32.net:14567/overviewer/minecraft-overviewer:centos7
stage: package
tags:
- linux
script:
- export MCO_VERSION=`python2 setup.py --version`
- echo "Building Minecraft version ${MCO_VERSION}"
Expand All @@ -71,6 +96,8 @@ package:centos7rpm:
package:centos7-32rpm:
image: code.em32.net:14567/overviewer/minecraft-overviewer:centos7
stage: package
tags:
- linux
only:
- master
- triggers
Expand All @@ -94,6 +121,8 @@ package:centos7-32rpm:
package:centos6rpm:
image: code.em32.net:14567/overviewer/minecraft-overviewer:centos7
stage: package
tags:
- linux
only:
- master
- triggers
Expand All @@ -116,6 +145,8 @@ package:centos6rpm:
package:debian64:
image: code.em32.net:14567/overviewer/minecraft-overviewer:debian64
stage: package
tags:
- linux
script:
- export MCO_VERSION=`python2 setup.py --version`
- echo "Building Minecraft version ${MCO_VERSION}"
Expand All @@ -132,9 +163,53 @@ package:debian64:
- minecraft-overviewer*.deb


package:win64:
stage: package
tags:
- windows
script:
- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
- set DISTUTILS_USE_SDK=1
- set MSSdk=1
- set PIL_INCLUDE_DIR=c:\devel\pillow\libImaging
- c:\Python27\python.exe c:\devel\virtualenv\virtualenv.py ci_env
- ci_env\scripts\pip.exe install numpy Pillow pyinstaller sphinx
- ci_env\Scripts\python.exe setup.py build
- copy build-tools\overviewer.spec .
- ci_env\Scripts\pyinstaller.exe overviewer.spec
- for /f "delims=" %%a in ('ci_env\Scripts\python.exe setup.py --version') do @set OVR_VERSION=%%a
- ci_env\Scripts\sphinx-build.exe docs dist\overviewer-%OVR_VERSION%\docs
artifacts:
expire_in: 2 weeks
paths:
- dist

package:win32:
stage: package
tags:
- windows
script:
- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
- set DISTUTILS_USE_SDK=1
- set MSSdk=1
- set PIL_INCLUDE_DIR=c:\devel\pillow\libImaging
- "\"c:\\Python27 (x86)\\python.exe\" c:\\devel\\virtualenv\\virtualenv.py ci_env"
- ci_env\scripts\pip.exe install numpy Pillow pyinstaller sphinx
- ci_env\Scripts\python.exe setup.py build
- copy build-tools\overviewer.spec .
- ci_env\Scripts\pyinstaller.exe overviewer.spec
- for /f "delims=" %%a in ('ci_env\Scripts\python.exe setup.py --version') do @set OVR_VERSION=%%a
- ci_env\Scripts\sphinx-build.exe docs dist\overviewer-%OVR_VERSION%\docs
artifacts:
expire_in: 2 weeks
paths:
- dist

verify:centos7:
image: code.em32.net:14567/overviewer/minecraft-overviewer:centos7-verify
stage: verify
tags:
- linux
dependencies:
- package:centos7rpm
script:
Expand All @@ -152,6 +227,8 @@ verify:centos7:
verify:debian64:
image: code.em32.net:14567/overviewer/minecraft-overviewer:debian-verify
stage: verify
tags:
- linux
dependencies:
- package:debian64
script:
Expand Down Expand Up @@ -195,6 +272,8 @@ remove_render:
stage: render
variables:
GIT_STRATEGY: none
tags:
- diax
when: manual
script:
- echo "Removing all renders for the branch $CI_BUILD_REF_NAME :"
Expand Down
39 changes: 39 additions & 0 deletions build-tools/overviewer.spec
@@ -0,0 +1,39 @@
# -*- mode: python -*-

block_cipher = None

import sys
sys.modules['FixTk'] = None

def get_overviewer_pkgname():
from overviewer_core import overviewer_version
return "overviewer-" + overviewer_version.VERSION

a = Analysis(['overviewer.py'],
pathex=['Z:\\devel\\Minecraft-Overviewer'],
binaries=None,
datas=[("overviewer_core/data", "overviewer_core/data")],
hiddenimports=['overviewer_core.aux_files.genPOI'],
hookspath=[],
runtime_hooks=[],
excludes=['FixTk', 'tcl', 'tk', '_tkinter', 'tkinter', 'Tkinter'],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='overviewer',
debug=False,
strip=False,
upx=False,
console=True )
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=False,
name=get_overviewer_pkgname())
5 changes: 5 additions & 0 deletions overviewer_core/src/overviewer.h
Expand Up @@ -24,6 +24,11 @@
#ifndef __OVERVIEWER_H_INCLUDED__
#define __OVERVIEWER_H_INCLUDED__


#define WINVER 0x0601
#define _WIN32_WINNT 0x0601


// increment this value if you've made a change to the c extesion
// and want to force users to rebuild
#define OVERVIEWER_EXTENSION_VERSION 51
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Expand Up @@ -288,6 +288,8 @@ def build_extensions(self):
# customize the build options for this compilier
for e in self.extensions:
e.extra_link_args.append("/MANIFEST")
e.extra_link_args.append("/DWINVER=0x060")
e.extra_link_args.append("/D_WIN32_WINNT=0x060")
if c == "unix":
# customize the build options for this compilier
for e in self.extensions:
Expand Down

0 comments on commit 884f854

Please sign in to comment.