From 65abfec720806e641c64471104d592aaafed26f7 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+orbitalquark@users.noreply.github.com> Date: Fri, 4 Sep 2020 20:56:12 -0400 Subject: Added support for building with Docker and dropped automated Linux i386 builds. Also tweaked Makefile with basic git support for an eventual migration to a new build service. --- src/Dockerfile | 25 +++++++++++++++++++++++++ src/Makefile | 56 ++++++++++++++++++++++++++++---------------------------- src/luadoc.patch | 23 +++++++++++++++++++++++ 3 files changed, 76 insertions(+), 28 deletions(-) create mode 100644 src/Dockerfile create mode 100644 src/luadoc.patch (limited to 'src') diff --git a/src/Dockerfile b/src/Dockerfile new file mode 100644 index 00000000..d565ed74 --- /dev/null +++ b/src/Dockerfile @@ -0,0 +1,25 @@ +FROM ubuntu:bionic +LABEL maintainer="textadept" + +RUN echo "Fetching packages" \ + && apt-get update \ + && DEBIAN_FRONTEND="noninteractive" apt-get install -y -q --no-install-recommends \ + build-essential ca-certificates curl git gnupg mercurial unzip wget zip \ + mingw-w64 \ + clang cmake libssl-dev libxml2-dev llvm-dev lzma-dev uuid-dev \ + libmpc-dev libmpfr-dev libgmp-dev \ + libgtk2.0-dev libncurses5-dev libncursesw5-dev \ + luadoc discount \ + && apt-get clean + +COPY luadoc.patch / +RUN echo "Patching LuaDoc" && cd /usr/share/lua/5.1 && patch -p0 < /luadoc.patch + +RUN echo "Building osxcross" \ + && wget https://github.com/tpoechtrager/osxcross/archive/748108aec4e3ceb672990df8164a11b0ac6084f7.zip \ + && unzip *.zip && mv osxcross-* /opt/osxcross && rm *.zip \ + && wget https://www.dropbox.com/s/yfbesd249w10lpc/MacOSX10.10.sdk.tar.xz \ + && mv MacOSX* /opt/osxcross/tarballs \ + && cd /opt/osxcross && UNATTENDED=1 SDK_VERSION="10.10" OSX_VERSION_MIN="10.6" ./build.sh +RUN echo "Cleaning up" && rm -rf /opt/osxcross/build /opt/osxcross/tarballs/MacOSX* +ENV PATH="$PATH:/opt/osxcross/target/bin" diff --git a/src/Makefile b/src/Makefile index 0f7f5776..c10c0a06 100644 --- a/src/Makefile +++ b/src/Makefile @@ -36,9 +36,11 @@ ifeq (win, $(findstring win, $(MAKECMDGOALS))) endif else ifeq (osx, $(findstring osx, $(MAKECMDGOALS))) # Cross-compile for macOS. - CROSS = x86_64-apple-darwin9- + CC = cc + CXX = c++ + CROSS = x86_64-apple-darwin14- CFLAGS += -mdynamic-no-pic - CXXFLAGS += -mdynamic-no-pic + CXXFLAGS += -mdynamic-no-pic -stdlib=libc++ LUA_CFLAGS = -DLUA_USE_MACOSX LDFLAGS = -liconv ifeq (, $(findstring curses, $(MAKECMDGOALS))) @@ -287,7 +289,7 @@ luadoc: ../modules ../core ../lexers/lexer.lua | ../modules/lua/lua.luadoc ifndef NIGHTLY basedir = textadept_$(version) else - basedir = textadept_NIGHTLY_$(shell date +"%F") + basedir = textadept_nightly_$(shell date +"%F") endif osxapp = Textadept.app osxapp_bin = $(osxapp)/Contents/MacOS @@ -303,30 +305,26 @@ osxapp_libs = libatk-1.0.0.dylib libcairo.2.dylib libexpat.1.dylib \ libpixman-1.0.dylib libpng16.16.dylib charset.alias \ gdk-pixbuf-2.0 gtk-2.0 -release-all: release release64 win32-release osx-release modules-release +release-all: release win32-release osx-release modules-release -$(basedir).i386: ; hg archive $@ -X ".hg*" -release: $(basedir).i386 +ifneq (, $(shell hg summary 2>/dev/null)) + archive = hg archive -X ".hg*" $(1) +else + archive = cd ../ && git archive HEAD --prefix src/$(1)/ | tar -xf - +endif + +$(basedir).linux: ; $(call archive,$@) +release: $(basedir).linux make deps clean doc sign-deps - PKG_CONFIG_PATH=/opt/gtk/lib/pkgconfig make -j4 \ - LDFLAGS="$(LDFLAGS) -static-libstdc++" - make -j4 LDFLAGS="$(LDFLAGS) -static-libstdc++" \ - CURSES_CFLAGS=-I/opt/ncursesw/include/ncursesw \ - CURSES_LIBS="-L/opt/ncursesw/lib -lncursesw" curses - cp -rL ../doc ../lexers ../textadept* $< && cp *.asc $