Commit c2e94391 authored by librebob's avatar librebob

Major Changes: Add packaging support

parent 7f771c3f
......@@ -5,3 +5,4 @@ libs/
/__pycache__
*.db
s.py
*.egg-info/
\ No newline at end of file
include athenaeum/icons/bug.svg
include athenaeum/icons/caret-right.svg
include athenaeum/icons/close.svg
include athenaeum/icons/cogs.svg
include athenaeum/icons/donate.svg
include athenaeum/icons/download.svg
include athenaeum/icons/globe.svg
include athenaeum/icons/help.svg
include athenaeum/icons/home.svg
include athenaeum/icons/question.svg
include athenaeum/icons/refresh.svg
include athenaeum/icons/LICENSE
include athenaeum/icons/CREDITS
include athenaeum/Athenaeum.qml
include athenaeum/LibraryView.qml
include athenaeum/SettingsView.qml
pkgname=athenaeum-git
_pkgname=athenaeum
pkgver=0.1
pkgrel=1
_pkgrel=1
pkgdesc="A libre replacement for Steam"
arch=(any)
url="https://gitlab.com/librebob/athenaeum"
license=('GPL-3.0-or-later')
depends=('flatpak' 'python3' 'pyqt5-common' 'python-pyqt5' 'python-sip-pyqt5' 'python-peewee' 'python-xdg' 'python-dateutil' 'qt5-base' 'qt5-svg' 'qt5-quickcontrols2' 'qt5-declarative' 'sqlite')
makedepends=('git')
source=("git+https://gitlab.com/librebob/athenaeum.git")
md5sums=('SKIP')
_gitname=athenaeum
package() {
cd $srcdir/$_pkgname
for i in 32 64; do
install -Dm644 $_pkgname/resources/icons/hicolor/${i}x${i}/athenaeum.png \
"$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/$_pkgname.png"
done
install -Dm644 $_pkgname/resources/$_pkgname.desktop \
"$pkgdir/usr/share/applications/$_pkgname.desktop"
python setup.py install --root="$pkgdir" --optimize=1 --prefix=/usr
}
......@@ -2,6 +2,8 @@
A libre replacement for Steam
*In the modern period, the term "Athenaeum" is widely used in various countries for schools, libraries, museums, cultural centers, performance halls and theaters, periodicals, clubs and societies - all aspiring to fulfill a cultural function similar to that of the ancient Roman school.*
![Viewing 0 A.D. in Athenaeum.](https://matrix.org/_matrix/media/v1/download/matrix.org/AuGUNUQuBPRbnNDCTwCoovAQ)
## What Works
......@@ -13,7 +15,13 @@ A libre replacement for Steam
## Getting Started
clone this repo.
### Arch Users
Download just the `PKGBUILD` and use that.
### Other Distros
Clone this repo.
### Prerequisites
......@@ -28,6 +36,7 @@ python3-pyqt5
python3-pyqt5.qtquick
python3-peewee
python3-dateutil
python3-xdg
qml-module-qtquick2
qml-module-qtquick-layouts
qml-module-qtquick-controls2
......@@ -44,6 +53,7 @@ python-pyqt5
python-sip-pyqt5
python-peewee
python-dateutil
python-xdg
qt5-base
qt5-svg
qt5-quickcontrols2
......@@ -52,7 +62,13 @@ qt5-declarative
### Installing Athenaeum
not supported atm
#### Arch
Use the `PKGBUILD` to build it then use pacman to install it.
#### Other
Not currently supported, though you can probably do it with the `setup.py`
### Running Athenaeum
......
"""
GPL-3.0-or-later
"""
......@@ -5,6 +5,13 @@ from PyQt5.QtCore import QTranslator, QLocale
from PyQt5.QtQml import QQmlApplicationEngine, qmlRegisterType
from PyQt5.QtWidgets import QApplication
# Helpful snippet from kawaii-player https://github.com/kanishka-linux/kawaii-player/
if getattr(sys, 'frozen', False):
BASEDIR, BASEFILE = os.path.split(os.path.abspath(sys.executable))
else:
BASEDIR, BASEFILE = os.path.split(os.path.abspath(__file__))
sys.path.insert(0, BASEDIR)
from game import Game
from library import Library
from loader import Loader
......@@ -16,14 +23,18 @@ def main():
signal.signal(signal.SIGINT, signal.SIG_DFL)
print('Press Ctrl+C to quit.')
icon = 'athena_icon_32x32.png'
db.connect()
db.create_tables([GameRecord, MetaRecord, SettingsRecord], safe=True)
app = QApplication(sys.argv)
searchPaths = QIcon.fallbackSearchPaths()
searchPaths.append(BASEDIR + "/resources/icons/hicolor/32x32")
searchPaths.append(BASEDIR + "/resource/icons/hicolor/64x64")
QIcon.setFallbackSearchPaths(searchPaths)
app.setApplicationDisplayName('Athenaeum')
app.setWindowIcon(QIcon(icon))
app.setWindowIcon(QIcon.fromTheme('athenaeum'))
app.setQuitOnLastWindowClosed(False)
tr = QTranslator()
......@@ -46,7 +57,7 @@ def main():
engine.rootContext().setContextProperty('loader', loader)
engine.rootContext().setContextProperty('library', library)
engine.load('main.qml')
engine.load(BASEDIR + '/Athenaeum.qml')
root = engine.rootObjects()[0]
......@@ -62,7 +73,7 @@ def main():
root.filter.connect(library.filterGames)
root.sort.connect(library.sortGames)
systemTrayIcon = SystemTrayIcon(icon=QIcon(icon), root=root, parent=app)
systemTrayIcon = SystemTrayIcon(icon=QIcon.fromTheme('athenaeum'), root=root, parent=app)
systemTrayIcon.playGame.connect(library.playGame)
library.recentChanged.connect(systemTrayIcon.prepareMenu)
......
from peewee import *
from xdg import BaseDirectory
import datetime
db = SqliteDatabase('store.db')
try:
path = BaseDirectory.save_data_path('athenaeum')
db = SqliteDatabase(path + '/store.db')
except Error as e:
sys.exit("Error setting up database.")
class BaseModel(Model):
class Meta:
......
#!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Name=Athenaeum
Icon=athenaeum
Exec=athenaeum
Terminal=false
Categories=Game;PackageManager;
import os
from functools import partial
from PyQt5.QtGui import QIcon
......@@ -35,5 +36,5 @@ class SystemTrayIcon(QSystemTrayIcon):
playGameAction.triggered.connect(partial(self.playGame.emit, game.id))
self._trayIconMenu.addSeparator()
exitAction = self._trayIconMenu.addAction(QIcon('icons/close.svg'), 'Exit')
exitAction = self._trayIconMenu.addAction(QIcon(os.path.dirname(__file__) + '/icons/close.svg'), 'Exit')
exitAction.triggered.connect(self.parent().quit)
from setuptools import setup
setup(
name="athenaeum",
version='0.1',
author='librebob',
license='GPL-3.0-or-later',
url='https://gitlab.com/librebob/athenaeum',
include_package_data=True,
packages=['athenaeum', 'athenaeum.appstream'],
entry_points={
'gui_scripts': [
'athenaeum = athenaeum.athenaeum:main',
]
},
install_requires=[],
description="A libre replacement for Steam",
long_description="README.md",
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment