Fixed PKGBUILD #28

Closed
sohrab wants to merge 11 commits from github/fork/DanielcoderX/main into dev
30 changed files with 272 additions and 2743 deletions

58
.gitignore vendored
View file

@ -1,4 +1,54 @@
venv
.idea
__pycache__
*.tar.*
# C++ objects and libs
*.slo
*.lo
*.o
*.a
*.la
*.lai
*.so
*.so.*
*.dll
*.dylib
# Qt-es
object_script.*.Release
object_script.*.Debug
*_plugin_import.cpp
/.qmake.cache
/.qmake.stash
*.pro.user
*.pro.user.*
*.qbs.user
*.qbs.user.*
*.moc
moc_*.cpp
moc_*.h
qrc_*.cpp
ui_*.h
*.qmlc
*.jsc
Makefile*
*build-*
*.qm
*.prl
# Qt unit tests
target_wrapper.*
# QtCreator
*.autosave
# QtCreator Qml
*.qmlproject.user
*.qmlproject.user.*
# QtCreator CMake
CMakeLists.txt.user*
# QtCreator 4.8< compilation database
compile_commands.json
# QtCreator local machine-specific files for imported projects
*creator.user*
*_qmlcache.qrc

View file

@ -1,18 +0,0 @@
#!/usr/bin/python
import os,subprocess
# Jump to Src
os.chdir("src/")
# Create Qrc file
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>")
f.write("""</qresource></RCC>""")
f.close()
# Compile Qrc & Create onefile script & Build Parch Package
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 && cp Welcome ../build/parch-welcome/usr/bin/ && cd ../build && chmod +x parch-welcome/usr/bin/* && tar -czvf parch-welcome.tar.gz parch-welcome/ && makepkg -f && cd .. && rm -rf build/pkg build/src build/*.tar.gz && rm -rf src/Welcome""",shell=True)

View file

@ -1,18 +0,0 @@
#!/usr/bin/python
import os,subprocess
# Jump to Src
os.chdir("src")
# Create Qrc file
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>")
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 && ./Welcome && rm Welcome""",shell=True)

View file

@ -4,16 +4,18 @@ Parch dorood (/do-rood/, درود, pronunciation) which is Persian word for "Gre
- Showing Parch Linux pages on social media
- Running the installer program
- Updating Parch repositories
This program is still on alpha stages and it is not completely ready to use.
This program is still on beta stages and it is semi complete and ready to use.
## Build Parch Package
for building **Parch Package** from **Welcome** project you should run:
## Build the package on Arch machines
- For building this package run:
```shell
python Build.py
cd build/
makepkg -f
```
## Debug & Run from Source
if you want to run project without installing, you should run:
### Install the package
- For installing this pacakge run:
```shell
python Debug.py
```
cd build/
sudo pacman -U ./parch-welcome*
```

3
build/.gitignore vendored Normal file
View file

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

View file

@ -1,20 +1,50 @@
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=1.0.0
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" "qt6-declarative" "base-devel")
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(){
_workdir="${srcdir}/${pkgname}/"
mkdir ${_workdir}/bin
cd ${_workdir}/bin
qmake6 ..
make -j$(nproc)
cp ./parch-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}" "${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

11
parch-welcome.pro Normal file
View file

@ -0,0 +1,11 @@
QT += core widgets gui qml quickcontrols2
CONFIG += release
TARGET = parch-welcome
TEMPLATE = app
SOURCES += src/main.cpp src/processhandler.cpp
HEADERS += src/processhandler.h
RESOURCES += src/assets/res.qrc

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

@ -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

1200
src/Res.py

File diff suppressed because it is too large Load diff

View file

@ -1 +0,0 @@
<RCC><qresource prefix="/"><file>website.svg</file><file>install.svg</file><file>book.svg</file><file>masto.svg</file><file>x-lg.svg</file><file>tele.svg</file><file>ParchLogo.svg</file><file>github.svg</file><file>discord.svg</file><file>ParchLinux.qml</file><file>cafe.svg</file><file>tw.svg</file></qresource></RCC>

View file

@ -1,128 +0,0 @@
# Import I/O
import subprocess
import sys
# Import PyQt6 Framework libraries
from PyQt6.QtCore import *
from PyQt6.QtGui import *
from PyQt6.QtQml import *
# Import Resources of Qt
import Res
# Simple Qt Quick class for loading QML files
class Quick(QQmlApplicationEngine):
# DO: Set property of object
def setProperty(self, name, value):
self.rootObjects()[0].setProperty(name, value)
# DO: Get property of object
def property(self, name):
return self.rootObjects()[0].property(name)
# DO: find a object
def findChild(self, name, **kwargs):
return self.rootObjects()[0].findChild(QObject, name)
# DO: Close the loader
def close(self):
self.rootObjects()[0].close()
def __init__(self):
super(Quick, self).__init__()
# 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")
# DO: Button 2 loading link: https://twitter.com/bssfoss
def b2_(self):
self.link("https://twitter.com/bssfoss")
# DO: Button 3 loading link: https://t.me/parchlinux
def b3_(self):
self.link("https://t.me/parchlinux")
# DO: Button 4 loading link: https://discord.gg/9RW5cRByAM
def b4_(self):
self.link("https://discord.gg/9RW5cRByAM")
# DO: Button 5 loading link: https://mas.to/@bssfoss
def b5_(self):
self.link("https://mas.to/@bssfoss")
# DO: Button 6 loading link: https://coffeete.ir/parchlinux
def b6_(self):
self.link("https://coffeete.ir/parchlinux")
# DO: Button 7 loading link: https://parchlinux.ir
def b7_(self):
self.link("https://parchlinux.ir")
# DO: Button 8 loading link: https://parchlinux.ir/parchwiki/
def b8_(self):
self.link("https://parchlinux.ir/parchwiki/")
# DO: Run Calamares Installer
def install_(self):
self.close()
subprocess.run('sudo sh /etc/calamares/launch.sh',shell=True)
# DO: Loading link in `xdg-open` function
def link(self,url):
self.close()
subprocess.run(f'xdg-open {url}',shell=True)
# DO: Init Function
def __init__(self):
super(Main, self).__init__()
# 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.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.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.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.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
# 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()

View file

@ -1,7 +1,7 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Controls.Material
import QtQuick 6.0
import QtQuick.Controls 6.0
import QtQuick.Controls.Material 6.0
import com.parch 1.0
ApplicationWindow {
width: 900
height: 500
@ -10,25 +10,35 @@ ApplicationWindow {
id: parch
color: "transparent"
function link(url) {
Qt.openUrlExternally(url);
}
ProcessHandler {
id: processHandler
onProcessFinished: {
// console.log("Process finished with exit code:", exitCode, "Exit status:", exitStatus);
parch.close()
}
}
Rectangle {
anchors.fill: parent
anchors.centerIn: parent
width: 900
height: 500
radius: 20
color: "#DD010409"
Row {
anchors.right: parent.right
anchors.top: parent.top
anchors.right: parent.right
anchors.top: parent.top
ToolButton {
icon.color: "white"
icon.source: "x-lg.svg"
onClicked: {
parch.close()
}
ToolButton {
icon.color: "white"
icon.source: "x-lg.svg"
onClicked: {
parch.close()
}
}
}
Column {
@ -60,7 +70,7 @@ ApplicationWindow {
Text {
text: "<strong><font color='#3b82f6'>Parch Linux</font></strong> is an open-source, Arch-based Linux distribution,"
color: "white"
verticalAlignment: Text.AlignCenter
verticalAlignment: Text.AlignVCenter
font.family: "Ubuntu Light"
font.pixelSize: 14
anchors.horizontalCenter: parent.horizontalCenter
@ -68,7 +78,7 @@ ApplicationWindow {
Text {
color: "white"
text: "that tried to be pretty, easy to use, light, fast and stable."
verticalAlignment: Text.AlignCenter
verticalAlignment: Text.AlignVCenter
font.family: "Ubuntu Light"
font.pixelSize: 14
anchors.horizontalCenter: parent.horizontalCenter
@ -84,41 +94,66 @@ ApplicationWindow {
icon.color: "white"
icon.source: "github.svg"
objectName: "b1"
onClicked: {
link("https://github.com/parchlinux")
}
}
ToolButton {
icon.color: "white"
icon.source: "tw.svg"
objectName: "b2"
onClicked: {
link("https://twitter.com/bssfoss")
}
}
ToolButton {
icon.color: "white"
icon.source: "tele.svg"
objectName: "b3"
onClicked: {
link("https://t.me/parchlinux")
}
}
ToolButton {
icon.color: "white"
icon.source: "discord.svg"
objectName: "b4"
onClicked: {
link("https://discord.gg/9RW5cRByAM")
}
}
ToolButton {
icon.color: "white"
icon.source: "masto.svg"
objectName: "b5"
onClicked: {
link("https://mas.to/@bssfoss")
}
}
ToolButton {
icon.color: "white"
icon.source: "cafe.svg"
objectName: "b6"
// Replace with Daramet platform due to Coffeete platform is unavailable
onClicked: {
link("https://daramet.com/parchlinux")
}
}
ToolButton {
icon.color: "white"
icon.source: "website.svg"
objectName: "b7"
onClicked: {
link("https://parchlinux.ir")
}
}
ToolButton {
icon.color: "white"
icon.source: "book.svg"
objectName: "b8"
onClicked: {
link("https://parchlinux.ir/parchwiki/")
}
}
}
Rectangle {
@ -132,10 +167,14 @@ ApplicationWindow {
height: 40
radius: 15
anchors.horizontalCenter: parent.horizontalCenter
ToolButton {
anchors.fill: parent
objectName: "install"
id: installBtn
onClicked: {
// Start the process through the ProcessHandler object
processHandler.startProcess();
}
}
Row {
@ -154,6 +193,7 @@ ApplicationWindow {
text: "Install Parch"
font.pixelSize: 14
anchors.verticalCenter: parent.verticalCenter
id: installBtnText
}
ToolButton {
width: 40
@ -161,6 +201,10 @@ ApplicationWindow {
anchors.verticalCenter: parent.verticalCenter
icon.color: "white"
icon.source: "install.svg"
onClicked: {
// Start the process through the ProcessHandler object
processHandler.startProcess();
}
}
}
}

View file

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

View file

Before

Width:  |  Height:  |  Size: 783 B

After

Width:  |  Height:  |  Size: 783 B

View file

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

Before

Width:  |  Height:  |  Size: 736 B

After

Width:  |  Height:  |  Size: 736 B

View file

Before

Width:  |  Height:  |  Size: 311 B

After

Width:  |  Height:  |  Size: 311 B

View file

Before

Width:  |  Height:  |  Size: 1,000 B

After

Width:  |  Height:  |  Size: 1,000 B

16
src/assets/res.qrc Normal file
View file

@ -0,0 +1,16 @@
<RCC>
<qresource prefix="/">
<file>discord.svg</file>
<file>x-lg.svg</file>
<file>tele.svg</file>
<file>cafe.svg</file>
<file>book.svg</file>
<file>github.svg</file>
<file>masto.svg</file>
<file>ParchLinux.qml</file>
<file>tw.svg</file>
<file>install.svg</file>
<file>ParchLogo.svg</file>
<file>website.svg</file>
</qresource>
</RCC>

View file

Before

Width:  |  Height:  |  Size: 793 B

After

Width:  |  Height:  |  Size: 793 B

View file

Before

Width:  |  Height:  |  Size: 659 B

After

Width:  |  Height:  |  Size: 659 B

View file

Before

Width:  |  Height:  |  Size: 724 B

After

Width:  |  Height:  |  Size: 724 B

View file

Before

Width:  |  Height:  |  Size: 320 B

After

Width:  |  Height:  |  Size: 320 B

30
src/main.cpp Normal file
View file

@ -0,0 +1,30 @@
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QResource>
#include <QQmlContext>
#include <QObject>
#include <QQuickItem>
#include <QQuickView>
#include <QProcess>
#include "processhandler.h" // Include the ProcessHandler class header
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
// Register the ProcessHandler class with the QML engine
qmlRegisterType<ProcessHandler>("com.parch", 1, 0, "ProcessHandler");
// Load the QML content from the resource
QResource::registerResource(":/resources.rcc");
// Load the QML file
engine.load(QUrl("qrc:/ParchLinux.qml"));
// Set App Icon
app.setWindowIcon(QIcon("icon.png"));
return app.exec();
}

14
src/processhandler.cpp Normal file
View file

@ -0,0 +1,14 @@
#include "processhandler.h"
ProcessHandler::ProcessHandler(QObject *parent) : QObject(parent)
{
connect(&m_process, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
this, &ProcessHandler::processFinished);
}
void ProcessHandler::startProcess()
{
m_process.start("sudo", QStringList() << "sh" << "/etc/calamares/launch.sh");
m_process.waitForFinished();
emit processFinished(m_process.exitCode(), m_process.exitStatus());
}

23
src/processhandler.h Normal file
View file

@ -0,0 +1,23 @@
#ifndef PROCESSHANDLER_H
#define PROCESSHANDLER_H
#include <QObject>
#include <QProcess>
class ProcessHandler : public QObject
{
Q_OBJECT
public:
explicit ProcessHandler(QObject *parent = nullptr);
public slots:
void startProcess();
signals:
void processFinished(int exitCode, QProcess::ExitStatus exitStatus);
private:
QProcess m_process;
};
#endif // PROCESSHANDLER_H