Commit 3954dd36 authored by nanahira's avatar nanahira

linux build

parent fb6c4de7
Pipeline #4016 failed with stages
in 5 minutes and 37 seconds
...@@ -6,4 +6,4 @@ set -o errexit ...@@ -6,4 +6,4 @@ set -o errexit
apt update && apt -y install tar git apt update && apt -y install tar git
git submodule update --init git submodule update --init
mkdir dist replay mkdir dist replay
tar -zcf dist/ygopro-$CI_COMMIT_REF_NAME-linux-$TARGET_LOCALE.tar.gz --exclude='.git*' ygopro LICENSE README.md libIrrKlang.so lflist.conf strings.conf system.conf cards.cdb script textures deck single pics replay sound windbot bot bot.conf tar -zcf dist/ygopro-$CI_COMMIT_REF_NAME-linux-$TARGET_LOCALE.tar.gz --exclude='.git*' ygopro LICENSE README.md lib lflist.conf strings.conf system.conf cards.cdb script textures deck single pics replay sound windbot bot bot.conf
...@@ -11,18 +11,27 @@ variables: ...@@ -11,18 +11,27 @@ variables:
USE_IRRKLANG: "1" USE_IRRKLANG: "1"
mat_lua: mat_common:
stage: prepare stage: prepare
tags: tags:
- linux - linux
script: script:
- apt update; apt -y install wget tar # lua
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/lua-5.3.5.tar.gz | tar zfx - - wget -O - https://cdn01.moecube.com/ygopro-build-materials/lua-5.3.5.tar.gz | tar zfx -
- mv lua-5.3.5/src lua - mv lua-5.3.5/src lua
- cp premake/lua/premake4.lua lua/; # sqlite3
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/sqlite-autoconf-3360000.tar.gz | tar zfx -
- mv sqlite-autoconf-3360000 sqlite3
# freetype
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/freetype-2.10.4.tar.gz | tar zfx -
- mv freetype-2.10.4 freetype
# premake
- cp -rf premake/* .;
artifacts: artifacts:
paths: paths:
- lua - lua
- freetype
- sqlite3
mat_irrklang: mat_irrklang:
stage: prepare stage: prepare
...@@ -47,10 +56,18 @@ mat_linux: ...@@ -47,10 +56,18 @@ mat_linux:
- apt update; apt -y install git wget tar - apt update; apt -y install git wget tar
- git clone --depth=1 https://code.mycard.moe/mycard/irrlicht irrlicht_linux - git clone --depth=1 https://code.mycard.moe/mycard/irrlicht irrlicht_linux
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/premake-5.0.0-alpha14-linux.tar.gz | tar zfx - - wget -O - https://cdn01.moecube.com/ygopro-build-materials/premake-5.0.0-alpha14-linux.tar.gz | tar zfx -
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/libevent-2.0.22-stable.tar.gz | tar zfx -
- cd libevent-2.0.22-stable
- ./configure --prefix=$PWD/libevent-stable --disable-openssl
- make -j$(nproc)
- make install
- cd ..
- mv libevent-2.0.22-stable/libevent-stable .
artifacts: artifacts:
paths: paths:
- premake5 - premake5
- irrlicht_linux - irrlicht_linux
- libevent-stable
mat_macos: mat_macos:
stage: prepare stage: prepare
...@@ -82,13 +99,6 @@ mat_windows: ...@@ -82,13 +99,6 @@ mat_windows:
# event # event
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/libevent-2.0.22-stable.tar.gz | tar zfx - - wget -O - https://cdn01.moecube.com/ygopro-build-materials/libevent-2.0.22-stable.tar.gz | tar zfx -
- mv libevent-2.0.22-stable event ; cp -rf event/WIN32-Code/* event/include - mv libevent-2.0.22-stable event ; cp -rf event/WIN32-Code/* event/include
# freetype
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/freetype-2.10.1.tar.gz | tar zfx -
- mv freetype-2.10.1 freetype
# sqlite3
- wget https://cdn01.moecube.com/ygopro-build-materials/sqlite-amalgamation-3310100.zip
- 7z x -y sqlite-amalgamation-3310100.zip
- mv sqlite-amalgamation-3310100 sqlite3
# irrlicht # irrlicht
- wget https://cdn01.moecube.com/ygopro-build-materials/irrlicht-1.8.4.zip - wget https://cdn01.moecube.com/ygopro-build-materials/irrlicht-1.8.4.zip
- 7z x -y irrlicht-1.8.4.zip - 7z x -y irrlicht-1.8.4.zip
...@@ -99,8 +109,6 @@ mat_windows: ...@@ -99,8 +109,6 @@ mat_windows:
paths: paths:
- premake5.exe - premake5.exe
- event - event
- freetype
- sqlite3
- irrlicht - irrlicht
exec_windows: exec_windows:
...@@ -108,7 +116,7 @@ exec_windows: ...@@ -108,7 +116,7 @@ exec_windows:
tags: tags:
- vs - vs
dependencies: dependencies:
- mat_lua - mat_common
- mat_irrklang - mat_irrklang
- mat_windows - mat_windows
variables: variables:
...@@ -132,7 +140,12 @@ exec_linux: ...@@ -132,7 +140,12 @@ exec_linux:
stage: build stage: build
tags: tags:
- linux - linux
variables:
YGOPRO_BUILD_ALL: '1'
YGOPRO_LINUX_ALL_STATIC: '1'
YGOPRO_LINUX_ALL_STATIC_LIB_PATH: '/usr/lib/x86_64-linux-gnu/'
dependencies: dependencies:
- mat_common
- mat_irrklang - mat_irrklang
- mat_linux - mat_linux
cache: cache:
...@@ -140,19 +153,20 @@ exec_linux: ...@@ -140,19 +153,20 @@ exec_linux:
- bin/ - bin/
- obj/ - obj/
script: script:
- apt update; apt -y install git build-essential libfreetype6-dev libevent-dev libsqlite3-dev libgl1-mesa-dev libglu-dev liblua5.3-dev libxxf86vm-dev - apt update; apt -y install git build-essential libgl1-mesa-dev libglu-dev libxxf86vm-dev
- git submodule update --init - git submodule update --init
- ./premake5 gmake - mkdir lib
- cp -rf irrklang/bin/linux-gcc-64/libIrrKlang.so ./lib/
- YGOPRO_LINUX_ALL_STATIC_LIBEVENT_PATH=$PWD/libevent-stable ./premake5 gmake
- cd build - cd build
- make config=release -j$(nproc) - make config=release -j$(nproc)
- cd .. - cd ..
- mv bin/release/ygopro . - mv bin/release/ygopro .
- strip ygopro - strip ygopro
- cp -rf irrklang/bin/linux-gcc-64/libIrrKlang.so .
artifacts: artifacts:
paths: paths:
- ygopro - ygopro
- libIrrKlang.so - lib
exec_macos: exec_macos:
stage: build stage: build
...@@ -161,14 +175,14 @@ exec_macos: ...@@ -161,14 +175,14 @@ exec_macos:
dependencies: dependencies:
- mat_irrklang - mat_irrklang
- mat_macos - mat_macos
- mat_lua - mat_common
cache: cache:
paths: paths:
- bin/ - bin/
- obj/ - obj/
script: script:
- git submodule update --init - git submodule update --init
- brew install freetype libevent sqlite dylibbundler - brew install libevent dylibbundler
- sudo cp -rf irrklang/bin/macosx-gcc/libirrklang.dylib /usr/local/lib/ - sudo cp -rf irrklang/bin/macosx-gcc/libirrklang.dylib /usr/local/lib/
#- sudo cp -rf irrklang/include /usr/local/include/irrklang #- sudo cp -rf irrklang/include /usr/local/include/irrklang
- ./premake5 gmake --cc=clang - ./premake5 gmake --cc=clang
......
...@@ -7,7 +7,10 @@ project "ygopro" ...@@ -7,7 +7,10 @@ project "ygopro"
files { "**.cpp", "**.cc", "**.c", "**.h" } files { "**.cpp", "**.cc", "**.c", "**.h" }
excludes { "lzma/**", "spmemvfs/**" } excludes { "lzma/**", "spmemvfs/**" }
includedirs { "../ocgcore" } includedirs { "../ocgcore" }
links { "ocgcore", "clzma", "cspmemvfs", "Irrlicht", "freetype", "sqlite3", "event" } links { "ocgcore", "clzma", "cspmemvfs", "Irrlicht", "sqlite3", "freetype" }
if not LINUX_ALL_STATIC then
links { "event" }
end
if USE_IRRKLANG then if USE_IRRKLANG then
defines { "YGOPRO_USE_IRRKLANG" } defines { "YGOPRO_USE_IRRKLANG" }
links { "ikpmp3" } links { "ikpmp3" }
...@@ -17,6 +20,10 @@ project "ygopro" ...@@ -17,6 +20,10 @@ project "ygopro"
end end
end end
configuration "not linux"
if LINUX_ALL_STATIC then
links { "event" }
end
configuration "windows" configuration "windows"
files "ygopro.rc" files "ygopro.rc"
excludes "CGUIButton.cpp" excludes "CGUIButton.cpp"
...@@ -42,17 +49,40 @@ project "ygopro" ...@@ -42,17 +49,40 @@ project "ygopro"
configuration "not vs*" configuration "not vs*"
buildoptions { "-std=c++14", "-fno-rtti" } buildoptions { "-std=c++14", "-fno-rtti" }
configuration "not windows" configuration "not windows"
includedirs { "/usr/include/irrlicht", "/usr/include/freetype2" }
excludes { "COSOperator.*" } excludes { "COSOperator.*" }
links { "event_pthreads", "dl", "pthread" } links { "dl", "pthread" }
if not LINUX_ALL_STATIC then
links { "event_pthreads" }
end
if BUILD_SQLITE then
includedirs { "../sqlite3" }
end
if BUILD_FREETYPE then
includedirs {"../freetype/include" }
else
includedirs { "/usr/include/freetype2" }
end
configuration { "not windows", "not macosx" } configuration { "not windows", "not macosx" }
links "GL" links "GL"
configuration "linux" configuration "linux"
linkoptions { "-static-libstdc++", "-static-libgcc", "-Wl,-rpath=./lib/" }
includedirs { "../irrlicht_linux/include" } includedirs { "../irrlicht_linux/include" }
links { "X11", "Xxf86vm", "lua5.3-c++" } if BUILD_LUA then
links { "lua" }
else
links { "lua5.3-c++" }
end
links { "X11", "Xxf86vm" }
if LINUX_ALL_STATIC then
local libeventRootPrefix=LIB_ROOT
if LIBEVENT_ROOT then
includedirs { LIBEVENT_ROOT.."/include" }
libeventRootPrefix=LIBEVENT_ROOT.."/lib/"
end
linkoptions { libeventRootPrefix.."libevent.a", libeventRootPrefix.."libevent_pthreads.a" }
end
if USE_IRRKLANG then if USE_IRRKLANG then
links { "IrrKlang" } links { "IrrKlang" }
linkoptions{ "-Wl,-rpath=./" }
libdirs { "../irrklang/bin/linux-gcc-64" } libdirs { "../irrklang/bin/linux-gcc-64" }
end end
configuration "macosx" configuration "macosx"
......
...@@ -4,16 +4,46 @@ project "freetype" ...@@ -4,16 +4,46 @@ project "freetype"
includedirs { "include" } includedirs { "include" }
defines { "FT2_BUILD_LIBRARY" } defines { "FT2_BUILD_LIBRARY" }
files { "src/autofit/autofit.c", "src/bdf/bdf.c", "src/cff/cff.c", "src/base/ftbase.c", files { "src/autofit/autofit.c",
"src/base/ftbitmap.c", "src/cache/ftcache.c", "src/base/ftfstype.c", "src/base/ftgasp.c", "src/base/ftbase.c",
"src/base/ftglyph.c", "src/gzip/ftgzip.c", "src/base/ftinit.c", "src/lzw/ftlzw.c", "src/base/ftbbox.c",
"src/base/ftstroke.c", "src/base/ftsystem.c", "src/smooth/smooth.c", "src/base/ftbbox.c", "src/base/ftbdf.c",
"src/base/ftfntfmt.c", "src/base/ftmm.c", "src/base/ftpfr.c", "src/base/ftsynth.c", "src/base/ftbitmap.c",
"src/base/fttype1.c", "src/base/ftwinfnt.c", "src/base/ftlcdfil.c", "src/base/ftgxval.c", "src/base/ftcid.c",
"src/base/ftotval.c", "src/base/ftpatent.c", "src/pcf/pcf.c", "src/pfr/pfr.c", "src/base/ftfstype.c",
"src/psaux/psaux.c", "src/pshinter/pshinter.c", "src/psnames/psmodule.c", "src/base/ftgasp.c",
"src/raster/raster.c", "src/sfnt/sfnt.c", "src/truetype/truetype.c", "src/base/ftglyph.c",
"src/type1/type1.c", "src/cid/type1cid.c", "src/type42/type42.c", "src/winfonts/winfnt.c" } "src/base/ftgxval.c",
"src/base/ftinit.c",
"src/base/ftmm.c",
"src/base/ftotval.c",
"src/base/ftpatent.c",
"src/base/ftpfr.c",
"src/base/ftstroke.c",
"src/base/ftsynth.c",
"src/base/ftsystem.c",
"src/base/fttype1.c",
"src/base/ftwinfnt.c",
"src/bdf/bdf.c",
"src/cache/ftcache.c",
"src/cff/cff.c",
"src/cid/type1cid.c",
"src/gzip/ftgzip.c",
"src/lzw/ftlzw.c",
"src/pcf/pcf.c",
"src/pfr/pfr.c",
"src/psaux/psaux.c",
"src/pshinter/pshinter.c",
"src/psnames/psmodule.c",
"src/raster/raster.c",
"src/sfnt/sfnt.c",
"src/smooth/smooth.c",
"src/truetype/truetype.c",
"src/type1/type1.c",
"src/type42/type42.c",
"src/winfonts/winfnt.c" }
configuration "windows" configuration "windows"
files { "builds/windows/ftdebug.c" } files { "builds/windows/ftdebug.c" }
configuration "not windows"
files { "src/base/ftdebug.c" }
...@@ -8,6 +8,31 @@ solution "ygo" ...@@ -8,6 +8,31 @@ solution "ygo"
IRRKLANG_PRO = true IRRKLANG_PRO = true
end end
end end
if not os.ishost("windows") then
if os.getenv("YGOPRO_BUILD_LUA") then
BUILD_LUA=true
end
if os.getenv("YGOPRO_BUILD_SQLITE") then
BUILD_SQLITE=true
end
if os.getenv("YGOPRO_BUILD_FREETYPE") then
BUILD_FREETYPE=true
end
if os.getenv("YGOPRO_BUILD_ALL") or os.ishost("macosx") then
BUILD_ALL=true
end
if os.ishost("linux") and os.getenv("YGOPRO_LINUX_ALL_STATIC") then
BUILD_ALL=true
LINUX_ALL_STATIC=true
LIB_ROOT=os.getenv("YGOPRO_LINUX_ALL_STATIC_LIB_PATH") or "/usr/lib/x86_64-linux-gnu/"
LIBEVENT_ROOT=os.getenv("YGOPRO_LINUX_ALL_STATIC_LIBEVENT_PATH")
end
if BUILD_ALL then
BUILD_LUA=true
BUILD_SQLITE=true
BUILD_FREETYPE=true
end
end
configurations { "Release", "Debug" } configurations { "Release", "Debug" }
configuration "windows" configuration "windows"
...@@ -33,8 +58,8 @@ solution "ygo" ...@@ -33,8 +58,8 @@ solution "ygo"
configuration "macosx" configuration "macosx"
defines { "LUA_USE_MACOSX", "DBL_MAX_10_EXP=+308", "DBL_MANT_DIG=53", "GL_SILENCE_DEPRECATION" } defines { "LUA_USE_MACOSX", "DBL_MAX_10_EXP=+308", "DBL_MANT_DIG=53", "GL_SILENCE_DEPRECATION" }
includedirs { "/usr/local/include/event2", "/usr/local/include/freetype2", "/usr/local/opt/sqlite3/include" } includedirs { "/usr/local/include/event2", }
libdirs { "/usr/local/lib", "/usr/local/opt/sqlite3/lib" } libdirs { "/usr/local/lib" }
buildoptions { "-stdlib=libc++" } buildoptions { "-stdlib=libc++" }
links { "OpenGL.framework", "Cocoa.framework", "IOKit.framework" } links { "OpenGL.framework", "Cocoa.framework", "IOKit.framework" }
...@@ -76,15 +101,22 @@ solution "ygo" ...@@ -76,15 +101,22 @@ solution "ygo"
include "ocgcore" include "ocgcore"
include "gframe" include "gframe"
if os.ishost("macosx") then
include "lua"
end
if os.ishost("windows") then if os.ishost("windows") then
include "lua" include "lua"
include "event" include "event"
include "freetype" include "freetype"
include "irrlicht" include "irrlicht"
include "sqlite3" include "sqlite3"
else
if BUILD_LUA then
include "lua"
end
if BUILD_SQLITE then
include "sqlite3/premake4.lua"
end
if BUILD_FREETYPE then
include "freetype"
end
end end
if os.ishost("linux") then if os.ishost("linux") then
include "irrlicht_linux" include "irrlicht_linux"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment