[gtk/flatpak-highlight] flatpak: Include highlight in gtk4-demo flatpak




commit 11154ba119146fd71ce364f1702af5956a1b6544
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Apr 12 23:53:52 2021 -0400

    flatpak: Include highlight in gtk4-demo flatpak
    
    Include the highlight utility to make syntax
    highlighting work in gtk4-demo. This requires
    building its dependencies as well, boost and lua.

 build-aux/flatpak/lua-5.1.5-so.patch | 43 ++++++++++++++++++++++
 build-aux/flatpak/org.gtk.Demo4.json | 71 ++++++++++++++++++++++++++++++++++++
 2 files changed, 114 insertions(+)
---
diff --git a/build-aux/flatpak/lua-5.1.5-so.patch b/build-aux/flatpak/lua-5.1.5-so.patch
new file mode 100644
index 0000000000..5fc61a087f
--- /dev/null
+++ b/build-aux/flatpak/lua-5.1.5-so.patch
@@ -0,0 +1,43 @@
+diff -ur lua-5.1.4/src/Makefile lua-5.1.4-new/src/Makefile
+--- lua-5.1.4/src/Makefile     2008-01-19 20:37:58.000000000 +0100
++++ lua-5.1.4-new/src/Makefile 2012-02-23 18:26:43.000000000 +0100
+@@ -23,6 +23,7 @@
+ PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
+ 
+ LUA_A=        liblua.a
++LUA_SO=       liblua.so
+ CORE_O=       lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \
+       lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o  \
+       lundump.o lvm.o lzio.o
+@@ -36,7 +37,7 @@
+ LUAC_O=       luac.o print.o
+ 
+ ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O)
+-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
++ALL_T= $(LUA_A) $(LUA_SO) $(LUA_T) $(LUAC_T)
+ ALL_A= $(LUA_A)
+ 
+ default: $(PLAT)
+@@ -51,6 +52,11 @@
+       $(AR) $@ $?
+       $(RANLIB) $@
+ 
++$(LUA_SO): $(CORE_O) $(LIB_O)
++      $(CC) -shared -ldl -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? -lm $(MYLDFLAGS)
++      ln -sf $(LUA_SO).$(R) $(LUA_SO).$(V)
++      ln -sf $(LUA_SO).$(R) $(LUA_SO)
++
+ $(LUA_T): $(LUA_O) $(LUA_A)
+       $(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
+ 
+--- lua-5.1.4/Makefile 2008-08-12 02:40:48.000000000 +0200
++++ lua-5.1.4-new/Makefile     2012-02-23 19:06:32.000000000 +0100
+@@ -53,7 +53,7 @@
+ all:  $(PLAT)
+ 
+ $(PLATS) clean:
+-      cd src && $(MAKE) $@
++      cd src && $(MAKE) $@ V=$(V) R=$(R)
+ 
+ test: dummy
+       src/lua test/hello.lua
diff --git a/build-aux/flatpak/org.gtk.Demo4.json b/build-aux/flatpak/org.gtk.Demo4.json
index 7c6ce1a7de..4adaff9da1 100644
--- a/build-aux/flatpak/org.gtk.Demo4.json
+++ b/build-aux/flatpak/org.gtk.Demo4.json
@@ -93,6 +93,77 @@
                 }
             ]
         },
+        {
+            "name": "boost",
+            "buildsystem": "simple",
+            "build-commands": [
+                "./bootstrap.sh --prefix=/app 
--with-libraries=date_time,filesystem,iostreams,locale,regex,system,thread,python,program_options,test,serialization",
+                "./b2 --build-type=minimal link=shared -j $FLATPAK_BUILDER_N_JOBS",
+                "./b2 --build-type=minimal link=shared install"
+             ],
+             "sources": [
+                 {
+                     "type": "archive",
+                     "url": "https://dl.bintray.com/boostorg/release/1.69.0/source/boost_1_69_0.tar.bz2";,
+                     "sha256": "8f32d4617390d1c2d16f26a27ab60d97807b35440d45891fa340fc2648b04406"
+                 }
+            ]
+        },
+        {
+            "name": "lua-5.1",
+            "buildsystem": "simple",
+            "build-commands": [
+                "make -j $FLATPAK_BUILDER_N_JOBS CFLAGS=\"$CFLAGS -fPIC -DLUA_USE_LINUX\" linux",
+                "make INSTALL_TOP=$FLATPAK_DEST TO_LIB='liblua.a liblua.so.5.1.5' install",
+                "ln -sf liblua.so.5.1.5 $FLATPAK_DEST/lib/liblua.so",
+                "ln -sf liblua.so.5.1.5 $FLATPAK_DEST/lib/liblua.so.5.1",
+                "install -Dm0644 etc/lua.pc $FLATPAK_DEST/lib/pkgconfig/lua.pc",
+                "ln -sf lua.pc $FLATPAK_DEST/lib/pkgconfig/lua51.pc",
+                "ln -sf lua.pc $FLATPAK_DEST/lib/pkgconfig/lua5.1.pc",
+                "ln -sf lua.pc $FLATPAK_DEST/lib/pkgconfig/lua-5.1.pc"
+            ],
+            "sources": [
+                {
+                    "type": "archive",
+                    "url": "https://www.lua.org/ftp/lua-5.1.5.tar.gz";,
+                    "sha256": "2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333"
+                },
+                {
+                    "type": "patch",
+                    "path": "lua-5.1.5-so.patch"
+                },
+                {
+                    "type": "shell",
+                    "commands": [
+                        "sed -i \"s|/usr/local|$FLATPAK_DEST|\" etc/lua.pc src/luaconf.h"
+                    ]
+                }
+            ],
+            "cleanup": [
+                "*.a",
+                "/bin",
+                "/include",
+                "/lib/pkgconfig",
+                "/man"
+            ]
+        },
+        {
+            "name" : "highlight",
+            "buildsystem" : "simple",
+            "builddir" : true,
+            "build-commands" : [
+                "sed -i -e 's#^PREFIX = /usr#PREFIX = /app#' makefile",
+                "make",
+                "make install"
+            ],
+            "sources" : [
+                {
+                    "type" : "archive",
+                    "url" : "http://www.andre-simon.de/zip/highlight-4.0.tar.bz2";,
+                    "sha256" : "f40dcba26e011a2c67df874f4d9b0238c2c6b065163ce8de3d8371b9dfce864d"
+                }
+            ]
+        },
         {
             "name" : "gtk",
             "buildsystem" : "meson",


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]