From 882237782170d5e64f0ff1861f65bf6d2522bbf3 Mon Sep 17 00:00:00 2001 From: Rebecca Wallander Date: Tue, 5 May 2020 17:47:50 +0200 Subject: [PATCH] Initial commit --- .gitignore | 3 + .gitmodules | 3 + com.github.afrantzis.Bless.metainfo.xml | 28 +++ com.github.afrantzis.Bless.yaml | 75 +++++++ ...23235d6f22e8270df41e168227647ddfdce8.patch | 30 +++ fix-20.patch | 202 ++++++++++++++++++ gtk-sharp2-2.12.12-glib-include.patch | 24 +++ shared-modules | 1 + 8 files changed, 366 insertions(+) create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 com.github.afrantzis.Bless.metainfo.xml create mode 100644 com.github.afrantzis.Bless.yaml create mode 100644 e6d923235d6f22e8270df41e168227647ddfdce8.patch create mode 100644 fix-20.patch create mode 100644 gtk-sharp2-2.12.12-glib-include.patch create mode 160000 shared-modules diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..635b157d99 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +build +.flatpak-builder +.vscode \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..1e7a990914 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "shared-modules"] + path = shared-modules + url = https://github.com/flathub/shared-modules.git diff --git a/com.github.afrantzis.Bless.metainfo.xml b/com.github.afrantzis.Bless.metainfo.xml new file mode 100644 index 0000000000..b7b7a53ade --- /dev/null +++ b/com.github.afrantzis.Bless.metainfo.xml @@ -0,0 +1,28 @@ + + + com.github.afrantzis.Bless + CC0-1.0 + Bless + Gtk# Hex Editor + +

+ Bless is a binary (hex) editor, a program that enables you to edit files as + a sequence of bytes. It is written in C# and uses the Gtk# bindings for the + GTK+ toolkit. +

