-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build a backend binary using AppVeyor's Ubuntu image
- Loading branch information
Showing
8 changed files
with
80 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
STRIP ?= strip | ||
|
||
all : ../out/wslbridge-backend | ||
|
||
../out/wslbridge-backend : wslbridge-backend.cc ../common/SocketIo.cc ../common/SocketIo.h ../VERSION.txt Makefile | ||
mkdir -p ../out | ||
g++ -std=c++11 -fno-exceptions \ | ||
$(CXX) -std=c++11 -fno-exceptions \ | ||
-static-libgcc -static-libstdc++ \ | ||
-D_GNU_SOURCE \ | ||
-DWSLBRIDGE_VERSION=$(shell cat ../VERSION.txt) \ | ||
-Wall -O2 $< ../common/SocketIo.cc -o $@ -lutil -pthread | ||
strip $@ | ||
$(STRIP) $@ | ||
|
||
clean: | ||
rm -f ../out/wslbridge-backend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,27 @@ | ||
image: | ||
- Ubuntu | ||
- Visual Studio 2017 | ||
|
||
environment: | ||
matrix: | ||
- CYGWIN_VARIANT: cygwin32 | ||
- CYGWIN_VARIANT: cygwin64 | ||
- CYGWIN_VARIANT: msys32 | ||
- CYGWIN_VARIANT: msys64 | ||
- { COMPONENT: frontend, CYGWIN_VARIANT: cygwin32 } | ||
- { COMPONENT: frontend, CYGWIN_VARIANT: cygwin64 } | ||
- { COMPONENT: frontend, CYGWIN_VARIANT: msys32 } | ||
- { COMPONENT: frontend, CYGWIN_VARIANT: msys64 } | ||
- { COMPONENT: backend } | ||
|
||
matrix: | ||
exclude: | ||
- { image: Ubuntu, COMPONENT: frontend } | ||
- { image: Visual Studio 2017, COMPONENT: backend } | ||
|
||
build_script: | ||
- C:\Python36-x64\python.exe dist\frontend\make-frontend-packages.py | ||
for: | ||
- matrix: { only: [ COMPONENT: backend ] } | ||
build_script: | ||
- python3 dist/frontend/make-backend-package.py | ||
- matrix: { only: [ COMPONENT: frontend ] } | ||
build_script: | ||
- C:\Python35-x64\python.exe dist\frontend\make-frontend-packages.py | ||
|
||
artifacts: | ||
- path: out\artifact\*-frontend.tar.xz | ||
- path: out\artifact\*.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env python3 | ||
import os | ||
import sys | ||
sys.path.insert(1, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | ||
import util | ||
|
||
import shutil | ||
|
||
from os.path import abspath | ||
from subprocess import check_call | ||
from util import projectDir, rmpath, mkdirs | ||
|
||
sys.platform == 'linux' or sys.exit('error: script only runs on Linux') | ||
shutil.which('git') or sys.exit('error: git missing') | ||
shutil.which('make') or sys.exit('error: make missing') | ||
shutil.which('tar') or sys.exit('error: tar missing') | ||
|
||
buildDir = os.path.join(projectDir, 'out', 'build-backend') | ||
artifactDir = os.path.join(projectDir, 'out', 'artifact') | ||
|
||
rmpath(buildDir) | ||
mkdirs(buildDir) | ||
mkdirs(artifactDir) | ||
|
||
os.chdir(buildDir) | ||
|
||
prebuiltUrl = 'https://github.com/rprichard/x86_64-linux-glibc2.15-4.8.git' | ||
prebuiltPath = abspath('linux-prebuilt') | ||
artifactPath = os.path.join(artifactDir, 'backend.tar.gz') | ||
|
||
check_call(['git', 'clone', prebuiltUrl, prebuiltPath]) | ||
|
||
os.putenv('CXX', os.path.join(prebuiltPath, 'bin', 'x86_64-linux-g++')) | ||
os.putenv('STRIP', os.path.join(prebuiltPath, 'bin', 'x86_64-linux-strip')) | ||
check_call(['make', 'clean'], cwd=os.path.join(projectDir, 'backend')) | ||
check_call(['make'], cwd=os.path.join(projectDir, 'backend')) | ||
check_call(['tar', 'cfa', artifactPath, '-C', '..', 'wslbridge-backend']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
STRIP ?= strip | ||
|
||
all : ../out/wslbridge.exe | ||
|
||
../out/wslbridge.exe : wslbridge.cc ../common/SocketIo.cc ../common/SocketIo.h ../VERSION.txt Makefile | ||
mkdir -p ../out | ||
g++ -std=c++11 -fno-exceptions \ | ||
$(CXX) -std=c++11 -fno-exceptions \ | ||
-static -static-libgcc -static-libstdc++ \ | ||
-D_GNU_SOURCE -D_WIN32_WINNT=0x0600 -DUNICODE -D_UNICODE \ | ||
-DWSLBRIDGE_VERSION=$(shell cat ../VERSION.txt) \ | ||
-Wall -O2 $< ../common/SocketIo.cc -o $@ | ||
strip $@ | ||
$(STRIP) $@ | ||
|
||
clean: | ||
rm -f ../out/wslbridge.exe |