diff --git a/beeref.desktop b/beeref.desktop index 8e7d25b..4c829b3 100644 --- a/beeref.desktop +++ b/beeref.desktop @@ -1,11 +1,11 @@ [Desktop Entry] Name=BeeRef -Comment=BeeRef 0.3.3-dev +GenericName=Image Viewer +Comment=A simple reference image viewer Terminal=false Exec=/home/yourname/path/to/BeeRef-0.3.3-dev-linux Type=Application Icon=/home/yourname/path/to/logo.png -Name[en_US]=BeeRef MimeType=application/x-beeref; Categories=Qt;KDE;Graphics; diff --git a/beeref/assets/logo.png b/beeref/assets/logo.png index b9965fc..0d54984 100644 Binary files a/beeref/assets/logo.png and b/beeref/assets/logo.png differ diff --git a/beeref/assets/logo.svg b/beeref/assets/logo.svg index bb6e576..cd17da5 100644 --- a/beeref/assets/logo.svg +++ b/beeref/assets/logo.svg @@ -13,11 +13,11 @@ viewBox="0 0 50.536563 50.536564" version="1.1" id="svg8" - inkscape:version="0.92.4 (5da689c313, 2019-01-14)" + inkscape:version="1.0.2 (e86c870879, 2021-01-15)" sodipodi:docname="logo.svg" inkscape:export-filename="/home/rbreu/code/python/beeref/git/beeref/assets/logo.png" - inkscape:export-xdpi="201.03999" - inkscape:export-ydpi="201.03999"> + inkscape:export-xdpi="128.67" + inkscape:export-ydpi="128.67"> org.beeref.BeeRef.desktop BeeRef BeeRef - A Simple Reference Image Viewer + A simple reference image viewer CC0-1.0 GPL-3.0 https://beeref.org/ @@ -14,11 +14,13 @@ - https://github.com/rbreu/beeref/blob/main/images/screenshot.png?raw=true + + https://github.com/rbreu/beeref/blob/main/images/screenshot.png?raw=true + - + diff --git a/tests/test_main.py b/tests/test_main.py index e40f5c3..e0cfcbf 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -33,6 +33,7 @@ def test_main(args_mock, app_mock, qapp): app_mock.return_value = qapp args_mock.return_value.filename = None args_mock.return_value.loglevel = 'WARN' + args_mock.return_value.debug_raise_error = '' with patch.object(qapp, 'exec') as exec_mock: main() args_mock.assert_called_once_with(with_check=True) diff --git a/tools/build_appimage.py b/tools/build_appimage.py index 04fc765..0eb927b 100755 --- a/tools/build_appimage.py +++ b/tools/build_appimage.py @@ -10,6 +10,7 @@ import argparse +import glob import json import logging import os @@ -176,11 +177,52 @@ with open('squashfs-root/AppRun', 'w') as f: f.write('\n'.join(content)) os.chmod('squashfs-root/AppRun', 0o755) + +logger.info('Copying appdata.xml...') +for f in glob.glob('squashfs-root/usr/share/metainfo/*'): + os.remove(f) + +filename = 'org.beeref.BeeRef.appdata.xml' +shutil.copyfile(filename, f'squashfs-root/usr/share/metainfo/{filename}') + +logger.info('Writing .desktop...') +for f in glob.glob('squashfs-root/usr/share/applications/*'): + os.remove(f) +for f in glob.glob('squashfs-root/*.desktop'): + os.remove(f) + +content = f"""[Desktop Entry] +Name=BeeRef +GenericName=Image Viewer +Comment=A simple reference image viewer +Terminal=false +Exec=BeeRef-{BEEVERSION} +Type=Application +Icon=logo + +MimeType=application/x-beeref; +Categories=Qt;KDE;Graphics; +X-KDE-NativeMimeType=application/x-beeref +X-KDE-ExtraNativeMimeTypes= + +X-AppImage-Version={BEEVERSION} +""" + +filename = 'squashfs-root/usr/share/applications/org.beeref.BeeRef.desktop' +with open(filename, 'w') as f: + f.write(content) +os.symlink('usr/share/applications/org.beeref.BeeRef.desktop', + 'squashfs-root/BeeRef.desktop') + +logger.info('Copying logos...') +shutil.copyfile('./beeref/assets/logo.svg', 'squashfs-root/logo.svg') +shutil.copyfile('./beeref/assets/logo.png', 'squashfs-root/.DirIcon') + + url = ('https://github.com/AppImage/AppImageKit/releases/download/' 'continuous/appimagetool-x86_64.AppImage') download_file(url, filename='appimagetool.appimage') run_command('./appimagetool.appimage', 'squashfs-root', - f'BeeRef-{BEEVERSION}.appimage', - '--no-appstream') + f'BeeRef-{BEEVERSION}.appimage') diff --git a/tools/find_linux_libs.py b/tools/find_linux_libs.py index 8de0eac..a0690a1 100755 --- a/tools/find_linux_libs.py +++ b/tools/find_linux_libs.py @@ -101,15 +101,19 @@ if os.path.exists(args.jsonfile): data = json.loads(f.read()) known_libs = data['libs'] packages = set(data['packages']) + excludes = set(data['excludes']) else: logger.info(f'No file {args.jsonfile}; starting from scratch') known_libs = [] packages = set() + excludes = set() for lib in iter_lsofoutput(output): links = what_links_to(lib) - if len(links) == 1: + if len(links) == 0: + pass + elif len(links) == 1: lib = links[0] else: logger.warning(f'Double check: {lib} {links}') @@ -117,7 +121,7 @@ for lib in iter_lsofoutput(output): if lib in known_libs: logger.debug(f'Found known lib: {lib}') else: - logger.debug(f'Found unknown lib: {lib}') + logger.debug(f'Found new lib: {lib}') libs.append(lib) @@ -155,11 +159,11 @@ for line in response.splitlines(): line = strip_minor_versions(line) exclude_masterlist.add(line) -excludes = [] + for ex in exclude_masterlist: for lib in (libs + known_libs): if lib.endswith(ex): - excludes.append(ex) + excludes.add(ex) continue diff --git a/tools/linux_libs.json b/tools/linux_libs.json index 2169295..bf216f4 100644 --- a/tools/linux_libs.json +++ b/tools/linux_libs.json @@ -216,6 +216,8 @@ "libX11-xcb.so.1", "libX11.so.6", "libc.so.6", + "libcanberra-gtk-module.so", + "libcanberra-gtk3.so.0", "libcom_err.so.2", "libdl.so.2", "libexpat.so.1", @@ -223,7 +225,12 @@ "libfreetype.so.6", "libfribidi.so.0", "libgcc_s.so.1", + "libgdk-3.so.0", + "libgdk_pixbuf-2.0.so.0", + "libgio-2.0.so.0", "libgpg-error.so.0", + "libgvfscommon.so", + "libgvfsdbus.so", "libharfbuzz.so.0", "libm.so.6", "libpthread.so.0", diff --git a/tools/linux_libs_notes.rst b/tools/linux_libs_notes.rst new file mode 100644 index 0000000..851755f --- /dev/null +++ b/tools/linux_libs_notes.rst @@ -0,0 +1,20 @@ +Appimage : Explanations for including/excluding libraries +========================================================= + + +GTK/Gnome +--------- + +By default, in a Gnome session BeeRef pulls a couple of gtk/gdg libs. When opening a native Gnome/GTK file dialog, more gtk/gdl libs are loaded from the system, which might be incompatable. + +https://github.com/rbreu/beeref/discussions/103 + +Current workaround: Exclude the following libs:: + + "libgvfsdbus.so" + "libcanberra-gtk-module.so" + "libgvfscommon.so" + "libcanberra-gtk3.so.0" + "libgdk-3.so.0" + "libgdk_pixbuf-2.0.so.0" + "libgio-2.0.so.0"