+
+ https://github.com/afrantzis/bless + com.github.afrantzis.Bless.desktop + + + + GPL-2.0 + Alexandros Frantzis + + + https://community.linuxmint.com/img/screenshots/bless.png + + + sakcheen+flathub_AT_gmail.com + +
diff --git a/com.github.afrantzis.Bless.yaml b/com.github.afrantzis.Bless.yaml new file mode 100644 index 0000000000..e2cac99f68 --- /dev/null +++ b/com.github.afrantzis.Bless.yaml @@ -0,0 +1,75 @@ + +app-id: com.github.afrantzis.Bless +runtime: org.gnome.Platform +sdk: org.gnome.Sdk +runtime-version: '3.36' +sdk-extensions: + - org.freedesktop.Sdk.Extension.mono5 +rename-desktop-file: bless.desktop +command: bless +finish-args: + - --socket=x11 + - --share=ipc + - --filesystem=home +build-options: + append-path: /usr/lib/sdk/mono5/bin + append-ld-library-path: /usr/lib/sdk/mono5/lib + env: + PKG_CONFIG_PATH: /app/lib/pkgconfig:/app/share/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig:/usr/lib/sdk/mono5/lib/pkgconfig +modules: + - shared-modules/gtk2/gtk2.json + + - name: mono-runtime + buildsystem: simple + build-options: + no-debuginfo: true + strip: true + build-commands: + - /usr/lib/sdk/mono5/install.sh + + - name: libglade + rm-configure: true + cleanup: + - /bin + sources: + - type: archive + url: https://download.gnome.org/sources/libglade/2.6/libglade-2.6.4.tar.gz + sha256: c41d189b68457976069073e48d6c14c183075d8b1d8077cb6dfb8b7c5097add3 + - type: shell + commands: + - rm -f config.guess + - type: script + commands: + - autoreconf -fiv + dest-filename: autogen.sh + + - name: gtk-sharp + sources: + - type: archive + url: http://download.mono-project.com/sources/gtk-sharp212/gtk-sharp-2.12.45.tar.gz + sha256: 02680578e4535441064aac21d33315daa009d742cab8098ac8b2749d86fffb6a + - type: patch + path: gtk-sharp2-2.12.12-glib-include.patch + - type: shell + commands: + - cp -p /usr/share/automake-*/config.{sub,guess} . + - autoreconf -vfi + + - name: bless + config-opts: + - --without-scrollkeeper + post-install: + - install -t ${FLATPAK_DEST}/share/appdata/ -Dm644 com.github.afrantzis.Bless.metainfo.xml + - desktop-file-edit --set-key=Icon --set-value=${FLATPAK_ID} /app/share/applications/bless.desktop + - install -D data/bless-48x48.png ${FLATPAK_DEST}/share/icons/hicolor/48x48/apps/${FLATPAK_ID}.png + sources: + - type: archive + url: https://github.com/afrantzis/bless/archive/v0.6.2.tar.gz + sha256: 1a9a38ec8d29e4cd3991413087a11a935577419ae9d5469edafc18cba157f827 + - type: patch + path: fix-20.patch + - type: patch + path: e6d923235d6f22e8270df41e168227647ddfdce8.patch + - type: file + path: com.github.afrantzis.Bless.metainfo.xml + diff --git a/e6d923235d6f22e8270df41e168227647ddfdce8.patch b/e6d923235d6f22e8270df41e168227647ddfdce8.patch new file mode 100644 index 0000000000..a49e418009 --- /dev/null +++ b/e6d923235d6f22e8270df41e168227647ddfdce8.patch @@ -0,0 +1,30 @@ +From e6d923235d6f22e8270df41e168227647ddfdce8 Mon Sep 17 00:00:00 2001 +From: BEN ENGLISCH +Date: Mon, 29 Apr 2019 22:27:51 -0500 +Subject: [PATCH] Fix scrollkeeper check + +--- + doc/user/Makefile.am | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/doc/user/Makefile.am b/doc/user/Makefile.am +index 729b295..3477fa0 100644 +--- a/doc/user/Makefile.am ++++ b/doc/user/Makefile.am +@@ -9,11 +9,11 @@ noinst_SCRIPTS=$(OMF) + + + $(OMF): $(OMF).in +- if [ -x `which scrollkeeper-preinstall` ]; then \ +- scrollkeeper-preinstall file:$(datadir)/doc/$(PACKAGE_NAME)/user/bless-manual.xml $(OMF).in $(OMF); \ +- else \ +- cp $(OMF).in $(OMF); \ +- fi ++if WITH_SCROLLKEEPER ++ scrollkeeper-preinstall file:$(datadir)/doc/$(PACKAGE_NAME)/user/bless-manual.xml $(OMF).in $(OMF) ++else ++ cp $(OMF).in $(OMF) ++endif + + doc: + xsltproc /usr/share/xml/docbook/stylesheet/nwalsh/html/chunk.xsl bless-manual.xml diff --git a/fix-20.patch b/fix-20.patch new file mode 100644 index 0000000000..788a57866c --- /dev/null +++ b/fix-20.patch @@ -0,0 +1,202 @@ +From 84801988f908e51d9843c3e0ee8f2cd05c0a2d97 Mon Sep 17 00:00:00 2001 +From: davidcim +Date: Thu, 3 Oct 2019 12:38:25 +0200 +Subject: [PATCH] Fix building error CS0104: 'Range' is an ambiguous reference + +--- + src/buffers/ByteBuffer.cs | 2 +- + src/gui/DataBookFinder.cs | 4 ++-- + src/gui/areas/AreaGroup.cs | 20 ++++++++++---------- + src/tools/find/FindOperations.cs | 6 +++--- + src/tools/find/IFindStrategy.cs | 10 +++++----- + src/tools/find/IFinder.cs | 4 ++-- + 6 files changed, 23 insertions(+), 23 deletions(-) + +diff --git a/src/buffers/ByteBuffer.cs b/src/buffers/ByteBuffer.cs +index b9d9a24..72c1b42 100644 +--- a/src/buffers/ByteBuffer.cs ++++ b/src/buffers/ByteBuffer.cs +@@ -671,7 +671,7 @@ public byte[] RangeToByteArray(IRange range) + /// Returns as a SegmentCollection the data contained in + /// the specified range in the buffer. + /// +- public SegmentCollection RangeToSegmentCollection(Range range) ++ public SegmentCollection RangeToSegmentCollection(Util.Range range) + { + if (range.Size == 0) + return null; +diff --git a/src/gui/DataBookFinder.cs b/src/gui/DataBookFinder.cs +index 50b5034..3248d3a 100644 +--- a/src/gui/DataBookFinder.cs ++++ b/src/gui/DataBookFinder.cs +@@ -234,7 +234,7 @@ void FindAsyncCallback(IAsyncResult ar) + { + GenericFindOperation state = (GenericFindOperation)ar.AsyncState; + ThreadedAsyncOperation.OperationResult result = state.Result; +- Range match = state.Match; ++ Util.Range match = state.Match; + + DataView dv = null; + +@@ -381,7 +381,7 @@ void ReplaceAllAsyncCallback(IAsyncResult ar) + { + ReplaceAllOperation state = (ReplaceAllOperation)ar.AsyncState; + ThreadedAsyncOperation.OperationResult result = state.Result; +- Range firstMatch = state.FirstMatch; ++ Util.Range firstMatch = state.FirstMatch; + + DataView dv = null; + +diff --git a/src/gui/areas/AreaGroup.cs b/src/gui/areas/AreaGroup.cs +index 58ee147..4a27190 100644 +--- a/src/gui/areas/AreaGroup.cs ++++ b/src/gui/areas/AreaGroup.cs +@@ -198,7 +198,7 @@ enum Changes { Offset = 1, Cursor = 2, Highlights = 4} + set { drawingArea = value; } + } + +- public Range Selection { ++ public Util.Range Selection { + get { return selection; } + set { + if (selection == value) +@@ -251,7 +251,7 @@ public AreaGroup() + /// Get the range of bytes and the number of rows that + /// are displayed in the current view. + /// +- public Range GetViewRange(out int nrows) ++ public Util.Range GetViewRange(out int nrows) + { + // find out number of rows, bytes in current view + +@@ -271,9 +271,9 @@ public Range GetViewRange(out int nrows) + + // make sure we get an empty clipping Range when bleft==0 + if (bleft > 0) +- return new Range(offset, offset + bleft - 1); ++ return new Util.Range(offset, offset + bleft - 1); + else +- return new Range(); ++ return new Util.Range(); + } + + /// +@@ -381,7 +381,7 @@ private void ClearHighlights() + private void SetupBufferCache() + { + int nrows; +- Range view = GetViewRange(out nrows); ++ Util.Range view = GetViewRange(out nrows); + if (view.Size != bufferCache.Length) + bufferCache = new byte[view.Size]; + +@@ -444,7 +444,7 @@ private void RenderExtra() + } + } + /// +- /// Renders a of data using a specified ++ /// Renders a of data using a specified + /// + private void RenderHighlight(AtomicHighlight h) + { +@@ -474,12 +474,12 @@ private AtomicHighlight[] SplitAtomicPrioritized(AtomicHighlight q, Highlight r) + + if (q.Type > r.Type) { + ha = new AtomicHighlight[3]{new AtomicHighlight(r), new AtomicHighlight(q), new AtomicHighlight(r)}; +- Range.SplitAtomic(ha, r, q); ++ Util.Range.SplitAtomic(ha, r, q); + ha[1].AddContainer(r); + } + else { + ha = new AtomicHighlight[3]{new AtomicHighlight(q), new AtomicHighlight(r), new AtomicHighlight(q)}; +- Range.SplitAtomic(ha, q, r); ++ Util.Range.SplitAtomic(ha, q, r); + foreach (Highlight h in q.Containers) + ha[1].AddContainer(h); + } +@@ -533,7 +533,7 @@ private IntervalTree BreakDownHighlights(Highlight s, IList GetAtomicHighlights() + { + int nrows; +- Range clip = GetViewRange(out nrows); ++ Util.Range clip = GetViewRange(out nrows); + Highlight view = new Highlight(clip, Drawer.HighlightType.Normal); + + // get all highlights in current view +@@ -618,7 +618,7 @@ private void RenderCursor(IntervalTree atomicHighlights) + // if we don't find an overlap this means that either + // 1. the prev cursor position is not visible on the screen + // 2. the prev cursor position is at or beyond the end of the file +- IList overlaps = atomicHighlights.SearchOverlap(new Range(prevCursorOffset, prevCursorOffset)); ++ IList overlaps = atomicHighlights.SearchOverlap(new Util.Range(prevCursorOffset, prevCursorOffset)); + + AtomicHighlight h = null; + +diff --git a/src/tools/find/FindOperations.cs b/src/tools/find/FindOperations.cs +index 0351efd..e5984f9 100644 +--- a/src/tools/find/FindOperations.cs ++++ b/src/tools/find/FindOperations.cs +@@ -146,8 +146,8 @@ public class ReplaceAllOperation: GenericFindOperation + + protected override void DoOperation() + { +- Range m; +- match = new Range(); ++ Util.Range m; ++ match = new Util.Range(); + firstMatch = null; + + numReplaced = 0; +@@ -159,7 +159,7 @@ protected override void DoOperation() + + while ((m = strategy.FindNext()) != null) { + if (firstMatch == null) { +- firstMatch = new Range(m); ++ firstMatch = new Util.Range(m); + } + + match.Start = m.Start; +diff --git a/src/tools/find/IFindStrategy.cs b/src/tools/find/IFindStrategy.cs +index bdf7a87..bc2b21b 100644 +--- a/src/tools/find/IFindStrategy.cs ++++ b/src/tools/find/IFindStrategy.cs +@@ -31,13 +31,13 @@ public interface IFindStrategy + ByteBuffer Buffer { get; set; } + long Position { get; set; } + +- Range FindNext(); +- Range FindPrevious(); ++ Util.Range FindNext(); ++ Util.Range FindPrevious(); + +- Range FindNext(long limit); +- Range FindPrevious(long limit); ++ Util.Range FindNext(long limit); ++ Util.Range FindPrevious(long limit); + + bool Cancelled { get; set; } + } + +-} // end namespace +\ No newline at end of file ++} // end namespace +diff --git a/src/tools/find/IFinder.cs b/src/tools/find/IFinder.cs +index 594de22..a29a8fd 100644 +--- a/src/tools/find/IFinder.cs ++++ b/src/tools/find/IFinder.cs +@@ -30,7 +30,7 @@ namespace Bless.Tools.Find { + public interface IFinder + { + IFindStrategy Strategy { get; set; } +- Range LastFound { get; set; } ++ Util.Range LastFound { get; set; } + + + event FirstFindHandler FirstFind; +@@ -41,4 +41,4 @@ public interface IFinder + IAsyncResult ReplaceAll(byte[] ba, AsyncCallback ac); + } + +-} // end namespace +\ No newline at end of file ++} // end namespace diff --git a/gtk-sharp2-2.12.12-glib-include.patch b/gtk-sharp2-2.12.12-glib-include.patch new file mode 100644 index 0000000000..71fbede7d8 --- /dev/null +++ b/gtk-sharp2-2.12.12-glib-include.patch @@ -0,0 +1,24 @@ +--- gtk-sharp-2.12.22/glib/glue/thread.c.orig 2015-05-19 01:31:33.935397399 +0100 ++++ gtk-sharp-2.12.22/glib/glue/thread.c 2015-05-19 01:32:13.455087547 +0100 +@@ -19,21 +19,13 @@ + * Boston, MA 02111-1307, USA. + */ + +-#ifdef DISABLE_GTHREAD_CHECK + #include +-#else +-#include +-#endif + + gboolean glibsharp_g_thread_supported (void); + + gboolean + glibsharp_g_thread_supported () + { +-#ifdef DISABLE_GTHREAD_CHECK +- return TRUE; +-#else + return g_thread_supported (); +-#endif + } + diff --git a/shared-modules b/shared-modules new file mode 160000 index 0000000000..50d3284f31 --- /dev/null +++ b/shared-modules @@ -0,0 +1 @@ +Subproject commit 50d3284f31154999a6b6bc49e5940b506cdfdb2a