From 70eb435f4baf178098bb275fce6609afd226520b Mon Sep 17 00:00:00 2001 From: stsdc <6031763+stsdc@users.noreply.github.com> Date: Thu, 30 Nov 2023 23:49:45 +0100 Subject: [PATCH] Make it compile --- com.github.stsdc.monitor.json | 140 ++++++++++++++++++++++++++++++++- flatpak/patches/snowball.patch | 68 ++++++++++++++++ 2 files changed, 206 insertions(+), 2 deletions(-) create mode 100644 flatpak/patches/snowball.patch diff --git a/com.github.stsdc.monitor.json b/com.github.stsdc.monitor.json index 3a690de8..18350232 100644 --- a/com.github.stsdc.monitor.json +++ b/com.github.stsdc.monitor.json @@ -1,7 +1,7 @@ { "app-id": "com.github.stsdc.monitor", "runtime": "io.elementary.Platform", - "runtime-version": "6.1", + "runtime-version": "7.3", "sdk": "io.elementary.Sdk", "command": "com.github.stsdc.monitor", "finish-args": [ @@ -11,10 +11,15 @@ "--socket=system-bus", "--device=all", "--share=network", + "--env=XDG_DATA_DIRS=/app/share:/usr/share:/usr/share/runtime/share:/run/host/user-share:/run/host/usr/share:/run/host/share:/var/lib/flatpak/exports/share:~/.local/share/flatpak/exports/share", "--talk-name=org.freedesktop.Flatpak", "--system-talk-name=org.freedesktop.Accounts", "--system-talk-name=org.freedesktop.UDisks2", - "--filesystem=host:ro" + "--filesystem=host:ro", + "--filesystem=/var/lib/flatpak/app:ro", + "--filesystem=/var/lib/flatpak/exports/share:ro", + "--filesystem=xdg-data/flatpak/app:ro", + "--filesystem=xdg-data/flatpak/exports/share:ro" ], "modules": [ { @@ -122,6 +127,137 @@ } ] }, + { + "name": "flatpak", + "config-opts": [ + "--disable-documentation", + "--disable-seccomp", + "--disable-sandboxed-triggers", + "--disable-system-helper", + "--with-system-install-dir=/var/lib/flatpak" + ], + "cleanup": [ + "/etc/profile.d", + "/lib/systemd", + "/share/dbus-1/interfaces/org.freedesktop.*", + "/share/dbus-1/services/org.freedesktop.*", + "/share/gdm" + ], + "post-install": [ + "cp /usr/bin/update-mime-database /app/bin", + "cp /usr/bin/update-desktop-database /app/bin" + ], + "sources": [ + { + "type": "archive", + "url": "https://github.com/flatpak/flatpak/releases/download/1.14.4/flatpak-1.14.4.tar.xz", + "sha256": "8a34dbd0b67c434e7598b98ec690953d046f0db26e480aeafb46d72aec716799", + "x-checker-data": { + "type": "json", + "url": "https://api.github.com/repos/flatpak/flatpak/releases/latest", + "version-query": ".tag_name", + "url-query": "\"https://github.com/flatpak/flatpak/releases/download/\\($version)/flatpak-\\($version).tar.xz\"" + } + } + ], + "modules": [ + { + "name": "snowball", + "buildsystem": "simple", + "sources": [ + { + "type": "archive", + "url": "https://github.com/snowballstem/snowball/archive/refs/tags/v2.2.0.tar.gz", + "sha512": "02c43313de9de2518ea51cfb11f1c29145fc046c7838329bfdefd70b604009ad44b6db8175c25b0db31f03db30a6aec5857aa35775a9c204ec976df9cae62957" + }, + { + "type": "patch", + "paths": [ + "flatpak/patches/snowball.patch" + ] + } + ], + "build-commands": [ + "make libstemmer.so -j$FLATPAK_BUILDER_N_JOBS", + "install -Dm644 include/libstemmer.h /app/include/libstemmer.h", + "install -Dm644 libstemmer.so /app/lib/libstemmer.so.0.0.0", + "ln -s libstemmer.so.0.0.0 /app/lib/libstemmer.so.0", + "ln -s libstemmer.so.0 /app/lib/libstemmer.so" + ] + }, + { + "name": "libfuse", + "buildsystem": "meson", + "config-opts": [ + "-Dexamples=false", + "-Dinitscriptdir=", + "-Duseroot=false", + "-Dtests=false", + "-Dudevrulesdir=/tmp/" + ], + "sources": [ + { + "type": "archive", + "url": "https://github.com/libfuse/libfuse/releases/download/fuse-3.14.1/fuse-3.14.1.tar.xz", + "sha256": "126919d72b46b3e0eb58a9c6933a2a50c36f2ea69f61fe9e78bdba9f463ffa20", + "x-checker-data": { + "type": "anitya", + "project-id": 861, + "url-template": "https://github.com/libfuse/libfuse/releases/download/fuse-$version/fuse-$version.tar.gz", + "versions": { + "<": "4.0" + } + } + } + ] + }, + { + "name": "ostree", + "config-opts": [ + "--disable-man", + "--with-systemdsystemgeneratordir=/app/lib/systemd/system-generators", + "--without-systemdsystemunitdir", + "--with-curl" + ], + "cleanup": [ + "/etc/grub.d", + "/etc/ostree", + "/share/ostree", + "/libexec" + ], + "sources": [ + { + "type": "archive", + "url": "https://github.com/ostreedev/ostree/releases/download/v2023.7/libostree-2023.7.tar.xz", + "sha256": "19cda718705f7ac8c018c939c38b1bb8412deaaa04862da98cd9fe9243f073bf", + "x-checker-data": { + "type": "json", + "url": "https://api.github.com/repos/ostreedev/ostree/releases/latest", + "version-query": ".tag_name", + "url-query": ".assets | first | .browser_download_url" + } + } + ] + }, + { + "name": "python3-pyparsing", + "cleanup": [ + "*" + ], + "buildsystem": "simple", + "build-commands": [ + "pip3 install --prefix=/app pyparsing-2.4.7-py2.py3-none-any.whl" + ], + "sources": [ + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/8a/bb/488841f56197b13700afd5658fc279a2025a39e22449b7cf29864669b15d/pyparsing-2.4.7-py2.py3-none-any.whl", + "sha256": "ef9d7589ef3c200abe66653d3f1ab1033c3c419ae9b9bdb1240a85b024efc88b" + } + ] + } + ] + }, { "name": "libwnck", "buildsystem": "meson", diff --git a/flatpak/patches/snowball.patch b/flatpak/patches/snowball.patch new file mode 100644 index 00000000..8b30670f --- /dev/null +++ b/flatpak/patches/snowball.patch @@ -0,0 +1,68 @@ + GNUmakefile | 15 +++++++-------- + libstemmer/symbol.map | 6 ++++++ + 2 files changed, 13 insertions(+), 8 deletions(-) + +diff --git c/GNUmakefile i/GNUmakefile +index 98eb1fa..86e4855 100644 +--- c/GNUmakefile ++++ i/GNUmakefile +@@ -170,20 +170,19 @@ C_OTHER_OBJECTS = $(C_OTHER_SOURCES:.c=.o) + JAVA_CLASSES = $(JAVA_SOURCES:.java=.class) + JAVA_RUNTIME_CLASSES=$(JAVARUNTIME_SOURCES:.java=.class) + +-CFLAGS=-O2 -W -Wall -Wmissing-prototypes -Wmissing-declarations +-CPPFLAGS= ++CFLAGS+=-fPIC -W -Wall -Wmissing-prototypes -Wmissing-declarations + + INCLUDES=-Iinclude + +-all: snowball$(EXEEXT) libstemmer.a stemwords$(EXEEXT) $(C_OTHER_SOURCES) $(C_OTHER_HEADERS) $(C_OTHER_OBJECTS) ++all: snowball$(EXEEXT) libstemmer.so stemwords$(EXEEXT) $(C_OTHER_SOURCES) $(C_OTHER_HEADERS) $(C_OTHER_OBJECTS) + + algorithms.mk: libstemmer/mkalgorithms.pl libstemmer/modules.txt + libstemmer/mkalgorithms.pl algorithms.mk libstemmer/modules.txt + + clean: + rm -f $(COMPILER_OBJECTS) $(RUNTIME_OBJECTS) \ + $(LIBSTEMMER_OBJECTS) $(LIBSTEMMER_UTF8_OBJECTS) $(STEMWORDS_OBJECTS) snowball$(EXEEXT) \ +- libstemmer.a stemwords$(EXEEXT) \ ++ libstemmer.so stemwords$(EXEEXT) \ + libstemmer/modules.h \ + libstemmer/modules_utf8.h \ + $(C_LIB_SOURCES) $(C_LIB_HEADERS) $(C_LIB_OBJECTS) \ +@@ -222,19 +221,19 @@ libstemmer/modules_utf8.h libstemmer/mkinc_utf8.mak: libstemmer/mkmodules.pl lib + + libstemmer/libstemmer.o: libstemmer/modules.h $(C_LIB_HEADERS) + +-libstemmer.a: libstemmer/libstemmer.o $(RUNTIME_OBJECTS) $(C_LIB_OBJECTS) +- $(AR) -cru $@ $^ ++libstemmer.so: libstemmer/libstemmer.o $(RUNTIME_OBJECTS) $(C_LIB_OBJECTS) ++ $(CC) $(CFLAGS) -shared $(LDFLAGS) -Wl,-soname,$@,-version-script,libstemmer/symbol.map -o $@ $^ + + examples/%.o: examples/%.c + $(CC) $(CFLAGS) $(INCLUDES) $(CPPFLAGS) -c -o $@ $< + +-stemwords$(EXEEXT): $(STEMWORDS_OBJECTS) libstemmer.a ++stemwords$(EXEEXT): $(STEMWORDS_OBJECTS) libstemmer.so + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ + + tests/%.o: tests/%.c + $(CC) $(CFLAGS) $(INCLUDES) $(CPPFLAGS) -c -o $@ $< + +-stemtest$(EXEEXT): $(STEMTEST_OBJECTS) libstemmer.a ++stemtest$(EXEEXT): $(STEMTEST_OBJECTS) libstemmer.so + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ + + csharp_stemwords$(EXEEXT): $(CSHARP_STEMWORDS_SOURCES) $(CSHARP_RUNTIME_SOURCES) $(CSHARP_SOURCES) +diff --git c/libstemmer/symbol.map i/libstemmer/symbol.map +new file mode 100644 +index 0000000..7a3d423 +--- /dev/null ++++ i/libstemmer/symbol.map +@@ -0,0 +1,6 @@ ++SB_STEMMER_0 { ++ global: ++ sb_stemmer_*; ++ local: ++ *; ++};