diff --git a/packaging/linux/snap/snapcraft.yaml b/packaging/linux/snap/snapcraft.yaml deleted file mode 100644 index 8a8b86f58..000000000 --- a/packaging/linux/snap/snapcraft.yaml +++ /dev/null @@ -1,95 +0,0 @@ -name: kstars -version: 3.0.0 -summary: KStars is a desktop planetarium for amateur and professional astronomers. -description: KStars is free, open source, cross-platform Astronomy Software. It provides an accurate graphical simulation of the night sky, from any location on Earth, at any date and time. The display includes up to 100 million stars, 13,000 deep-sky objects,all 8 planets, the Sun and Moon, and thousands of comets, asteroids, supernovae, and satellites. For students and teachers, it supports adjustable simulation speeds in order to view phenomena that happen over long timescales, the KStars Astrocalculator to predict conjunctions, and many common astronomical calculations. For the amateur astronomer, it provides an observation planner, a sky calendar tool, and an FOV editor to calculate field of view of equipment and display them. Find out interesting objects in the "What's up Tonight" tool, plot altitude vs. time graphs for any object, print high-quality sky charts, and gain access to lots of information and resources to help you explore the universe! Included with KStars is Ekos astrophotography suite, a complete astrophotography solution that can control all INDI devices including numerous telescopes, CCDs, DSLRs, focusers, filters, and a lot more. Ekos supports highly accurate tracking using online and offline astrometry solver, autofocus and autoguiding capabilities, and capture of single or multiple images using the powerful built in sequence manager. -confinement: devmode -grade: devel - -apps: - kstars: - command: kf5-launch kstars - plugs: - - kde-frameworks-5-plug # content share itself - - home # give us a dir in the user home - - x11 # we run with xcb Qt platform for now - - opengl # Qt/QML uses opengl - - network # gethotnewstuff needs network IO - - network-bind # gethotnewstuff needs network IO - - unity7 # notifications - - pulseaudio # sound notifications - # Follow are needed for INDI hardware support - - serial-port - - camera - - gpio - - hardware-observe - - hidraw - - i2c - - location-control - - location-observe - - raw-usb - -slots: - session-dbus-interface: - interface: dbus - name: org.kde.kstars - bus: session - -plugs: - kde-frameworks-5-plug: - interface: content - content: kde-frameworks-5-all - default-provider: kde-frameworks-5 - target: kf5 - -parts: - kde-frameworks-5-dev: - plugin: dump - prime: [-*] - source: http://build.neon.kde.org/job/kde-frameworks-5-release_amd64.snap/lastSuccessfulBuild/artifact/kde-frameworks-5-dev_amd64.tar.xz - kde-frameworks-5-env: - plugin: dump - prime: [kf5-launch, kf5] - source: http://github.com/apachelogger/kf5-snap-env.git - runime: - plugin: stage-debs - debs: [indi-bin, libindi1, libindi-data, libusb-1.0.0, indi-full] - exclude-debs: [libgnutls30, libkrb5-dbg, nettle-dbg, libkrb5support0] - kstars: - after: [kde-frameworks-5-dev] - plugin: cmake - build-packages: - - extra-cmake-modules - - libeigen3-dev - - zlib1g-dev - - libcfitsio3-dev - - libnova-dev - - libgsl-dev - - libindi-dev - - wcslib-dev - - kdoctools-dev - - libpulse0 - filesets: - exclusion: - - "-usr/lib/*/cmake/*" - - "-usr/lib/*/libgnutls.so.*" - - "-usr/lib/*/libgssapi_krb5.so.*" - - "-usr/lib/*/libhogweed.so.*" - - "-usr/lib/*/libk5crypto.so.*" - - "-usr/lib/*/libkrb5.so.*" - - "-usr/lib/*/libkrb5support.so.*" - - "-usr/lib/*/libnettle.so.*" - - "-usr/include/*" - - "-usr/share/ECM/*" - - "-usr/share/doc/*" - - "-usr/share/man/*" - prime: - - "$exclusion" - source: git://anongit.kde.org/kstars.git - #source: /home/jasem/Projects/kstars - configflags: - - "-DKDE_INSTALL_USE_QT_SYS_PATHS=ON" - - "-DCMAKE_INSTALL_PREFIX=/usr" - - "-DCMAKE_BUILD_TYPE=Release" - - "-DENABLE_TESTING=OFF" - - "-DBUILD_TESTING=OFF" - - "-DKDE_SKIP_TEST_SETTINGS=ON" diff --git a/snap/.snapcraft/state b/snap/.snapcraft/state new file mode 100644 index 000000000..02785499a --- /dev/null +++ b/snap/.snapcraft/state @@ -0,0 +1,4 @@ +!GlobalState +assets: + build-packages: [] + build-snaps: [] diff --git a/packaging/linux/snap/setup/gui/icon.png b/snap/gui/icon.png similarity index 100% rename from packaging/linux/snap/setup/gui/icon.png rename to snap/gui/icon.png diff --git a/packaging/linux/snap/setup/gui/org.kde.kstars.desktop b/snap/gui/org.kde.kstars.desktop similarity index 98% rename from packaging/linux/snap/setup/gui/org.kde.kstars.desktop rename to snap/gui/org.kde.kstars.desktop index 484d165a8..7b24376a5 100644 --- a/packaging/linux/snap/setup/gui/org.kde.kstars.desktop +++ b/snap/gui/org.kde.kstars.desktop @@ -1,219 +1,216 @@ # KDE Config File [Desktop Entry] Type=Application Exec=kstars %U Icon=kstars X-DocPath=kstars/index.html Comment=Desktop Planetarium Comment[af]=Werkskerm Planetarium -Comment[ar]=قبّة سماويّة على سطح المكتب Comment[be]=Настольны планетарыум Comment[bg]=Планетариум за работния плот Comment[bn]=ডেস্কটপ প্ল্যানেটোরিয়াম Comment[br]=Planetarium a vurev Comment[bs]=Desktop planetarijum Comment[ca]=Planetari per a l'escriptori Comment[ca@valencia]=Planetari per a l'escriptori Comment[cs]=Planetárium na vaší obrazovce Comment[csb]=Planetarium na pùlce Comment[cy]=Planetariwm Penbwrdd Comment[da]=Planetarium på desktoppen Comment[de]=Das Planetarium für den Schreibtisch Comment[el]=Πλανητάριο επιφάνειας εργασίας Comment[en_GB]=Desktop Planetarium Comment[eo]=Tabula planetario Comment[es]=Planetario para el escritorio Comment[et]=Töölaua planetaarium Comment[eu]=Mahaigaineko planetarioa Comment[fa]=رومیزی آسمان‌نما Comment[fi]=Työpöytäplanetaario Comment[fr]=Un planétarium sur votre bureau Comment[ga]=Pláinéadlann Deisce Comment[gl]=Planetario de escritorio Comment[gu]=ડેસ્કટોપ પર પ્લેનેટેરીયમ Comment[he]=פלנטריום שולחני Comment[hi]=डेस्कटॉप प्लेनेटेरियम Comment[hne]=डेस्कटाप प्लेनेटेरियम Comment[hr]=Planetarij za radnu površinu Comment[hu]=Munkaasztali planetárium Comment[is]=Skjáborðsstjörnuver Comment[it]=Planetario per il desktop Comment[ja]=デスクトップ・プラネタリウム Comment[ka]=სამაგიდო პლანეტარიუმი Comment[kk]=Үстелдегі планетарий Comment[km]=សំណាក​ចក្រវាល​ផ្ទៃ​តុ Comment[ko]=데스크톱 별자리판 Comment[lt]=Darbalaukio planetariumas Comment[lv]=Darbvirsmas planetārijs Comment[mk]=Планетариум на работна површина Comment[ml]=പണിയിട പ്ലാനറ്റേറിയം Comment[mr]=डेस्कटॉप तारांगण Comment[ms]=Planetarium Ruang Kerja Comment[nb]=Skrivebordsplanetarium Comment[nds]=Planetarium för den Schriefdisch Comment[ne]=डेस्कटप ग्रहमण्डल Comment[nl]=Bureaublad-planetarium Comment[nn]=Skrivebordsplanetarium Comment[pa]=ਡੈਸਕਟਾਪ ਪਲੇਟੇਰੀਅਮ Comment[pl]=Planetarium na pulpicie Comment[pt]=Planetário Comment[pt_BR]=Planetário no ambiente de trabalho Comment[ro]=Planetarium de birou Comment[ru]=Настольный планетарий Comment[se]=Čállenbeavdeplánetaria Comment[sk]=Planetárium na vašej ploche Comment[sl]=Namizni planetarij Comment[sv]=Skrivbordsplanetarium Comment[ta]= பணிமேடை கோளரங்கம் Comment[tg]=Планетариуми Мизи Корӣ Comment[tr]=Masaüstü Yıldız Evi Comment[ug]=ئۈستەلئۈستى رەسەتخانىسى Comment[uk]=Настільний планетарій Comment[vi]=Ngắm sao trên Màn hình máy tính Comment[xh]=Indlu ye Desktop Comment[x-test]=xxDesktop Planetariumxx Comment[zh_CN]=桌面天文馆 Comment[zh_TW]=桌面星象儀 Terminal=false Name=KStars Name[af]=K-sterre -Name[ar]=نجوم‌ك Name[be]=KStars Name[bg]=KStars Name[bn]=কে-স্টার Name[br]=KStars Name[bs]=KStars Name[ca]=KStars Name[ca@valencia]=KStars Name[cs]=KStars Name[csb]=KStars Name[cy]=KSer Name[da]=KStars Name[de]=KStars Name[el]=KStars Name[en_GB]=KStars Name[eo]=KStars Name[es]=KStars Name[et]=KStars Name[eu]=KStars Name[fi]=KStars Name[fr]=KStars Name[ga]=KStars Name[gl]=KStars Name[gu]=KStars Name[he]=KStars Name[hi]=के-स्टार्स Name[hne]=के-स्टार्स Name[hr]=KStars Name[hu]=KStars Name[is]=KStjörnur Name[it]=KStars Name[ja]=KStars Name[ka]=KStars Name[kk]=KStars Name[km]=KStars Name[ko]=KStars Name[lt]=KStars Name[lv]=KStars Name[mk]=KStars Name[ml]=കെ-സ്റ്റാര്‍സ് Name[mr]=के-स्टार्स Name[ms]=KStars Name[nb]=KStars Name[nds]=KStars Name[ne]=केडीई तारा Name[nl]=KStars Name[nn]=KStars Name[pa]=ਕੇ-ਤਾਰੇ Name[pl]=KStars Name[pt]=KStars Name[pt_BR]=KStars Name[ro]=KStars Name[ru]=KStars Name[se]=KStars Name[sk]=KStars Name[sl]=KStars Name[sv]=Kstars Name[ta]=கேஸ்டார்ஸ் Name[tg]=KStars Name[tr]=KStars Name[ug]=KStars Name[uk]=KStars Name[vi]=Sao K Name[xh]=KStars Name[x-test]=xxKStarsxx Name[zh_CN]=KStars Name[zh_TW]=天文_KStars GenericName=Desktop Planetarium GenericName[af]=Werkskerm Planetarium -GenericName[ar]=قبّة سماويّة على سطح المكتب GenericName[be]=Настольны планетарыум GenericName[bg]=Планетариум за работния плот GenericName[bn]=ডেস্কটপ প্ল্যানেটোরিয়াম GenericName[br]=Planetarium a vurev GenericName[bs]=Desktop planetarijum GenericName[ca]=Planetari per a l'escriptori GenericName[ca@valencia]=Planetari per a l'escriptori GenericName[cs]=Planetárium na vaší obrazovce GenericName[csb]=Planetarium na pùlce GenericName[cy]=Planetariwm Penbwrdd GenericName[da]=Planetarium på desktoppen GenericName[de]=Elektronisches Planetarium GenericName[el]=Πλανητάριο επιφάνειας εργασίας GenericName[en_GB]=Desktop Planetarium GenericName[eo]=Tabula planetario GenericName[es]=Planetario para el escritorio GenericName[et]=Töölaua planetaarium GenericName[eu]=Mahaigaineko planetarioa GenericName[fa]=رومیزی آسمان‌نما GenericName[fi]=Työpöytäplanetaario GenericName[fr]=Un planétarium sur votre bureau GenericName[ga]=Pláinéadlann Deisce GenericName[gl]=Planetario GenericName[gu]=ડેસ્કટોપ પર પ્લેનેટેરીયમ GenericName[he]=פלנטריום שולחני GenericName[hi]=डेस्कटॉप प्लेनेटेरियम GenericName[hne]=डेस्कटाप प्लेनेटेरियम GenericName[hr]=Planetarij za radnu površinu GenericName[hu]=Planetárium GenericName[is]=Skjáborðsstjörnuver GenericName[it]=Planetario per il desktop GenericName[ja]=デスクトップ・プラネタリウム GenericName[ka]=სამაგიდო პლანეტარიუმი GenericName[kk]=Үстел планетарийі GenericName[km]=សំណាក​ចក្រវាល​ផ្ទៃ​តុ GenericName[ko]=데스크톱 별자리판 GenericName[lt]=Darbalaukio planetariumas GenericName[lv]=Darbvirsmas planetārijs GenericName[mk]=Планетариум на раб. површина GenericName[ml]=പണിയിട പ്ലാനറ്റേറിയം GenericName[mr]=डेस्कटॉप तारांगण GenericName[ms]=Planetarium Desktop GenericName[nb]=Skrivebordsplanetarium GenericName[nds]=Schriefdisch-Planetarium GenericName[ne]=डेस्कटप ग्रहमण्डल GenericName[nl]=Bureaublad-planetarium GenericName[nn]=Skrivebordsplanetarium GenericName[pa]=ਡੈਸਕਟਾਪ ਪਲੇਟੇਰੀਅਮ GenericName[pl]=Planetarium na biurku GenericName[pt]=Planetário GenericName[pt_BR]=Planetário no ambiente de trabalho GenericName[ro]=Planetariu de birou GenericName[ru]=Настольный планетарий GenericName[sk]=Planetárium GenericName[sl]=Namizni planetarij GenericName[sv]=Skrivbordsplanetarium GenericName[ta]=பணிமேடை கோளரங்கம் GenericName[tg]=Планетариуми Мизи Корӣ GenericName[tr]=Masaüstü Yıldız Evi GenericName[ug]=ئۈستەلئۈستى رەسەتخانىسى GenericName[uk]=Настільний планетарій GenericName[vi]=Ngắm sao trên Màn hình GenericName[x-test]=xxDesktop Planetariumxx GenericName[zh_CN]=桌面天文馆 GenericName[zh_TW]=桌面星象儀 X-DBUS-StartupType=Multi MimeType=image/fits; Patterns=*.fits;*.fit; Categories=Qt;KDE;Education;Science;Astronomy; X-DBUS-ServiceName=org.kde.kstars diff --git a/snap/plugins/x-stage-debs.py b/snap/plugins/x-stage-debs.py new file mode 100644 index 000000000..0d85ba27b --- /dev/null +++ b/snap/plugins/x-stage-debs.py @@ -0,0 +1,105 @@ +# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- +# +# Copyright (C) 2017 Harald Sitter +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 3 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +"""woosh woosh + + Simple magic. debs property is an array of debs that get pulled via apt + and unpacked into the installdir for staging. Key difference to builtin + stage-packages is that this entirely disregards dependencies, so they + need to be resolved another way. +""" + +import logging +import glob +import os +import re +import shutil +import subprocess + +import snapcraft.plugins.make + +logger = logging.getLogger(__name__) + +class StabeDebsPlugin(snapcraft.BasePlugin): + + @classmethod + def schema(cls): + schema = super().schema() + schema['properties']['debs'] = { + 'type': 'array', + 'minitems': 0, + 'uniqueItems': True, + 'items': { + 'type': 'string', + } + } + + schema['properties']['exclude-debs'] = { + 'type': 'array', + 'minitems': 0, + 'uniqueItems': True, + 'items': { + 'type': 'string', + } + } + + return schema + + @classmethod + def get_build_properties(cls): + # Inform Snapcraft of the properties associated with building. If these + # change in the YAML Snapcraft will consider the build step dirty. + return ['debs', 'exclude-debs'] + + def __init__(self, name, options, project): + super().__init__(name, options, project) + + def exclude(self, file): + basename = os.path.basename(file) + name = re.split('^(.+)_([^_]+)_([^_]+)\.deb$', basename)[1] + return name in (self.options.exclude_debs or []) + + def build(self): + super().build() + + logger.debug(os.getcwd()) + if self.options.debs: + cmd = ['apt-get', + '-y', + '-o', 'Debug::NoLocking=true', + '-o', 'Dir::Cache::Archives=' + self.builddir, + '--reinstall', + '--download-only', 'install'] + self.options.debs + subprocess.check_call(cmd, cwd=self.builddir) + + pkgs_abs_path = glob.glob(os.path.join(self.builddir, '*.deb')) + for pkg in pkgs_abs_path: + logger.debug(pkg) + if self.exclude(pkg): + continue + logger.debug('extract') + subprocess.check_call(['dpkg-deb', '--extract', pkg, self.installdir]) + + # # Non-recursive stage, not sure this ever has a use case with + # # exclusion in the picture + # for deb in self.options.debs: + # logger.debug(deb) + # subprocess.check_call(['apt', 'download', deb]) + # + # pkgs_abs_path = glob.glob(os.path.join(self.builddir, '*.deb')) + # for pkg in pkgs_abs_path: + # logger.debug(pkg) + # subprocess.check_call(['dpkg-deb', '--extract', pkg, self.installdir]) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml new file mode 100644 index 000000000..4053f4482 --- /dev/null +++ b/snap/snapcraft.yaml @@ -0,0 +1,82 @@ +--- +name: kstars +version: 3.3.6 +confinement: strict +grade: stable +base: core18 +adopt-info: kstars +apps: + kstars: + command: kf5-launch kstars + plugs: + - kde-frameworks-5-plug + - home + - x11 + - opengl + - network + - network-bind + - unity7 + - pulseaudio + - serial-port + - camera + - gpio + - hardware-observe + - hidraw + - i2c + - location-control + - location-observe + - raw-usb + - desktop + - desktop-legacy +slots: + session-dbus-interface: + interface: dbus + name: org.kde.kstars + bus: session +plugs: + kde-frameworks-5-plug: + interface: content + content: kde-frameworks-5-core18-all + default-provider: kde-frameworks-5-core18 + target: kf5 +parts: + kstars: + parse-info: + - usr/share/metainfo/org.kde.kstars.appdata.xml + build-snaps: + - kde-frameworks-5-core18-sdk + after: + - kde-frameworks-5-env + plugin: cmake + build-packages: + - qt5-default + - libeigen3-dev + - zlib1g-dev + - libcfitsio-dev + - libnova-dev + - libgsl-dev + - libindi-dev + - qt5keychain-dev + - wcslib-dev + stage-packages: + - astrometry.net + - indi-bin + - xplanet + - libcfitsio5 + - libnova-0.16-0 + - libgsl23 + - libindialignmentdriver1 + - libindidriver1 + - libpgsbox5 + - libwcs5 + - libqt5keychain1 + source: http://download.kde.org/stable/kstars/kstars-3.3.6.tar.xz + configflags: + - "-DCMAKE_INSTALL_PREFIX=/usr" + - "-DCMAKE_BUILD_TYPE=Release" + - "-DENABLE_TESTING=OFF" + - "-DBUILD_TESTING=OFF" + - "-DKDE_SKIP_TEST_SETTINGS=ON" + kde-frameworks-5-env: + plugin: dump + source: https://anongit.kde.org/snap-kf5-launcher.git