diff --git a/build/BUILDING.md b/build/BUILDING.md new file mode 100644 index 00000000..06197fd4 --- /dev/null +++ b/build/BUILDING.md @@ -0,0 +1,7 @@ +## Building DemonEditor +This directory contains build scripts and additional files for various platforms and distributions. + +### Supported platforms + * GNU/Linux + * macOS + * MS Windows \ No newline at end of file diff --git a/build/linux/ALTLinux spec/demon-editor-2.0-development-startfix.patch b/build/linux/ALTLinux spec/demon-editor-2.0-development-startfix.patch new file mode 100644 index 00000000..19695ea9 --- /dev/null +++ b/build/linux/ALTLinux spec/demon-editor-2.0-development-startfix.patch @@ -0,0 +1,49 @@ +diff -Nru demon-editor-2.0-development-orig/DemonEditor.desktop demon-editor-2.0-development/DemonEditor.desktop +--- demon-editor-2.0-development-orig/DemonEditor.desktop 2021-10-14 21:32:56.000000000 +0300 ++++ demon-editor-2.0-development/DemonEditor.desktop 2021-09-29 13:19:24.000000000 +0300 +@@ -6,8 +6,8 @@ + Comment[be]=Рэдактар спіса каналаў і спадарожнікаў для Enigma2 + Comment[de]=Programm- und Satellitenlisten-Editor für Enigma2 + Icon=demon-editor +-Exec=bash -c 'cd $(dirname %k) && ./start.py' ++Exec=demon-editor + Terminal=false + Type=Application +-Categories=Utility;Application; ++Categories=Utility; + StartupNotify=false +diff -Nru demon-editor-2.0-development-orig/start.py demon-editor-2.0-development/start.py +--- demon-editor-2.0-development-orig/start.py 2021-10-14 21:32:56.000000000 +0300 ++++ demon-editor-2.0-development/start.py 2021-09-29 13:19:24.000000000 +0300 +@@ -1,29 +1,4 @@ + #!/usr/bin/env python3 +-import os ++from app.ui.main import start_app + +- +-def update_icon(): +- need_update = False +- icon_name = "DemonEditor.desktop" +- +- with open(icon_name, "r") as f: +- lines = f.readlines() +- for i, line in enumerate(lines): +- if line.startswith("Icon="): +- icon_path = line.lstrip("Icon=") +- current_path = "{}/app/ui/icons/hicolor/96x96/apps/demon-editor.png".format(os.getcwd()) +- if icon_path != current_path: +- need_update = True +- lines[i] = "Icon={}\n".format(current_path) +- break +- +- if need_update: +- with open(icon_name, "w") as f: +- f.writelines(lines) +- +- +-if __name__ == "__main__": +- from app.ui.main import start_app +- +- update_icon() +- start_app() ++start_app() diff --git a/build/linux/ALTLinux spec/demon-editor.spec b/build/linux/ALTLinux spec/demon-editor.spec new file mode 100644 index 00000000..1259bc01 --- /dev/null +++ b/build/linux/ALTLinux spec/demon-editor.spec @@ -0,0 +1,86 @@ +Name: demon-editor +Version: 2.0 +Release: slava0 +BuildArch: noarch +Summary: Enigma2 channel and satellite list editor +Url: https://github.com/DYefremov/DemonEditor +License: MIT +Group: Other +Source: %name-%version-development.tar.gz +Patch0: %name-%version-development-startfix.patch +AutoReq: no +Requires: python3 python3-module-requests python3-module-pygobject3 python3-module-chardet libmpv1 +BuildRequires: python3-dev python3-module-mpl_toolkits + +%description +Enigma2 channel and satellites list editor for GNU/Linux. + +Experimental support of Neutrino-MP or others on the same basis (BPanther, etc). +Focused on the convenience of working in lists from the keyboard. The mouse is also fully supported (Drag and Drop etc). + +Main features of the program: + Editing bouquets, channels, satellites. + Import function. + Backup function. + Support of picons. + Importing services, downloading picons and updating satellites from the Web. + Extended support of IPTV. + Import to bouquet(Neutrino WEBTV) from m3u. + Export of bouquets with IPTV services in m3u. + Assignment of EPGs from DVB or XML for IPTV services (only Enigma2, experimental). + Playback of IPTV or other streams directly from the bouquet list. + Control panel with the ability to view EPG and manage timers (via HTTP API, experimental). + Simple FTP client (experimental). + +%prep +%setup -n %name-%version-development +%patch0 -p1 + +%install +%__install -d %buildroot%_datadir/demoneditor/app + %__install -m644 app/*py %buildroot%_datadir/demoneditor/app +%__install -d %buildroot%_datadir/demoneditor/app/eparser + %__install -m644 app/eparser/*py %buildroot%_datadir/demoneditor/app/eparser +%__install -d %buildroot%_datadir/demoneditor/app/eparser/enigma + %__install -m644 app/eparser/enigma/*py %buildroot%_datadir/demoneditor/app/eparser/enigma +%__install -d %buildroot%_datadir/demoneditor/app/eparser/neutrino + %__install -m644 app/eparser/neutrino/*py %buildroot%_datadir/demoneditor/app/eparser/neutrino +%__install -d %buildroot%_datadir/demoneditor/app/tools + %__install -m644 app/tools/*py %buildroot%_datadir/demoneditor/app/tools +%__install -d %buildroot%_datadir/demoneditor/app/ui + %__install -m644 app/ui/*py %buildroot%_datadir/demoneditor/app/ui + %__install -m644 app/ui/*glade %buildroot%_datadir/demoneditor/app/ui + %__install -m644 app/ui/*css %buildroot%_datadir/demoneditor/app/ui + %__install -m644 app/ui/*ui %buildroot%_datadir/demoneditor/app/ui + %__install -m755 start.py %buildroot%_datadir/demoneditor + +%__install -d %buildroot%_iconsdir/hicolor/96x96/apps +%__install -d %buildroot%_iconsdir/hicolor/scalable/apps + %__install -m644 app/ui/icons/hicolor/96x96/apps/%name.* %buildroot%_iconsdir/hicolor/96x96/apps + %__install -m644 app/ui/icons/hicolor/scalable/apps%name.* -d %buildroot%_iconsdir/hicolor/scalable/apps + +%__install -d %buildroot%_datadir/locale +cp -r app/ui/lang/* %buildroot%_datadir/locale + +%__install -d %buildroot%_bindir +echo "#!/bin/bash +python3 %_datadir/demoneditor/start.py $1" > %buildroot%_bindir/%name +chmod 755 %buildroot%_bindir/%name + +%__install -d %buildroot%_desktopdir +%__install -m644 DemonEditor.desktop %buildroot%_desktopdir/DemonEditor.desktop + +%find_lang %name + +%files -f %name.lang +%doc deb/DEBIAN/README.source +%_bindir/%name +%_datadir/demoneditor +%_iconsdir/*/*/*/%name.* +%_desktopdir/DemonEditor.desktop + +%changelog +* Wed Sep 29 2021 Viacheslav Dikonov 1.0.10-slava0 +- ALTLinux package + + diff --git a/build-deb.sh b/build/linux/build-deb.sh similarity index 71% rename from build-deb.sh rename to build/linux/build-deb.sh index 6defb9e0..2ea9be87 100755 --- a/build-deb.sh +++ b/build/linux/build-deb.sh @@ -5,7 +5,7 @@ DEB_PATH="$B_PATH/usr/share/demoneditor" mkdir -p $B_PATH cp -TRv deb $B_PATH -rsync --exclude=app/ui/lang --exclude=app/ui/icons -arv app $DEB_PATH +rsync --exclude=app/ui/lang --exclude=app/ui/icons --exclude=__pycache__ -arv ../../app $DEB_PATH cd dist fakeroot dpkg-deb --build DemonEditor diff --git a/deb/DEBIAN/README.source b/build/linux/deb/DEBIAN/README.source similarity index 100% rename from deb/DEBIAN/README.source rename to build/linux/deb/DEBIAN/README.source diff --git a/deb/DEBIAN/control b/build/linux/deb/DEBIAN/control similarity index 86% rename from deb/DEBIAN/control rename to build/linux/deb/DEBIAN/control index 7451d7b2..4a3ee8cc 100644 --- a/deb/DEBIAN/control +++ b/build/linux/deb/DEBIAN/control @@ -7,7 +7,8 @@ Essential: no Depends: python3 (>= 3.6), python3-requests, python3-gi, - python3-gi-cairo + python3-gi-cairo, + gir1.2-notify-0.7 Recommends: libmpv1, python3-chardet Maintainer: Dmitriy Yefremov diff --git a/deb/DEBIAN/copyright b/build/linux/deb/DEBIAN/copyright similarity index 100% rename from deb/DEBIAN/copyright rename to build/linux/deb/DEBIAN/copyright diff --git a/deb/DEBIAN/demon-editor-docs.docs b/build/linux/deb/DEBIAN/demon-editor-docs.docs similarity index 100% rename from deb/DEBIAN/demon-editor-docs.docs rename to build/linux/deb/DEBIAN/demon-editor-docs.docs diff --git a/deb/usr/bin/demon-editor b/build/linux/deb/usr/bin/demon-editor similarity index 100% rename from deb/usr/bin/demon-editor rename to build/linux/deb/usr/bin/demon-editor diff --git a/deb/usr/share/applications/DemonEditor.desktop b/build/linux/deb/usr/share/applications/DemonEditor.desktop similarity index 100% rename from deb/usr/share/applications/DemonEditor.desktop rename to build/linux/deb/usr/share/applications/DemonEditor.desktop diff --git a/deb/usr/share/demoneditor/start.py b/build/linux/deb/usr/share/demoneditor/start.py similarity index 100% rename from deb/usr/share/demoneditor/start.py rename to build/linux/deb/usr/share/demoneditor/start.py diff --git a/deb/usr/share/icons/hicolor/96x96/apps/demon-editor.png b/build/linux/deb/usr/share/icons/hicolor/96x96/apps/demon-editor.png similarity index 100% rename from deb/usr/share/icons/hicolor/96x96/apps/demon-editor.png rename to build/linux/deb/usr/share/icons/hicolor/96x96/apps/demon-editor.png diff --git a/deb/usr/share/icons/hicolor/scalable/apps/demon-editor.svg b/build/linux/deb/usr/share/icons/hicolor/scalable/apps/demon-editor.svg similarity index 100% rename from deb/usr/share/icons/hicolor/scalable/apps/demon-editor.svg rename to build/linux/deb/usr/share/icons/hicolor/scalable/apps/demon-editor.svg diff --git a/deb/usr/share/locale/be/LC_MESSAGES/demon-editor.mo b/build/linux/deb/usr/share/locale/be/LC_MESSAGES/demon-editor.mo similarity index 100% rename from deb/usr/share/locale/be/LC_MESSAGES/demon-editor.mo rename to build/linux/deb/usr/share/locale/be/LC_MESSAGES/demon-editor.mo diff --git a/deb/usr/share/locale/de/LC_MESSAGES/demon-editor.mo b/build/linux/deb/usr/share/locale/de/LC_MESSAGES/demon-editor.mo similarity index 100% rename from deb/usr/share/locale/de/LC_MESSAGES/demon-editor.mo rename to build/linux/deb/usr/share/locale/de/LC_MESSAGES/demon-editor.mo diff --git a/deb/usr/share/locale/es/LC_MESSAGES/demon-editor.mo b/build/linux/deb/usr/share/locale/es/LC_MESSAGES/demon-editor.mo similarity index 100% rename from deb/usr/share/locale/es/LC_MESSAGES/demon-editor.mo rename to build/linux/deb/usr/share/locale/es/LC_MESSAGES/demon-editor.mo diff --git a/deb/usr/share/locale/it/LC_MESSAGES/demon-editor.mo b/build/linux/deb/usr/share/locale/it/LC_MESSAGES/demon-editor.mo similarity index 100% rename from deb/usr/share/locale/it/LC_MESSAGES/demon-editor.mo rename to build/linux/deb/usr/share/locale/it/LC_MESSAGES/demon-editor.mo diff --git a/deb/usr/share/locale/nl/LC_MESSAGES/demon-editor.mo b/build/linux/deb/usr/share/locale/nl/LC_MESSAGES/demon-editor.mo similarity index 100% rename from deb/usr/share/locale/nl/LC_MESSAGES/demon-editor.mo rename to build/linux/deb/usr/share/locale/nl/LC_MESSAGES/demon-editor.mo diff --git a/deb/usr/share/locale/pl/LC_MESSAGES/demon-editor.mo b/build/linux/deb/usr/share/locale/pl/LC_MESSAGES/demon-editor.mo similarity index 100% rename from deb/usr/share/locale/pl/LC_MESSAGES/demon-editor.mo rename to build/linux/deb/usr/share/locale/pl/LC_MESSAGES/demon-editor.mo diff --git a/deb/usr/share/locale/pt/LC_MESSAGES/demon-editor.mo b/build/linux/deb/usr/share/locale/pt/LC_MESSAGES/demon-editor.mo similarity index 100% rename from deb/usr/share/locale/pt/LC_MESSAGES/demon-editor.mo rename to build/linux/deb/usr/share/locale/pt/LC_MESSAGES/demon-editor.mo diff --git a/deb/usr/share/locale/ru/LC_MESSAGES/demon-editor.mo b/build/linux/deb/usr/share/locale/ru/LC_MESSAGES/demon-editor.mo similarity index 100% rename from deb/usr/share/locale/ru/LC_MESSAGES/demon-editor.mo rename to build/linux/deb/usr/share/locale/ru/LC_MESSAGES/demon-editor.mo diff --git a/deb/usr/share/locale/tr/LC_MESSAGES/demon-editor.mo b/build/linux/deb/usr/share/locale/tr/LC_MESSAGES/demon-editor.mo similarity index 100% rename from deb/usr/share/locale/tr/LC_MESSAGES/demon-editor.mo rename to build/linux/deb/usr/share/locale/tr/LC_MESSAGES/demon-editor.mo diff --git a/deb/usr/share/locale/zh_CN/LC_MESSAGES/demon-editor.mo b/build/linux/deb/usr/share/locale/zh_CN/LC_MESSAGES/demon-editor.mo similarity index 100% rename from deb/usr/share/locale/zh_CN/LC_MESSAGES/demon-editor.mo rename to build/linux/deb/usr/share/locale/zh_CN/LC_MESSAGES/demon-editor.mo diff --git a/build/mac/DemonEditor.spec b/build/mac/DemonEditor.spec new file mode 100644 index 00000000..af4d3803 --- /dev/null +++ b/build/mac/DemonEditor.spec @@ -0,0 +1,75 @@ +import os +import datetime +import distutils.util + +EXE_NAME = 'start.py' +DIR_PATH = os.getcwd() +COMPILING_PLATFORM = distutils.util.get_platform() +PATH_EXE = [os.path.join(DIR_PATH, EXE_NAME)] +STRIP = True +BUILD_DATE = datetime.datetime.now().strftime("%y%m%d") + +block_cipher = None + +excludes = ['app.tools.mpv', + 'gi.repository.Gst', + 'gi.repository.GstBase', + 'gi.repository.GstVideo', + 'youtube_dl', + 'tkinter'] + +ui_files = [('app/ui/*.glade', 'ui'), + ('app/ui/*.css', 'ui'), + ('app/ui/*.ui', 'ui'), + ('app/ui/lang*', 'share/locale'), + ('app/ui/icons*', 'share/icons') + ] + +a = Analysis([EXE_NAME], + pathex=PATH_EXE, + binaries=None, + datas=ui_files, + hiddenimports=['fileinput', 'uuid'], + hookspath=[], + runtime_hooks=[], + excludes=excludes, + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher) + +pyz = PYZ(a.pure, + a.zipped_data, + cipher=block_cipher) + +exe = EXE(pyz, + a.scripts, + exclude_binaries=True, + name='DemonEditor', + debug=False, + strip=STRIP, + upx=True, + console=False) + +coll = COLLECT(exe, + a.binaries, + a.zipfiles, + a.datas, + strip=STRIP, + upx=True, + name='DemonEditor') + +app = BUNDLE(coll, + name='DemonEditor.app', + icon='icon.icns', + bundle_identifier=None, + info_plist={ + 'NSPrincipalClass': 'NSApplication', + 'CFBundleName': 'DemonEditor', + 'CFBundleDisplayName': 'DemonEditor', + 'CFBundleGetInfoString': "Enigma2 channel and satellite editor", + 'LSApplicationCategoryType': 'public.app-category.utilities', + 'LSMinimumSystemVersion': '10.13', + 'CFBundleShortVersionString': f"2.0.0.{BUILD_DATE} Alpha", + 'NSHumanReadableCopyright': u"Copyright © 2021, Dmitriy Yefremov", + 'NSRequiresAquaSystemAppearance': 'false' + }) diff --git a/build/mac/icon.icns b/build/mac/icon.icns new file mode 100644 index 00000000..b9d9967c Binary files /dev/null and b/build/mac/icon.icns differ diff --git a/build/mac/start.py b/build/mac/start.py new file mode 100644 index 00000000..9b37127f --- /dev/null +++ b/build/mac/start.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python3 + +if __name__ == "__main__": + from multiprocessing import set_start_method + from app.ui.main import start_app + + set_start_method("fork") # For compatibility [Python > 3.7] + start_app() diff --git a/build/win/DemonEditor.spec b/build/win/DemonEditor.spec new file mode 100644 index 00000000..b1de083e --- /dev/null +++ b/build/win/DemonEditor.spec @@ -0,0 +1,57 @@ +# -*- mode: python ; coding: utf-8 -*- + +EXE_NAME = 'start.py' +DIR_PATH = os.getcwd() +PATH_EXE = [os.path.join(DIR_PATH, EXE_NAME)] + +block_cipher = None + + +excludes = ['app.tools.mpv', + 'gi.repository.Gst', + 'gi.repository.GstBase', + 'gi.repository.GstVideo', + 'youtube_dl', + 'tkinter'] + + +ui_files = [('app\\ui\\*.glade', 'ui'), + ('app\\ui\\*.css', 'ui'), + ('app\\ui\\*.ui', 'ui'), + ('app\\ui\\lang*', 'share\\locale'), + ('app\\ui\\icons*', 'share\\icons') + ] + + +a = Analysis([EXE_NAME], + pathex=PATH_EXE, + binaries=[], + datas=ui_files, + hiddenimports=['fileinput', 'uuid', 'ctypes.wintypes'], + hookspath=[], + runtime_hooks=[], + excludes=excludes, + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False) +pyz = PYZ(a.pure, a.zipped_data, + cipher=block_cipher) +exe = EXE(pyz, + a.scripts, + [], + exclude_binaries=True, + name='DemonEditor', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + console=False, icon='icon.ico') +coll = COLLECT(exe, + a.binaries, + a.zipfiles, + a.datas, + strip=False, + upx=True, + upx_exclude=[], + name='DemonEditor') diff --git a/build/win/icon.ico b/build/win/icon.ico new file mode 100644 index 00000000..c7782257 Binary files /dev/null and b/build/win/icon.ico differ diff --git a/build/win/start.py b/build/win/start.py new file mode 100644 index 00000000..02c525f4 --- /dev/null +++ b/build/win/start.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python3 + +if __name__ == "__main__": + from multiprocessing import freeze_support + from app.ui.main import start_app + + freeze_support() + start_app()