aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormitchell <70453897+orbitalquark@users.noreply.github.com>2020-09-04 20:56:12 -0400
committermitchell <70453897+orbitalquark@users.noreply.github.com>2020-09-04 20:56:12 -0400
commit65abfec720806e641c64471104d592aaafed26f7 (patch)
tree88a3ef110e4b879ddf5aa5ed64725c9db520c6bd /src
parentaffc6c91f7e26b0ba76a82c4eea94926cf46afb0 (diff)
downloadtextadept-65abfec720806e641c64471104d592aaafed26f7.tar.gz
textadept-65abfec720806e641c64471104d592aaafed26f7.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/Dockerfile25
-rw-r--r--src/Makefile56
-rw-r--r--src/luadoc.patch23
3 files changed, 76 insertions, 28 deletions
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 $</src
- tar czf /tmp/$<.tgz $< && rm -rf $< && gpg --batch -ab /tmp/$<.tgz
-$(basedir).x86_64: ; hg archive $@ -X ".hg*"
-release64: $(basedir).x86_64
- make clean
PKG_CONFIG_PATH=/opt/gtk64/lib/pkgconfig make -j4 CFLAGS="$(CFLAGS) -m64" \
- CXXFLAGS="$(CXXFLAGS) -m64 -static-libstdc++" || return 0
+ CXXFLAGS="$(CXXFLAGS) -m64 -static-libstdc++"
make -j4 CFLAGS="$(CFLAGS) -m64" \
CXXFLAGS="$(CXXFLAGS) -m64 -static-libstdc++" \
CURSES_CFLAGS=-I/opt/ncursesw64/include/ncursesw \
- CURSES_LIBS="-L/opt/ncursesw64/lib -lncursesw" curses || return 0
+ CURSES_LIBS="-L/opt/ncursesw64/lib -lncursesw" curses
cp -rL ../doc ../lexers ../textadept* $< && cp *.asc $</src
- tar czf /tmp/$<.tgz $< && rm -rf $< && gpg --batch -ab /tmp/$<.tgz
-$(basedir).win32: ; hg archive $@ -X ".hg*"
+ tar czf $<.tgz $< && rm -rf $< && gpg --batch -ab $<.tgz
+$(basedir).win32: ; $(call archive,$@)
win32-release: $(basedir).win32
make -j4 clean win32-deps
cp win32gtk/bin/*.dll $< && cp -r win32gtk/etc \
@@ -336,25 +334,27 @@ win32-release: $(basedir).win32
make -j4 win32-curses
cp -rL ../doc ../lexers ../textadept* $<
cp *.asc $</src
- zip -r /tmp/$<.zip $< && rm -rf $< && gpg --batch -ab /tmp/$<.zip
-$(basedir).osx: ; mkdir $@ && cp ../scripts/osx/ta $@
-osx-release: $(basedir).osx
+ zip -r $<.zip $< && rm -rf $< && gpg --batch -ab $<.zip
+$(basedir).macOS: ; mkdir $@ && cp ../scripts/osx/ta $@
+osx-release: $(basedir).macOS
make clean osx-deps
- make -j4 osx
- make -j4 osx-curses
+ make CROSS=x86_64-apple-darwin9- CC=gcc CXX=g++ \
+ CXXFLAGS="-Os -std=c++11 -mdynamic-no-pic" -j4 osx
+ make CROSS=x86_64-apple-darwin9- CC=gcc CXX=g++ \
+ CXXFLAGS="-Os -std=c++11 -mdynamic-no-pic" -j4 osx-curses
make osx-app && mv $(osxapp) $<
- zip -r /tmp/$<.zip $< && rm -rf $< && gpg --batch -ab /tmp/$<.zip
+ zip -r $<.zip $< && rm -rf $< && gpg --batch -ab $<.zip
$(basedir).modules:
mkdir -p $@/modules
hg archive -R /home/mitchell/code/textadept_modules/ -r tip $@/modules
modules-release: $(basedir).modules
- zip -r /tmp/$<.zip $< && rm -r $< && gpg --batch -ab /tmp/$<.zip
+ zip -r $<.zip $< && rm -r $< && gpg --batch -ab $<.zip
osx-app: ../textadept ../textadept-curses ../scripts/osx/textadept_osx
mkdir -p $(osxapp_bin) $(osxapp_res)
cp Info.plist $(osxapp_bin)/../
cp $^ $(osxapp_bin)/
- hg archive $(osxapp_res) -X ".hg*"
+ $(call archive,$(osxapp_res))
cp -rL ../doc ../lexers $(osxapp_res) && cp *.asc $(osxapp_res)/src
mv $(osxapp_res)/core/images/textadept.icns $(osxapp_res)/
cp -r gtkosx/etc gtkosx/share $(osxapp_res)/ && mkdir $(osxapp_res)/lib/
diff --git a/src/luadoc.patch b/src/luadoc.patch
new file mode 100644
index 00000000..e0dae6a2
--- /dev/null
+++ b/src/luadoc.patch
@@ -0,0 +1,23 @@
+Preserve some formatting for Lua API documentation in Textadept.
+--- luadoc/util.lua.orig 2012-02-10 13:34:46.166184400 -0500
++++ luadoc/util.lua 2012-02-10 13:36:59.847551200 -0500
+@@ -29,8 +29,8 @@
+ -- @see string.gsub
+
+ function trim_comment (s)
+- s = string.gsub(s, "%-%-+(.*)$", "%1")
+- return trim(s)
++ s = string.gsub(s, "%-%-+ ?(.*)$", "%1")
++ return s
+ end
+
+ -------------------------------------------------------------------------------
+@@ -52,7 +52,7 @@
+ if str1 == nil or string.len(str1) == 0 then
+ return str2
+ else
+- return str1 .. " " .. str2
++ return str1 .. "\n" .. str2
+ end
+ end
+