Update pkgbuild

This commit is contained in:
komeil Parseh 2023-08-19 12:10:54 +03:30
parent 91178ea70f
commit 2a4b0ed00a
11 changed files with 124 additions and 1422 deletions

4
.gitignore vendored
View file

@ -1,4 +1,6 @@
venv
.idea
__pycache__
*.tar.*
*.tar.*
parch-welcome-bin
.vscode

View file

@ -6,21 +6,13 @@ Parch dorood (/do-rood/, درود, pronunciation) which is Persian word for "Gre
- Updating Parch repositories
This program is still on alpha stages and it is not completely ready to use.
## Build the package
- Jump to `build` directory:
```shell
cd build
```
- Compress `parch-welcome` directory for creating package:
```shell
tar -czvf parch-welcome.tar.gz parch-welcome/
```
- Make package after compressing:
## Build the package on Arch machines
```shell
makepkg -f
```
## Install the package
### Install the package
- For installing this pacakge run:
```shell
cd build

3
build/.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
*
!.gitignore
!PKGBUILD

View file

@ -1,20 +1,53 @@
pkgname=parch-welcome
destname="/"
pkgver=1
pkgrel=0
pkgdesc='Parch dorood (/do-rood/, درود, pronunciation) which is Persian word for "Greetings", is a welcome app in the Parch distribution.'
arch=('x86_64')
url="https://parchlinux.ir"
pkgver=r44.91178ea
pkgrel=1
pkgdesc='Parch dorood (/do-rood/, درود, pronunciation) which is Persian word for "Greetings", is a welcome app in the Parch distribution.'
url="https://github.com/parchlinux/${pkgname}"
license=('GPL')
makedepends=()
depends=("python-pyqt6")
optdepends=()
conflicts=()
makedepends=("git")
depends=("qt6-base" "python" "python-pyqt6")
conflicts=("${pkgname}")
provides=("${pkgname}")
options=(!strip !emptydirs)
source=("${pkgname}.tar.gz")
sha256sums=('SKIP')
package() {
install -dm755 ${pkgdir}${destname}
cp -r ${srcdir}/${pkgname}${destname}/* ${pkgdir}${destname}
source=("${pkgname}::git+${url}")
#source=("${pkgname}.tar.gz")
md5sums=('SKIP')
build(){
_src="${srcdir}/${pkgname}/src"
_ui="${_src}/UI"
rcc -g python "${_ui}/res.qrc" -o "${_src}/Res.py"
sed -i 's/PySide2/PyQt6/g' "${_src}/Res.py"
_welcome="${_src}/../${pkgname}-bin"
echo "#!/usr/bin/python" > $_welcome && cat "${_src}/Res.py" >> $_welcome && cat "${_src}/Welcome.py" >> $_welcome
sed -i 's/import Res//g' $_welcome
}
pkgver() {
cd "${srcdir}/${pkgname}"
( set -o pipefail
git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
)
}
package() {
# copy license
install -d "${pkgdir}/usr/share/licenses/${pkgname}"
install -m644 "${srcdir}/${pkgname}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
#copy logo
install -Dm644 "${srcdir}/${pkgname}/resources/logo.png" "${pkgdir}/usr/share/icons/${pkgname}.png"
# copy welcome binfile into /bin
install -Dm755 "${srcdir}/${pkgname}/${pkgname}-bin" "${pkgdir}/usr/bin/${pkgname}"
# copy autostart desktop file into autostart dir
install -Dm644 "${srcdir}/${pkgname}/resources/autostart.desktop" "${pkgdir}/etc/xdg/autostart/${pkgname}.desktop"
# copy appliction desktop file into autostart dir
install -Dm644 "${srcdir}/${pkgname}/resources/application.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
}

File diff suppressed because it is too large Load diff

View file

@ -2,7 +2,7 @@
[Desktop Entry]
Name=Welcome
Name[ir]=درود
Exec=/usr/bin/Welcome
Exec=/usr/bin/welcome
Terminal=false
Type=Application
Icon=/usr/share/icons/ParchLogo.png
Icon=/usr/share/icons/parch-welcome.png

View file

@ -2,7 +2,7 @@
[Desktop Entry]
Name=Welcome
Name[ir]=درود
Exec=/usr/bin/Welcome
Exec=/usr/bin/parch-welcome
Terminal=false
Type=Application
Icon=/usr/share/icons/ParchLogo.png
Icon=/usr/share/icons/parch-welcome.png

View file

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

View file

@ -1,12 +1,12 @@
#!/usr/bin/python
#!/usr/bin/python
import os,subprocess
import os, subprocess
# Create Qrc file
listrc = os.listdir('UI')
listrc.remove('res.qrc')
f = open('UI/res.qrc', 'w')
listrc = os.listdir("UI")
listrc.remove("res.qrc")
f = open("UI/res.qrc", "w")
f.write("""<RCC><qresource prefix="/">""")
for i in listrc:
f.write(f"<file>{i}</file>")
@ -14,4 +14,7 @@ f.write("""</qresource></RCC>""")
f.close()
# Compile Qrc & Create onefile script & run it
subprocess.run("""rcc -g python UI/res.qrc -o Res.py && sed -i 's/PySide2/PyQt6/g' Res.py && echo "#!/usr/bin/python" > Welcome && cat Res.py >> Welcome && cat Welcome.py >> Welcome && chmod +x Welcome && sed -i 's/import Res//g' Welcome && mv Welcome ../build/parch-welcome/usr/bin""",shell=True)
subprocess.run(
"""rcc -g python UI/res.qrc -o Res.py && sed -i 's/PySide2/PyQt6/g' Res.py && echo "#!/usr/bin/python" > Welcome && cat Res.py >> Welcome && cat Welcome.py >> Welcome && chmod +x Welcome && sed -i 's/import Res//g' Welcome && mv Welcome ../build/parch-welcome/usr/bin""",
shell=True,
)

View file

@ -1171,37 +1171,44 @@ qt_resource_name = b"\
qt_resource_struct = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x0c\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x01\x8a\x0c\xde\x84\x00\
\x00\x00\x00d\x00\x00\x00\x00\x00\x01\x00\x00\x0a\x0e\
\x00\x00\x01\x89\xf9\xef\xe6\x98\
\x00\x00\x01\x8a\x0c\xde\x84\x00\
\x00\x00\x00\x1c\x00\x00\x00\x00\x00\x01\x00\x00\x05\x12\
\x00\x00\x01\x89\xf9\xef\xe6\x98\
\x00\x00\x01\x8a\x0c\xde\x84\x00\
\x00\x00\x00\xcc\x00\x01\x00\x00\x00\x01\x00\x006\x80\
\x00\x00\x01\x89\xfa\x0e\xe5\xf4\
\x00\x00\x01\x8a\x0c\xde\x84\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x01\x89\xf9\xef\xe6\x98\
\x00\x00\x01\x8a\x0c\xde\x84\x00\
\x00\x00\x00\x80\x00\x00\x00\x00\x00\x01\x00\x00\x0c\xe6\
\x00\x00\x01\x89\xf9\xef\xe6\x98\
\x00\x00\x01\x8a\x0c\xde\x84\x00\
\x00\x00\x01 \x00\x00\x00\x00\x00\x01\x00\x00A1\
\x00\x00\x01\x89\xf9\xef\xe6\x98\
\x00\x00\x01\x8a\x0c\xde\x84\x00\
\x00\x00\x002\x00\x01\x00\x00\x00\x01\x00\x00\x06V\
\x00\x00\x01\x89\xf9\xef\xe6\x98\
\x00\x00\x01\x8a\x0c\xde\x84\x00\
\x00\x00\x00H\x00\x00\x00\x00\x00\x01\x00\x00\x08\xd3\
\x00\x00\x01\x89\xf9\xef\xe6\x98\
\x00\x00\x01\x8a\x0c\xde\x84\x00\
\x00\x00\x00\x96\x00\x00\x00\x00\x00\x01\x00\x00\x0f\xf9\
\x00\x00\x01\x89\xf9\xef\xe6\x98\
\x00\x00\x01\x8a\x0c\xde\x84\x00\
\x00\x00\x00\xee\x00\x00\x00\x00\x00\x01\x00\x00:a\
\x00\x00\x01\x89\xf9\xef\xe6\x98\
\x00\x00\x01\x8a\x0c\xde\x84\x00\
\x00\x00\x00\xb6\x00\x00\x00\x00\x00\x01\x00\x003c\
\x00\x00\x01\x89\xf9\xef\xe6\x98\
\x00\x00\x01\x8a\x0c\xde\x84\x00\
\x00\x00\x01\x06\x00\x00\x00\x00\x00\x01\x00\x00>M\
\x00\x00\x01\x89\xf9\xef\xe6\x98\
\x00\x00\x01\x8a\x0c\xde\x84\x00\
"
def qInitResources():
QtCore.qRegisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data)
QtCore.qRegisterResourceData(
0x03, qt_resource_struct, qt_resource_name, qt_resource_data
)
def qCleanupResources():
QtCore.qUnregisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data)
QtCore.qUnregisterResourceData(
0x03, qt_resource_struct, qt_resource_name, qt_resource_data
)
qInitResources()

View file

@ -12,8 +12,8 @@ import Res
# Simple Qt Quick class for loading QML files
class Quick(QQmlApplicationEngine):
class Quick(QQmlApplicationEngine):
# DO: Set property of object
def setProperty(self, name, value):
self.rootObjects()[0].setProperty(name, value)
@ -36,7 +36,6 @@ class Quick(QQmlApplicationEngine):
# Main Class of Parch Welcome Project
class Main(Quick):
# DO: Button 1 loading link: https://github.com/parchlinux
def b1_(self):
self.link("https://github.com/parchlinux")
@ -72,12 +71,12 @@ class Main(Quick):
# DO: Run Calamares Installer
def install_(self):
self.close()
subprocess.Popen('sudo sh /etc/calamares/launch.sh',shell=True)
subprocess.Popen("sudo sh /etc/calamares/launch.sh", shell=True)
# DO: Loading link in `xdg-open` function
def link(self,url):
async def link(self, url):
self.close()
subprocess.Popen(f'xdg-open {url}',shell=True)
await subprocess.Popen(f"xdg-open {url}", shell=True)
# DO: Init Function
def __init__(self):
@ -86,43 +85,42 @@ class Main(Quick):
# Load Main QML file
self.load(":/ParchLinux.qml")
self.b1 = self.findChild("b1") # Find Button 1
self.b1.clicked.connect(self.b1_) # Action: Connect Button 1 action to b1_
self.b1 = self.findChild("b1") # Find Button 1
self.b1.clicked.connect(self.b1_) # Action: Connect Button 1 action to b1_
self.b2 = self.findChild("b2") # Find Button 2
self.b2.clicked.connect(self.b2_) # Action: Connect Button 2 action to b2_
self.b2 = self.findChild("b2") # Find Button 2
self.b2.clicked.connect(self.b2_) # Action: Connect Button 2 action to b2_
self.b3 = self.findChild("b3") # Find Button 3
self.b3.clicked.connect(self.b3_) # Action: Connect Button 3 action to b3_
self.b3 = self.findChild("b3") # Find Button 3
self.b3.clicked.connect(self.b3_) # Action: Connect Button 3 action to b3_
self.b4 = self.findChild("b4") # Find Button 4
self.b4.clicked.connect(self.b4_) # Action: Connect Button 4 action to b4_
self.b4 = self.findChild("b4") # Find Button 4
self.b4.clicked.connect(self.b4_) # Action: Connect Button 4 action to b4_
self.b5 = self.findChild("b5") # Find Button 5
self.b5.clicked.connect(self.b5_) # Action: Connect Button 5 action to b5_
self.b5 = self.findChild("b5") # Find Button 5
self.b5.clicked.connect(self.b5_) # Action: Connect Button 5 action to b5_
self.b6 = self.findChild("b6") # Find Button 6
self.b6.clicked.connect(self.b6_) # Action: Connect Button 6 action to b6_
self.b6 = self.findChild("b6") # Find Button 6
self.b6.clicked.connect(self.b6_) # Action: Connect Button 6 action to b6_
self.b7 = self.findChild("b7") # Find Button 7
self.b7.clicked.connect(self.b7_) # Action: Connect Button 7 action to b7_
self.b7 = self.findChild("b7") # Find Button 7
self.b7.clicked.connect(self.b7_) # Action: Connect Button 7 action to b7_
self.b8 = self.findChild("b8") # Find Button 8
self.b8.clicked.connect(self.b8_) # Action: Connect Button 8 action to b8_
self.b8 = self.findChild("b8") # Find Button 8
self.b8.clicked.connect(self.b8_) # Action: Connect Button 8 action to b8_
self.install = self.findChild('install') # Find Install Button
self.install.clicked.connect(self.install_) # Action: Connect to install_ function
self.install = self.findChild("install") # Find Install Button
self.install.clicked.connect(
self.install_
) # Action: Connect to install_ function
# Start Qt Qui Application loop
app = QGuiApplication([])
# Set Qt Window Icon
app.setWindowIcon(QIcon(":/ParchLogo.svg"))
# Loading Main Class
m = Main()
# Set loop exec
app.exec()
if __name__ == "__main__":
# Start Qt Qui Application loop
app = QGuiApplication([])
# Set Qt Window Icon
app.setWindowIcon(QIcon(":/ParchLogo.svg"))
# Loading Main Class
m = Main()
# Set loop exec
app.exec()