1
0
Fork 0

fix package , fix ci build, tune cmake flags and rules

* tune up gitlab ci:
  * remove package part cos we have obs service
  * add feladora 38 and feladora 37 too
  * remove winbuntu 14, add debian 11, 12, winbuntu 17, 20, 22
  * use minenux minetest repo game (seems not work)
  * remove non buildable stages.. only build and package shit win
  * set multicraft as prefix path and artifacts
  * back cmake in list new behaviour for blacklist locales
  * gitlab ci buil for debian 8 using backports on jsoncpp
  * solved https://github.com/minetest/minetest/issues/6567
  * solved https://github.com/minetest/minetest/issues/7681
* cmake fixed to minimum supported and c++11 standar able
  * close https://codeberg.org/minenux/minetest-engine-multicraft2/issues/51
  * allow distro hardening and cflags env
    close https://codeberg.org/minenux/minetest-engine-multicraft2/issues/55
  * Fix no locales being generated when APPLY_LOCALE_BLACKLIST=0
  * Fix linking with Postgres libs:
  * closes https://github.com/minetest/minetest/issues/12149
  * closes https://github.com/minetest/minetest/issues/11219
  * PostgreSQL fallback code missed the includes
  https://github.com/minetest/minetest/issues/11219
  * a24899bf2d
  * 3e2145d662
  * integrates https://github.com/minetest/minetest/pull/11215
  *  a24899bf2d
  * backported 998e4820c9
* tune up windoser build scripts for multicraft:
  * fix build paths builds script due repo change name
  * fix winbuntu image fosal and fix missing deploy for win shit package
* use SSE registers for FP operations on i386 for modern gcc platforms only
  * only use if related are given, by example 32bit using gcc 
    compilers/stdlibs becouse of the long time bugs around those 
    errors by desing, its not about to crash the engine.. its about to 
    permits to hacked clients (either players or the client program per se)
    making predictable results, so predictable results permits to catch 
    securit issues!
  * floating point problems are only on modern gcc and modern platform 
    arches, raising problems like bad calculations positions.. 
    a long time bug  reported at https://git.minetest.land/Mineclonia/Mineclonia/issues/201
    and addressed at https://github.com/minetest/minetest/issues/11742#issuecomment-994444462
    with enought explanations but not accepted byt stupid developers..
    now years later.. the problems were solved and reconiced as big bug!
    A workaround were proposed at https://github.com/minetest/minetest/pull/12389/files
    but never accepted (included in this repository), cos was superset by 8ff3fadba0
  * closes https://codeberg.org/minenux/minetest-engine-multicraft2/issues/57
minenux
Герхард PICCORO Lenz McKAY 2023-09-16 02:16:25 +00:00
parent 575f130854
commit d2649999a9
8 changed files with 400 additions and 210 deletions

View File

@ -1,7 +1,9 @@
---
# Github repository is cloned every day on Gitlab.com
# https://gitlab.com/minetest/minetest
# Pipelines URL: https://gitlab.com/minetest/minetest/pipelines
# Github repository is really at minetest.org using the poikilos git.minetest.io
# https://gitlab.com/minenux/minetest-engine-multicraft2
# Pipelines URL: https://gitlab.com/minenux/minetest-engine-multicraft2/pipelines
# packages moved to https://build.opensuse.org/project/show/home:venenux:minenux
# in future we only build here, or made apk packs for alpine
stages:
- build
@ -9,127 +11,184 @@ stages:
- deploy
variables:
MINETEST_GAME_REPO: "https://github.com/minetest/minetest_game.git"
MINETEST_GAME_REPO: "https://gitlab.com/minenux/minetest-game-minetest.git"
CONTAINER_IMAGE: registry.gitlab.com/$CI_PROJECT_PATH
.build_template:
stage: build
script:
- mkdir cmakebuild
- mkdir -p artifact/minetest/usr/
- cd cmakebuild
- cmake -DCMAKE_INSTALL_PREFIX=../artifact/minetest/usr/ -DCMAKE_BUILD_TYPE=Release -DRUN_IN_PLACE=FALSE -DENABLE_GETTEXT=TRUE -DENABLE_SYSTEM_JSONCPP=TRUE -DBUILD_SERVER=TRUE ..
- make -j2
- mkdir -p artifact/multicraft/usr/
- mkdir -p games
- cd games
- git clone -b stable-0.4 --single-branch $MINETEST_GAME_REPO minetest
- cd ../cmakebuild
- cmake -DCMAKE_INSTALL_PREFIX=../artifact/multicraft/usr/ -DBUILD_SERVER=ON -DBUILD_CLIENT=ON -DCMAKE_BUILD_TYPE=Release -DRUN_IN_PLACE=TRUE -DENABLE_GETTEXT=TRUE -DENABLE_SYSTEM_JSONCPP=TRUE -DAPPLY_LOCALE_BLACKLIST=TRUE -DCMAKE_VERBOSE_MAKEFILE=ON ..
- make -j$(nproc)
- make install
artifacts:
when: on_success
expire_in: 1h
expire_in: 5h
paths:
- artifact/*
.debpkg_template:
stage: package
before_script:
- apt-get update -y
- apt-get install -y git
- mkdir -p build/deb/minetest/DEBIAN/
- cp misc/debpkg-control build/deb/minetest/DEBIAN/control
- cp -a artifact/minetest/usr build/deb/minetest/
script:
- git clone $MINETEST_GAME_REPO build/deb/minetest/usr/share/minetest/games/minetest_game
- rm -rf build/deb/minetest/usr/share/minetest/games/minetest/.git
- sed -i 's/DATEPLACEHOLDER/'$(date +%y.%m.%d)'/g' build/deb/minetest/DEBIAN/control
- sed -i 's/LEVELDB_PLACEHOLDER/'$LEVELDB_PKG'/g' build/deb/minetest/DEBIAN/control
- cd build/deb/ && dpkg-deb -b minetest/ && mv minetest.deb ../../
artifacts:
expire_in: 90 day
paths:
- ./*.deb
.debpkg_install:
stage: deploy
before_script:
- apt-get update -y
script:
- apt-get install -y ./*.deb
- minetest --version
##
## Debian
## Debian mother of many distros
##
# Jessie
build:debian-8:
extends: .build_template
image: debian:8
before_script:
- echo "" > /etc/apt/apt.conf.d/50venenuxcustom
- echo "APT::Get::AllowUnauthenticated \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::AllowInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::AllowDowngradeToInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::AllowReleaseInfoChange::Suite \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::Check-Valid-Until \"false\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::Languages \"en\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Aptitude::CmdLine::Ignore-Trust-Violations \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
# - echo "Acquire::https::download.opensuse.org::Verify-Peer "false";" >> /etc/apt/apt.conf.d/50venenuxcustom
- rm -rf /etc/apt/sources.list
- echo "deb http://archive.debian.org/debian/ jessie main contrib" > /etc/apt/sources.list.d/50debianoficial.list
- echo "deb http://archive.debian.org/debian/ jessie-backports main contrib non-free" >> /etc/apt/sources.list.d/50debianoficial.list
- echo "deb http://deb.freexian.com/extended-lts jessie main contrib non-free" >> /etc/apt/sources.list.d/50debianoficial.list
- DEBIAN_FRONTEND=noninteractive apt-get update -y || true
- DEBIAN_FRONTEND=noninteractive apt-get -y --force-yes install build-essential git cmake pkg-config debhelper lsb-release gettext libbz2-dev libcurl4-gnutls-dev libnl-genl-3-dev libnl-3-dev librtmp-dev libidn11-dev libncurses-dev libfreetype6-dev libglu1-mesa-dev libgmp-dev libirrlicht-dev libjpeg-dev libleveldb-dev libluajit-5.1-dev liblua5.1-dev libogg-dev libopenal-dev libpng-dev libpq-dev libhiredis-dev libspatialindex-dev libsqlite3-dev libvorbis-dev libx11-dev libxxf86vm-dev libpq-dev libhiredis-dev zlib1g-dev doxygen libxrandr-dev x11proto-xf86vidmode-dev
- DEBIAN_FRONTEND=noninteractive apt-get -y --force-yes install -t jessie-backports libjsoncpp-dev
# Stretch
build:debian-9:
extends: .build_template
image: debian:9
before_script:
- apt-get update -y
- apt-get -y install build-essential libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev
- echo "" > /etc/apt/apt.conf.d/50venenuxcustom
- echo "APT::Get::AllowUnauthenticated \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::AllowInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::AllowDowngradeToInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::AllowReleaseInfoChange::Suite \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::Check-Valid-Until \"false\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::Languages \"en\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Aptitude::CmdLine::Ignore-Trust-Violations \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- rm -rf /etc/apt/sources.list
- echo "deb http://archive.debian.org/debian/ stretch main contrib" > /etc/apt/sources.list.d/50debianoficial.list
- echo "deb http://archive.debian.org/debian/ stretch-backports main contrib non-free" >> /etc/apt/sources.list.d/50debianoficial.list
- echo "deb http://deb.freexian.com/extended-lts stretch main contrib non-free" >> /etc/apt/sources.list.d/50debianoficial.list
- DEBIAN_FRONTEND=noninteractive apt-get update -y || true
- DEBIAN_FRONTEND=noninteractive apt-get -y --force-yes install build-essential git cmake pkg-config cmake-data debhelper lsb-release gettext libbz2-dev libcurl4-gnutls-dev libnl-genl-3-dev libnl-3-dev librtmp-dev libidn11-dev libncurses-dev libfreetype6-dev libglu1-mesa-dev libgmp-dev libirrlicht-dev libjpeg-dev libjsoncpp-dev libleveldb-dev libluajit-5.1-dev liblua5.1-dev libogg-dev libopenal-dev libpng-dev libpq-dev libhiredis-dev libspatialindex-dev libsqlite3-dev libvorbis-dev libx11-dev libxxf86vm-dev postgresql-server-dev-all libpq-dev libhiredis-dev zlib1g-dev doxygen libxrandr-dev mesa-common-dev x11proto-xf86vidmode-dev libzstd-dev
package:debian-9:
extends: .debpkg_template
image: debian:9
needs:
- build:debian-9
variables:
LEVELDB_PKG: libleveldb1v5
# Bullseye
deploy:debian-9:
extends: .debpkg_install
image: debian:9
needs:
- package:debian-9
# Buster
build:debian-10:
build:debian-11:
extends: .build_template
image: debian:10
image: debian:11
before_script:
- apt-get update -y
- apt-get -y install build-essential libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev
- echo "" > /etc/apt/apt.conf.d/50venenuxcustom
- echo "APT::Get::AllowUnauthenticated \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::AllowInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::AllowDowngradeToInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::AllowReleaseInfoChange::Suite \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::Check-Valid-Until \"false\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::Languages \"en\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Aptitude::CmdLine::Ignore-Trust-Violations \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- DEBIAN_FRONTEND=noninteractive apt-get update -y || true
- DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential git cmake pkg-config cmake-data debhelper lsb-release gettext libbz2-dev libcurl4-gnutls-dev libnl-genl-3-dev libnl-3-dev librtmp-dev libidn11-dev libncurses-dev libfreetype6-dev libglu1-mesa-dev libgmp-dev libirrlicht-dev libjpeg-dev libjsoncpp-dev libleveldb-dev libluajit-5.1-dev liblua5.1-dev libogg-dev libopenal-dev libpng-dev libpq-dev libhiredis-dev libspatialindex-dev libsqlite3-dev libvorbis-dev libx11-dev libxxf86vm-dev postgresql-server-dev-all libpq-dev libhiredis-dev zlib1g-dev doxygen libxrandr-dev mesa-common-dev x11proto-xf86vidmode-dev libzstd-dev
package:debian-10:
extends: .debpkg_template
image: debian:10
needs:
- build:debian-10
variables:
LEVELDB_PKG: libleveldb1d
# bookworm
build:debian-12:
extends: .build_template
image: debian:12
before_script:
- DEBIAN_FRONTEND=noninteractive apt-get update -y || true
- DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential git cmake pkg-config cmake-data debhelper lsb-release gettext libbz2-dev libcurl4-gnutls-dev libnl-genl-3-dev libnl-3-dev librtmp-dev libidn11-dev libncurses-dev libfreetype6-dev libglu1-mesa-dev libgmp-dev libirrlicht-dev libjpeg-dev libjsoncpp-dev libleveldb-dev libluajit-5.1-dev liblua5.1-dev libogg-dev libopenal-dev libpng-dev libpq-dev libhiredis-dev libspatialindex-dev libsqlite3-dev libvorbis-dev libx11-dev libxxf86vm-dev postgresql-server-dev-all libpq-dev libhiredis-dev zlib1g-dev doxygen libxrandr-dev mesa-common-dev x11proto-xf86vidmode-dev libzstd-dev
deploy:debian-10:
extends: .debpkg_install
image: debian:10
needs:
- package:debian-10
##
## Ubuntu
##
# Utopic most close to jessie
#build:ubuntu-14.10:
# extends: .build_template
# image: ubuntu:utopic
# before_script:
# - echo "" > /etc/apt/apt.conf.d/50venenuxcustom
# - echo "APT::Get::AllowUnauthenticated \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
# - echo "Acquire::AllowInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
# - echo "Acquire::AllowDowngradeToInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
# - echo "Acquire::AllowReleaseInfoChange::Suite \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
# - echo "Acquire::Check-Valid-Until \"false\";" >> /etc/apt/apt.conf.d/50venenuxcustom
# - echo "Acquire::Languages \"en\";" >> /etc/apt/apt.conf.d/50venenuxcustom
# - echo "Aptitude::CmdLine::Ignore-Trust-Violations \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
# - rm -rf /etc/apt/sources.list
# - echo "deb http://old-releases.ubuntu.com/ubuntu/ utopic main restricted universe multiverse" > /etc/apt/sources.list.d/50debianoficial.list
# - echo "deb http://old-releases.ubuntu.com/ubuntu/ utopic-updates main restricted universe multiverse" >> /etc/apt/sources.list.d/50debianoficial.list
# - echo "deb http://old-releases.ubuntu.com/ubuntu utopic-security main restricted universe multiverse" >> /etc/apt/sources.list.d/50debianoficial.list
# - apt-get update -y || true
# - apt-get -y --force-yes install build-essential cmake pkg-config debhelper lsb-release gettext libbz2-dev libcurl4-gnutls-dev libnl-genl-3-dev libnl-3-dev librtmp-dev libidn11-dev libncurses-dev libfreetype6-dev libglu1-mesa-dev libgmp-dev libirrlicht-dev libjpeg-dev libjsoncpp-dev libleveldb-dev libluajit-5.1-dev liblua5.1-dev libogg-dev libopenal-dev libpng-dev libpq-dev libhiredis-dev libsqlite3-dev libvorbis-dev libx11-dev libxxf86vm-dev libpq-dev libhiredis-dev zlib1g-dev doxygen libxrandr-dev mesa-common-dev x11proto-xf86vidmode-dev
# Zesty most close to stretch
build:ubuntu-17.04:
extends: .build_template
image: ubuntu:zesty
before_script:
- echo "" > /etc/apt/apt.conf.d/50venenuxcustom
- echo "APT::Get::AllowUnauthenticated \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::AllowInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::AllowDowngradeToInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::AllowReleaseInfoChange::Suite \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::Check-Valid-Until \"false\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::Languages \"en\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Aptitude::CmdLine::Ignore-Trust-Violations \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- rm -rf /etc/apt/sources.list
- echo "deb http://old-releases.ubuntu.com/ubuntu/ zesty main restricted universe multiverse" > /etc/apt/sources.list.d/50debianoficial.list
- echo "deb http://old-releases.ubuntu.com/ubuntu/ zesty-updates main restricted universe multiverse" >> /etc/apt/sources.list.d/50debianoficial.list
- echo "deb http://old-releases.ubuntu.com/ubuntu zesty-security main restricted universe multiverse" >> /etc/apt/sources.list.d/50debianoficial.list
- DEBIAN_FRONTEND=noninteractive apt-get update -y || true
- DEBIAN_FRONTEND=noninteractive apt-get -y --force-yes install build-essential git cmake pkg-config cmake-data debhelper dh-systemd dh-autoreconf lsb-release gettext libbz2-dev libcurl4-gnutls-dev libnl-genl-3-dev libnl-3-dev librtmp-dev libidn11-dev libncurses-dev libfreetype6-dev libglu1-mesa-dev libgmp-dev libirrlicht-dev libjpeg-dev libjsoncpp-dev libleveldb-dev libluajit-5.1-dev liblua5.1-dev libogg-dev libopenal-dev libpng-dev libpq-dev libhiredis-dev libspatialindex-dev libsqlite3-dev libvorbis-dev libx11-dev libxxf86vm-dev postgresql-server-dev-all libpq-dev libhiredis-dev zlib1g-dev doxygen libxrandr-dev mesa-common-dev x11proto-xf86vidmode-dev libzstd-dev
# artful most close to stretch
build:ubuntu-17.10:
extends: .build_template
image: ubuntu:artful
before_script:
- echo "" > /etc/apt/apt.conf.d/50venenuxcustom
- echo "APT::Get::AllowUnauthenticated \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::AllowInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::AllowDowngradeToInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::AllowReleaseInfoChange::Suite \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::Check-Valid-Until \"false\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::Languages \"en\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Aptitude::CmdLine::Ignore-Trust-Violations \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- rm -rf /etc/apt/sources.list
- echo "deb http://old-releases.ubuntu.com/ubuntu/ artful main restricted universe multiverse" > /etc/apt/sources.list.d/50debianoficial.list
- echo "deb http://old-releases.ubuntu.com/ubuntu/ artful-updates main restricted universe multiverse" >> /etc/apt/sources.list.d/50debianoficial.list
- echo "deb http://old-releases.ubuntu.com/ubuntu artful-security main restricted universe multiverse" >> /etc/apt/sources.list.d/50debianoficial.list
- DEBIAN_FRONTEND=noninteractive apt-get update -y || true
- DEBIAN_FRONTEND=noninteractive apt-get -y --force-yes install build-essential git cmake pkg-config cmake-data debhelper dh-systemd dh-autoreconf lsb-release gettext libbz2-dev libcurl4-gnutls-dev libnl-genl-3-dev libnl-3-dev librtmp-dev libidn11-dev libncurses-dev libfreetype6-dev libglu1-mesa-dev libgmp-dev libirrlicht-dev libjpeg-dev libjsoncpp-dev libleveldb-dev libluajit-5.1-dev liblua5.1-dev libogg-dev libopenal-dev libpng-dev libpq-dev libhiredis-dev libspatialindex-dev libsqlite3-dev libvorbis-dev libx11-dev libxxf86vm-dev postgresql-server-dev-all libpq-dev libhiredis-dev zlib1g-dev doxygen libxrandr-dev mesa-common-dev x11proto-xf86vidmode-dev libzstd-dev
# Xenial
build:ubuntu-16.04:
extends: .build_template
image: ubuntu:xenial
before_script:
- apt-get update -y
- apt-get -y install build-essential libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev
package:ubuntu-16.04:
extends: .debpkg_template
image: ubuntu:xenial
needs:
- build:ubuntu-16.04
variables:
LEVELDB_PKG: libleveldb1v5
deploy:ubuntu-16.04:
extends: .debpkg_install
image: ubuntu:xenial
needs:
- package:ubuntu-16.04
- echo "" > /etc/apt/apt.conf.d/50venenuxcustom
- echo "APT::Get::AllowUnauthenticated \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::AllowInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::AllowDowngradeToInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::AllowReleaseInfoChange::Suite \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::Check-Valid-Until \"false\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::Languages \"en\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Aptitude::CmdLine::Ignore-Trust-Violations \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- DEBIAN_FRONTEND=noninteractive apt-get update -y || true
- DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential git cmake pkg-config libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev
# Bionic
@ -137,22 +196,42 @@ build:ubuntu-18.04:
extends: .build_template
image: ubuntu:bionic
before_script:
- apt-get update -y
- apt-get -y install build-essential libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev
- echo "" > /etc/apt/apt.conf.d/50venenuxcustom
- echo "APT::Get::AllowUnauthenticated \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::AllowInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::AllowDowngradeToInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::AllowReleaseInfoChange::Suite \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::Check-Valid-Until \"false\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::Languages \"en\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Aptitude::CmdLine::Ignore-Trust-Violations \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- DEBIAN_FRONTEND=noninteractive apt-get update -y || true
- DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential git cmake pkg-config libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev
package:ubuntu-18.04:
extends: .debpkg_template
image: ubuntu:bionic
needs:
- build:ubuntu-18.04
variables:
LEVELDB_PKG: libleveldb1v5
# Focal
deploy:ubuntu-18.04:
extends: .debpkg_install
image: ubuntu:bionic
needs:
- package:ubuntu-18.04
build:ubuntu-20.04:
extends: .build_template
image: ubuntu:focal
before_script:
- echo "" > /etc/apt/apt.conf.d/50venenuxcustom
- echo "APT::Get::AllowUnauthenticated \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::AllowInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::AllowDowngradeToInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::AllowReleaseInfoChange::Suite \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::Check-Valid-Until \"false\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Acquire::Languages \"en\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- echo "Aptitude::CmdLine::Ignore-Trust-Violations \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- DEBIAN_FRONTEND=noninteractive apt-get update -y || true
- DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential git cmake pkg-config libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev
# jammy
build:ubuntu-22.04:
extends: .build_template
image: ubuntu:jammy
before_script:
- DEBIAN_FRONTEND=noninteractive apt-get update -y || true
- DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential git cmake pkg-config libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev
##
## Fedora
@ -163,7 +242,28 @@ build:fedora-28:
extends: .build_template
image: fedora:28
before_script:
- dnf -y install make automake gcc gcc-c++ kernel-devel cmake libcurl-devel openal-soft-devel libvorbis-devel libXxf86vm-devel libogg-devel freetype-devel mesa-libGL-devel zlib-devel jsoncpp-devel irrlicht-devel gmp-devel sqlite-devel luajit-devel leveldb-devel ncurses-devel spatialindex-devel
- dnf -y install make automake gcc gcc-c++ kernel-devel git cmake pkgconfig libidn-devel libcurl-devel openal-soft-devel libvorbis-devel libXxf86vm-devel libogg-devel freetype-devel mesa-libGL-devel zlib-devel jsoncpp-devel irrlicht-devel gmp-devel sqlite-devel luajit-devel leveldb-devel ncurses-devel spatialindex-devel
# Fedora 36
build:fedora-36:
extends: .build_template
image: fedora:36
before_script:
- dnf -y install make automake gcc gcc-c++ kernel-devel git cmake pkgconfig libidn-devel bzip2-devel gettext-devel sqlite-devel zlib-devel libpng-devel libjpeg-turbo-devel libXxf86vm-devel mesa-libGL-devel irrlicht-devel desktop-file-utils systemd openal* libvorbis* jsoncpp-devel libcurl-devel libcurl luajit-devel leveldb-devel gmp-devel libappstream-glib freetype-devel spatialindex-devel openssl-devel libogg-devel libpq-devel hiredis-devel libzstd-devel libXi-devel ncurses-devel doxygen
# Fedora 37
build:fedora-37:
extends: .build_template
image: fedora:37
before_script:
- dnf -y install make automake gcc gcc-c++ kernel-devel git cmake pkgconfig libidn-devel bzip2-devel gettext-devel sqlite-devel zlib-devel libpng-devel libjpeg-turbo-devel libXxf86vm-devel mesa-libGL-devel irrlicht-devel desktop-file-utils systemd openal* libvorbis* jsoncpp-devel libcurl-devel libcurl luajit-devel leveldb-devel gmp-devel libappstream-glib freetype-devel spatialindex-devel openssl-devel libogg-devel libpq-devel hiredis-devel libzstd-devel libXi-devel ncurses-devel doxygen
# Fedora 38
build:fedora-38:
extends: .build_template
image: fedora:38
before_script:
- dnf -y install make automake gcc gcc-c++ kernel-devel git cmake pkgconfig libidn-devel bzip2-devel gettext-devel sqlite-devel zlib-devel libpng-devel libjpeg-turbo-devel libXxf86vm-devel mesa-libGL-devel irrlicht-devel desktop-file-utils systemd openal* libvorbis* jsoncpp-devel libcurl-devel libcurl luajit-devel leveldb-devel gmp-devel libappstream-glib freetype-devel spatialindex-devel openssl-devel libogg-devel libpq-devel hiredis-devel libzstd-devel libXi-devel ncurses-devel doxygen
##
## MinGW for Windows
@ -183,20 +283,23 @@ build:fedora-28:
artifacts:
expire_in: 1h
paths:
- build/minetest/_build/*
- build/multicraft/_build/*
.package_win_template:
extends: .generic_win_template
stage: package
script:
- unzip build/minetest/_build/minetest-*.zip
- cp -p /usr/${WIN_ARCH}-w64-mingw32/bin/libgcc*.dll minetest-*-win*/bin/
- cp -p /usr/${WIN_ARCH}-w64-mingw32/bin/libstdc++*.dll minetest-*-win*/bin/
- cp -p /usr/${WIN_ARCH}-w64-mingw32/bin/libwinpthread*.dll minetest-*-win*/bin/
- unzip build/multicraft/_build/multicraft-*.zip
- wget -nv https://gitlab.com/minenux/minetest-game-minetest/-/archive/stable-5.2/minetest-game-minetest-stable-5.2.tar.gz -O game.tar.gz
- tar -xvf game.tar.gz -C /
- mv /minetest*game* multicraft-*-win*/games/minetest || true
- cp -p /usr/${WIN_ARCH}-w64-mingw32/bin/libgcc*.dll multicraft-*-win*/bin/
- cp -p /usr/${WIN_ARCH}-w64-mingw32/bin/libstdc++*.dll multicraft-*-win*/bin/
- cp -p /usr/${WIN_ARCH}-w64-mingw32/bin/libwinpthread*.dll multicraft-*-win*/bin/
artifacts:
expire_in: 90 day
paths:
- minetest-*-win*/*
- multicraft-*-win*/*
build:win32:
extends: .build_win_template
@ -227,67 +330,3 @@ package:win64:
variables:
WIN_ARCH: "x86_64"
##
## Docker
##
package:docker:
stage: package
image: docker:stable
services:
- docker:dind
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
script:
- docker build . -t ${CONTAINER_IMAGE}/server:$CI_COMMIT_SHA -t ${CONTAINER_IMAGE}/server:$CI_COMMIT_REF_NAME -t ${CONTAINER_IMAGE}/server:latest
- docker push ${CONTAINER_IMAGE}/server:$CI_COMMIT_SHA
- docker push ${CONTAINER_IMAGE}/server:$CI_COMMIT_REF_NAME
- docker push ${CONTAINER_IMAGE}/server:latest
##
## Gitlab Pages (Lua API documentation)
##
pages:
stage: deploy
image: python:3.8
before_script:
- pip install git+https://github.com/Python-Markdown/markdown.git
- pip install git+https://github.com/mkdocs/mkdocs.git
- pip install pygments
script:
- cd doc/mkdocs && ./build.sh
artifacts:
paths:
- public
only:
- master
##
## AppImage
##
package:appimage-client:
stage: package
image: appimagecrafters/appimage-builder
needs:
- build:ubuntu-18.04
before_script:
- apt-get update -y
- apt-get install -y git wget
# Collect files
- mkdir AppDir
- cp -a artifact/minetest/usr/ AppDir/usr/
- rm AppDir/usr/bin/minetestserver
- cp -a clientmods AppDir/usr/share/minetest
script:
- git clone $MINETEST_GAME_REPO AppDir/usr/share/minetest/games/minetest_game
- rm -rf AppDir/usr/share/minetest/games/minetest/.git
- export VERSION=$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA
# Remove PrefersNonDefaultGPU property due to validation errors
- sed -i '/PrefersNonDefaultGPU/d' AppDir/usr/share/applications/net.minetest.minetest.desktop
- appimage-builder --skip-test
artifacts:
expire_in: 90 day
paths:
- ./*.AppImage

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 2.6)
cmake_policy(SET CMP0025 OLD)
@ -6,10 +6,45 @@ cmake_policy(SET CMP0025 OLD)
project(multicraft)
set(PROJECT_NAME_CAPITALIZED "MultiCraft")
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(GCC_MINIMUM_VERSION "5.1")
set(CLANG_MINIMUM_VERSION "3.5")
# check compatible compileer must be after project definition and set flags, assume if C++ is installed also CC is installed
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
endif()
if (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
elseif (CMAKE_C_COMPILER_VERSION VERSION_EQUAL 4.6)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu1x")
else()
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
endif()
message(STATUS "using gnu compiler")
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++1y")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
endif()
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.5)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
endif()
message(STATUS "using clang compiler")
else()
if (CMAKE_VERSION VERSION_GREATER 3.0)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 11)
else()
if(APPLE)
# Fix behavior of CMAKE_CXX_STANDARD when targeting macOS.
if (POLICY CMP0025)
cmake_policy(SET CMP0025 NEW)
endif ()
endif ()
endif()
message(STATUS "using default installed compiler")
endif()
# Also remember to set PROTOCOL_VERSION in network/networkprotocol.h when releasing
set(VERSION_MAJOR 2)
@ -20,12 +55,12 @@ set(VERSION_EXTRA "" CACHE STRING "Stuff to append to version string")
# Change to false for releases
set(DEVELOPMENT_BUILD FALSE)
set(ENABLE_UPDATE_CHECKER (NOT ${DEVELOPMENT_BUILD}) CACHE BOOL
set(ENABLE_UPDATE_CHECKER FALSE CACHE BOOL
"Whether to enable update checks by default")
set(VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
if(VERSION_EXTRA)
set(VERSION_STRING ${VERSION_STRING}-${VERSION_EXTRA})
set(VERSION_STRING "${VERSION_STRING}-${VERSION_EXTRA}")
elseif(DEVELOPMENT_BUILD)
set(VERSION_STRING "${VERSION_STRING}-dev")
endif()
@ -165,7 +200,7 @@ if(RUN_IN_PLACE)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/textures/texture_packs_here.txt" DESTINATION "${SHAREDIR}/textures")
endif()
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/games/minetest_game" DESTINATION "${SHAREDIR}/games/"
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/games/minetest" DESTINATION "${SHAREDIR}/games/"
COMPONENT "SUBGAME_MINETEST_GAME" OPTIONAL PATTERN ".git*" EXCLUDE )
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/games/devtest" DESTINATION "${SHAREDIR}/games/"
COMPONENT "SUBGAME_MINIMAL" OPTIONAL PATTERN ".git*" EXCLUDE )
@ -189,17 +224,15 @@ install(FILES "doc/world_format.txt" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "multicraft.conf.example" DESTINATION "${EXAMPLE_CONF_DIR}")
if(UNIX AND NOT APPLE)
install(FILES "doc/minetest.6" "doc/minetestserver.6" DESTINATION "${MANDIR}/man6")
install(FILES "misc/net.minetest.minetest.desktop" DESTINATION "${XDG_APPS_DIR}")
install(FILES "doc/minetest.6" DESTINATION "${MANDIR}/man6" RENAME "${PROJECT_NAME}.6")
install(FILES "doc/minetest.6" DESTINATION "${MANDIR}/man6" RENAME "${PROJECT_NAME}server.6")
install(FILES "misc/net.minetest.minetest.desktop" DESTINATION "${XDG_APPS_DIR}" RENAME "net.minetest.${PROJECT_NAME}.desktop")
install(FILES "misc/net.minetest.minetest.appdata.xml" DESTINATION "${APPDATADIR}")
install(FILES "misc/minetest.svg" DESTINATION "${ICONDIR}/hicolor/scalable/apps")
install(FILES "misc/multicraft-xorg-icon-128.png"
DESTINATION "${ICONDIR}/hicolor/128x128/apps"
RENAME "multicraft.png")
install(FILES "misc/multicraft-xorg-icon-128.png" DESTINATION "${ICONDIR}/hicolor/128x128/apps" RENAME "${PROJECT_NAME}.png")
endif()
if(APPLE)
install(FILES "misc/minetest-icon.icns" DESTINATION "${SHAREDIR}")
install(FILES "misc/minetest-icon.icns" DESTINATION "${SHAREDIR}" RENAME "${PROJECT_NAME}-icon.icns")
install(FILES "misc/Info.plist" DESTINATION "${BUNDLE_PATH}/Contents")
endif()
@ -250,7 +283,7 @@ cpack_add_component(Docs
)
cpack_add_component(SUBGAME_MINETEST_GAME
DISPLAY_NAME "Minetest Game"
DISPLAY_NAME "Minetest"
DESCRIPTION "The default game bundled in the Minetest engine. Mainly used as a modding base."
GROUP "Games"
)
@ -329,3 +362,4 @@ if(DOXYGEN_FOUND)
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
endif()

View File

@ -1,6 +1,6 @@
FROM alpine:3.14
ENV MINETEST_GAME_VERSION master
ENV MINETEST_GAME_VERSION stable-5.2
COPY .git /usr/src/multicraft/.git
COPY CMakeLists.txt /usr/src/multicraft/CMakeLists.txt

View File

@ -8,7 +8,11 @@ option(ENABLE_SYSTEM_JSONCPP "Enable using a system-wide JSONCPP. May cause seg
if(ENABLE_SYSTEM_JSONCPP)
find_library(JSON_LIBRARY NAMES jsoncpp)
find_path(JSON_INCLUDE_DIR json/allocator.h PATH_SUFFIXES jsoncpp)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5)
find_path(JSON_INCLUDE_DIR json/features.h PATH_SUFFIXES jsoncpp)
else()
find_path(JSON_INCLUDE_DIR json/allocator.h PATH_SUFFIXES jsoncpp)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Json DEFAULT_MSG JSON_LIBRARY JSON_INCLUDE_DIR)

View File

@ -63,6 +63,45 @@ if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_WITHDEBINFO} -O2 -g")
endif(CMAKE_COMPILER_IS_GNUCC)
# check compatible compileer must be after project definition and set flags, assume if C++ is installed also CC is installed
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
endif()
if (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
elseif (CMAKE_C_COMPILER_VERSION VERSION_EQUAL 4.6)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu1x")
else()
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
endif()
message(STATUS "using gnu compiler")
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++1y")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
endif()
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.5)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
endif()
message(STATUS "using clang compiler")
else()
if (CMAKE_VERSION VERSION_GREATER 3.0)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 11)
else()
if(APPLE)
# Fix behavior of CMAKE_CXX_STANDARD when targeting macOS.
if (POLICY CMP0025)
cmake_policy(SET CMP0025 NEW)
endif ()
endif ()
endif()
message(STATUS "using default installed compiler")
endif()
add_subdirectory(src build)

View File

@ -169,7 +169,18 @@ option(ENABLE_POSTGRESQL "Enable PostgreSQL backend" TRUE)
set(USE_POSTGRESQL FALSE)
if(ENABLE_POSTGRESQL)
find_package("PostgreSQL")
if(CMAKE_VERSION VERSION_LESS "3.20")
find_package(PostgreSQL QUIET)
# Before CMake 3.20 FindPostgreSQL.cmake always looked for server includes
# but we don't need them, so continue anyway if only those are missing.
if(PostgreSQL_INCLUDE_DIR AND PostgreSQL_LIBRARY)
set(PostgreSQL_FOUND TRUE)
set(PostgreSQL_INCLUDE_DIRS ${PostgreSQL_INCLUDE_DIR})
set(PostgreSQL_LIBRARIES ${PostgreSQL_LIBRARY})
endif()
else()
find_package(PostgreSQL)
endif()
if(PostgreSQL_FOUND)
set(USE_POSTGRESQL TRUE)
@ -733,11 +744,13 @@ option(APPLY_LOCALE_BLACKLIST "Use a blacklist to avoid broken locales" TRUE)
if (GETTEXTLIB_FOUND AND APPLY_LOCALE_BLACKLIST)
set(GETTEXT_USED_LOCALES "")
foreach(LOCALE ${GETTEXT_AVAILABLE_LOCALES})
if (NOT "${LOCALE}" IN_LIST GETTEXT_BLACKLISTED_LOCALES)
if (NOT ";${GETTEXT_BLACKLISTED_LOCALES};" MATCHES ";${LOCALE};")
list(APPEND GETTEXT_USED_LOCALES ${LOCALE})
endif()
endforeach()
message(STATUS "Locale blacklist applied; Locales used: ${GETTEXT_USED_LOCALES}")
elseif (GETTEXTLIB_FOUND)
set(GETTEXT_USED_LOCALES ${GETTEXT_AVAILABLE_LOCALES})
endif()
# Set some optimizations and tweaks
@ -784,6 +797,47 @@ else()
else()
set(RELEASE_WARNING_FLAGS "")
endif()
# check compatible compileer must be after project definition and set flags, assume if C++ is installed also CC is installed
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
endif()
if (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
elseif (CMAKE_C_COMPILER_VERSION VERSION_EQUAL 4.6)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu1x")
else()
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
endif()
message(STATUS "using gnu compiler")
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++1y")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
endif()
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.5)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
endif()
message(STATUS "using clang compiler")
else()
if (CMAKE_VERSION VERSION_GREATER 3.0)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 11)
else()
if(APPLE)
# Fix behavior of CMAKE_CXX_STANDARD when targeting macOS.
if (POLICY CMP0025)
cmake_policy(SET CMP0025 NEW)
endif ()
endif ()
endif()
message(STATUS "using default installed compiler")
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(WARNING_FLAGS "${WARNING_FLAGS} -Wsign-compare")
endif()
@ -809,6 +863,21 @@ else()
# - we don't deal with Inf/NaN or signed zero
set(MATH_FLAGS "-fno-math-errno -fno-trapping-math -ffinite-math-only -fno-signed-zeros")
# only related to moder x86 32bit platforms using gcc compilers
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.7)
# Enable SSE for floating point math on 32-bit x86 by default
# reasoning see minetest issue #11810 and https://gcc.gnu.org/wiki/FloatingPointMath
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
check_c_source_compiles("#ifndef __i686__\n#error\n#endif\nint main(){}" IS_I686)
if(IS_I686)
message(STATUS "Detected Intel x86: using SSE instead of x87 FPU")
set(OTHER_FLAGS "${OTHER_FLAGS} -mfpmath=sse -msse")
endif()
endif()
endif()
endif()
set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG ${RELEASE_WARNING_FLAGS} ${WARNING_FLAGS} ${OTHER_FLAGS} -Wall -pipe -funroll-loops")
if(CMAKE_SYSTEM_NAME MATCHES "(Darwin|BSD|DragonFly)")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Os")
@ -822,8 +891,13 @@ else()
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${MATH_FLAGS}")
endif()
endif(CMAKE_SYSTEM_NAME MATCHES "(Darwin|BSD|DragonFly)")
set(CMAKE_CXX_FLAGS_SEMIDEBUG "-g -O1 -Wall ${WARNING_FLAGS} ${OTHER_FLAGS}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS} $ENV{CPPFLAGS}")
set(CMAKE_CXX_FLAGS_SEMIDEBUG "-g -O1 -Wall ${WARNING_FLAGS} ${OTHER_FLAGS} $ENV{CPPFLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall ${WARNING_FLAGS} ${OTHER_FLAGS}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${CMAKE_C_FLAGS} $ENV{CFLAGS} ")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${CMAKE_C_FLAGS} -g")
set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_PROFILE} ${CMAKE_C_FLAGS} -O1 -g")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_WITHDEBINFO} ${CMAKE_C_FLAGS} $ENV{CFLAGS} -g")
if(USE_GPROF)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -pg")
@ -912,7 +986,7 @@ if(BUILD_CLIENT)
if(USE_GETTEXT)
foreach(LOCALE ${GETTEXT_USED_LOCALES})
set_mo_paths(MO_BUILD_PATH MO_DEST_PATH ${LOCALE})
set(MO_BUILD_PATH "${MO_BUILD_PATH}/minetest.mo")
set(MO_BUILD_PATH "${MO_BUILD_PATH}/${PROJECT_NAME}.mo")
install(FILES ${MO_BUILD_PATH} DESTINATION ${MO_DEST_PATH})
endforeach()
endif()
@ -952,7 +1026,7 @@ if (USE_GETTEXT)
foreach(LOCALE ${GETTEXT_USED_LOCALES})
set(PO_FILE_PATH "${GETTEXT_PO_PATH}/${LOCALE}/minetest.po")
set_mo_paths(MO_BUILD_PATH MO_DEST_PATH ${LOCALE})
set(MO_FILE_PATH "${MO_BUILD_PATH}/minetest.mo")
set(MO_FILE_PATH "${MO_BUILD_PATH}/${PROJECT_NAME}.mo")
add_custom_command(OUTPUT ${MO_BUILD_PATH}
COMMAND ${CMAKE_COMMAND} -E make_directory ${MO_BUILD_PATH}

View File

@ -1,12 +1,12 @@
#!/bin/bash
set -e
CORE_GIT=https://github.com/minetest/minetest
CORE_BRANCH=master
CORE_NAME=minetest
GAME_GIT=https://github.com/minetest/minetest_game
GAME_BRANCH=master
GAME_NAME=minetest_game
CORE_GIT=https://gitlab.com/minenux/minetest-engine-multicraft2
CORE_BRANCH=minenux
CORE_NAME=multicraft
GAME_GIT=https://gitlab.com/minenux/minetest-game-minetest
GAME_BRANCH=stable-5.2
GAME_NAME=minetest
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ $# -ne 1 ]; then
@ -88,7 +88,7 @@ cd $builddir
if [ ! "x$EXISTING_MINETEST_DIR" = "x" ]; then
cd /$EXISTING_MINETEST_DIR # must be absolute path
else
[ -d $CORE_NAME ] && (cd $CORE_NAME && git pull) || (git clone -b $CORE_BRANCH $CORE_GIT)
[ -d $CORE_NAME ] && (cd $CORE_NAME && git pull) || (git clone -b $CORE_BRANCH $CORE_GIT $CORE_NAME)
cd $CORE_NAME
fi
git_hash=$(git rev-parse --short HEAD)
@ -96,7 +96,7 @@ git_hash=$(git rev-parse --short HEAD)
# Get minetest_game
if [ "x$NO_MINETEST_GAME" = "x" ]; then
cd games
[ -d $GAME_NAME ] && (cd $GAME_NAME && git pull) || (git clone -b $GAME_BRANCH $GAME_GIT)
[ -d $GAME_NAME ] && (cd $GAME_NAME && git pull) || (git clone -b $GAME_BRANCH $GAME_GIT $GAME_NAME)
cd ..
fi

View File

@ -1,12 +1,12 @@
#!/bin/bash
set -e
CORE_GIT=https://github.com/minetest/minetest
CORE_BRANCH=master
CORE_NAME=minetest
GAME_GIT=https://github.com/minetest/minetest_game
GAME_BRANCH=master
GAME_NAME=minetest_game
CORE_GIT=https://gitlab.com/minenux/minetest-engine-multicraft2
CORE_BRANCH=minenux
CORE_NAME=multicraft
GAME_GIT=https://gitlab.com/minenux/minetest-game-minetest
GAME_BRANCH=stable-5.2
GAME_NAME=minetest
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ $# -ne 1 ]; then
@ -80,7 +80,7 @@ cd $builddir
if [ ! "x$EXISTING_MINETEST_DIR" = "x" ]; then
cd /$EXISTING_MINETEST_DIR # must be absolute path
else
[ -d $CORE_NAME ] && (cd $CORE_NAME && git pull) || (git clone -b $CORE_BRANCH $CORE_GIT)
[ -d $CORE_NAME ] && (cd $CORE_NAME && git pull) || (git clone -b $CORE_BRANCH $CORE_GIT $CORE_NAME)
cd $CORE_NAME
fi
git_hash=$(git rev-parse --short HEAD)
@ -88,7 +88,7 @@ git_hash=$(git rev-parse --short HEAD)
# Get minetest_game
if [ "x$NO_MINETEST_GAME" = "x" ]; then
cd games
[ -d $GAME_NAME ] && (cd $GAME_NAME && git pull) || (git clone -b $GAME_BRANCH $GAME_GIT)
[ -d $GAME_NAME ] && (cd $GAME_NAME && git pull) || (git clone -b $GAME_BRANCH $GAME_GIT $GAME_NAME)
cd ..
fi