diff --git a/system/installer/yali-branding-pisilinux/actions.py b/system/installer/yali-branding-pisilinux/actions.py new file mode 100644 index 0000000000..e9dbabc3d4 --- /dev/null +++ b/system/installer/yali-branding-pisilinux/actions.py @@ -0,0 +1,14 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# +# Licensed under the GNU General Public License, version 3. +# See the file http://www.gnu.org/licenses/gpl.txt + +from pisi.actionsapi import pythonmodules + +def build(): + pythonmodules.compile() + +def install(): + pythonmodules.install() + diff --git a/system/installer/yali-branding-pisilinux/pspec.xml b/system/installer/yali-branding-pisilinux/pspec.xml new file mode 100644 index 0000000000..1efea3a075 --- /dev/null +++ b/system/installer/yali-branding-pisilinux/pspec.xml @@ -0,0 +1,39 @@ + + + + + + yali-branding-pisilinux + http://www.pisilinux.org + + Pisi Linux Community + admins@pisilinux.org + + GPLv2 + data + Pisi Linux Branding files for YALI + yali-branding includes Pisi Linux branding files for YALI(Yet Another Linux Installer). + https://github.com/forYali/yali-branding-pisilinux/archive/0.4.tar.gz + + intltool + + + + + yali-branding-pisilinux + + /usr/share/doc + /usr/share/yali/branding + + + + + + 2017-03-05 + 0.4 + First release + Ertuğrul Erata + ertugrulerata@gmail.com + + + diff --git a/system/installer/yali-branding-pisilinux/translations.xml b/system/installer/yali-branding-pisilinux/translations.xml new file mode 100644 index 0000000000..ede189e35b --- /dev/null +++ b/system/installer/yali-branding-pisilinux/translations.xml @@ -0,0 +1,8 @@ + + + + yali-branding-pisilinux + Yali için Pisi Linux dosyaları + yalı-branding YALI projesi Pisi Linux dosyalarını içerir. + + diff --git a/system/installer/yali-theme-pisilinux/actions.py b/system/installer/yali-theme-pisilinux/actions.py new file mode 100644 index 0000000000..e9dbabc3d4 --- /dev/null +++ b/system/installer/yali-theme-pisilinux/actions.py @@ -0,0 +1,14 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# +# Licensed under the GNU General Public License, version 3. +# See the file http://www.gnu.org/licenses/gpl.txt + +from pisi.actionsapi import pythonmodules + +def build(): + pythonmodules.compile() + +def install(): + pythonmodules.install() + diff --git a/system/installer/yali-theme-pisilinux/pspec.xml b/system/installer/yali-theme-pisilinux/pspec.xml new file mode 100644 index 0000000000..a64e0d033d --- /dev/null +++ b/system/installer/yali-theme-pisilinux/pspec.xml @@ -0,0 +1,39 @@ + + + + + + yali-theme-pisilinux + http://www.pisilinux.org + + Pisi Linux Community + admins@pisilinux.org + + GPLv2 + data + PiSi Linux theme files for YALI + yali-branding includes PiSi Linux theme files for YALI(Yet Another Linux Installer). + https://github.com/forYali/yali-theme-pisilinux/archive/0.4.tar.gz + + qt5-base + + + + + yali-theme-pisilinux + + /usr/share/doc + /usr/share/yali/theme + + + + + + 2017-03-05 + 0.4 + First release + Ertuğrul Erata + ertugrulerata@gmail.com + + + diff --git a/system/installer/yali-theme-pisilinux/translations.xml b/system/installer/yali-theme-pisilinux/translations.xml new file mode 100644 index 0000000000..a2a4ec773d --- /dev/null +++ b/system/installer/yali-theme-pisilinux/translations.xml @@ -0,0 +1,8 @@ + + + + yali-theme-pisilinux + Yali için Pisi Linux tema dosyaları + yalı-theme YALI projesi Pisi Linux tema dosyaları içerir. + + diff --git a/system/installer/yali/actions.py b/system/installer/yali/actions.py new file mode 100644 index 0000000000..4df0ff3ea9 --- /dev/null +++ b/system/installer/yali/actions.py @@ -0,0 +1,24 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# +# Licensed under the GNU General Public License, version 3. +# See the file http://www.gnu.org/licenses/gpl.txt + +from pisi.actionsapi import pisitools +from pisi.actionsapi import pythonmodules + +def setup(): + repo_uri = "http://packages.pisilinux.org/repositories/1.0/stable/x86_64/pisi-index.xml.xz" # FIXME + pisitools.dosed("yali/constants.py", "@REPO_URI@", repo_uri) + pisitools.dosed("yali/constants.py", "@REPO_NAME@", "pisi") # FIXME + + pisitools.dosed("conf/yali.conf", "@INSTALL_TYPE@", "default") + +def build(): + pythonmodules.compile() + +def install(): + pythonmodules.install() + + pisitools.domove("/usr/share/applications/yali.desktop", "/usr/share/display-managers/") + pisitools.removeDir("usr/share/applications") \ No newline at end of file diff --git a/system/installer/yali/files/fix_find_device.patch b/system/installer/yali/files/fix_find_device.patch new file mode 100644 index 0000000000..2c1463aff6 --- /dev/null +++ b/system/installer/yali/files/fix_find_device.patch @@ -0,0 +1,10 @@ +--- yali/storage/operations.py~ 2014-08-10 11:45:14.877968618 +0200 ++++ yali/storage/operations.py 2014-08-10 11:49:31.360959247 +0200 +@@ -235,6 +235,7 @@ + + self.device.disk.format.commitToDisk() + ++ yali.baseudev.udev_settle() + info = udev_get_block_device(self.device.sysfsPath) + try: + olduuid = udev_device_get_uuid(info) diff --git a/system/installer/yali/files/no_old_filesdb.patch b/system/installer/yali/files/no_old_filesdb.patch new file mode 100644 index 0000000000..36986afb5f --- /dev/null +++ b/system/installer/yali/files/no_old_filesdb.patch @@ -0,0 +1,13 @@ +--- yali/util.py~ 2014-06-16 21:18:24.394455789 +0200 ++++ yali/util.py 2014-06-16 21:19:17.858453835 +0200 +@@ -370,10 +370,6 @@ + chroot("/bin/service dbus start") + + def stop_dbus(): +- filesdb = pisi.db.filesdb.FilesDB() +- if filesdb.is_initialized(): +- filesdb.close() +- + # stop dbus + chroot("/bin/service dbus stop") + # kill comar in chroot if any exists diff --git a/system/installer/yali/pspec.xml b/system/installer/yali/pspec.xml new file mode 100644 index 0000000000..e319ccbaf7 --- /dev/null +++ b/system/installer/yali/pspec.xml @@ -0,0 +1,90 @@ + + + + + yali + http://www.pisilinux.org/ + + PisiLinux Community + admins@pisilinux.org + + GPLv2 + app:gui + Yet Another Linux Installer + YALI is the graphical installer for PiSi Linux distribution which is written using the Qt framework. + https://github.com/forYali/yali/archive/3.0.3.tar.gz + + python-qt5 + e2fsprogs-devel + + + + fix_find_device.patch + + + + + yali + + python-qt5 + util-linux + + mdadm + lvm2 + reiserfsprogs + ntfsprogs + dosfstools + xfsprogs + xdm + comar + panda + python-pyaspects + pisilinux-python + syslinux + pyqtermwidget + + + pyparted + python-pyblock + yali-branding-pisilinux + yali-theme-pisilinux + python-udev + pisilinux-desktop-services + + glibc-locales-nl + glibc-locales-de + glibc-locales-es + glibc-locales-pt + glibc-locales-sv + glibc-locales-fr + glibc-locales-it + glibc-locales-ca + glibc-locales-pl + glibc-locales-ru + glibc-locales-hu + glibc-locales-hr + droid-fonts + + + + /usr/bin + /usr/lib + /usr/share + /etc/yali + /lib/udev/rules.d/70-yali.rules + + + + + + 2017-03-05 + 3.0.3 + First release + Ertuğrul Erata + ertugrulerata@gmail.com + + + diff --git a/system/installer/yali/translations.xml b/system/installer/yali/translations.xml new file mode 100644 index 0000000000..562614ab65 --- /dev/null +++ b/system/installer/yali/translations.xml @@ -0,0 +1,10 @@ + + + + yali + YALI: PiSi Linux kurulum yazılımı + YALI: PiSi Linux kurulum yazılımı. + YALI: Yet Another Linux Installer (encore un nouvel installateur Linux). + YALI jest graficznym instalatorem PiSi Linux. + + diff --git a/util/admin/panda/actions.py b/util/admin/panda/actions.py new file mode 100644 index 0000000000..1b9ff10da6 --- /dev/null +++ b/util/admin/panda/actions.py @@ -0,0 +1,19 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# +# Licensed under the GNU General Public License, version 3. +# See the file http://www.gnu.org/licenses/gpl.txt + +from pisi.actionsapi import pisitools +from pisi.actionsapi import pythonmodules + +def setup(): + # remove pae modules + pisitools.dosed("panda.py", "-pae-", deleteLine=True) + + pythonmodules.compile() + +def install(): + pythonmodules.install() + + pisitools.dodoc('AUTHORS', 'COPYING', 'README') diff --git a/util/admin/panda/files/add-32bit_packages.diff b/util/admin/panda/files/add-32bit_packages.diff new file mode 100644 index 0000000000..43350bd430 --- /dev/null +++ b/util/admin/panda/files/add-32bit_packages.diff @@ -0,0 +1,29 @@ +--- panda.py~ 2013-12-22 18:35:44.986644221 +0100 ++++ panda.py 2013-12-23 10:50:00.433218873 +0100 +@@ -7,6 +7,7 @@ + import pisi + import shutil + from subprocess import call ++from distutils import util + + sysdir = "/sys/bus/pci/devices/" + driversDB = "/usr/share/X11/DriversDB" +@@ -36,7 +37,7 @@ + "module-nvidia-current-userspace", + "xorg-video-nvidia-current", + "nvidia-xconfig", +- "nvidia-settings"] , ++ "nvidia-settings"], + "nvidia96": ["module-nvidia96", + "module-pae-nvidia96", + "module-nvidia96-userspace", +@@ -54,6 +55,9 @@ + "xorg-video-nvidia304", + "nvidia-xconfig", + "nvidia-settings"]} ++ if util.get_platform() == "linux-x86_64": ++ self.driver_packages["fglrx"].append("xorg-video-fglrx-32bit") ++ self.driver_packages["nvidia-current"].append("xorg-video-nvidia-current-32bit") + + def __get_primary_driver(self): + '''Get driver name for the working primary device''' diff --git a/util/admin/panda/files/add_nvidia304.patch b/util/admin/panda/files/add_nvidia304.patch new file mode 100644 index 0000000000..f6d09d5113 --- /dev/null +++ b/util/admin/panda/files/add_nvidia304.patch @@ -0,0 +1,46 @@ +--- panda.py~ 2013-09-11 23:01:06.715664263 +0200 ++++ panda.py 2013-09-11 23:39:47.000000000 +0200 +@@ -48,6 +48,11 @@ + "module-nvidia173-userspace", + "xorg-video-nvidia173", + "nvidia-xconfig", ++ "nvidia-settings"], ++ "nvidia304": ["module-nvidia304", ++ "module-nvidia304-userspace", ++ "xorg-video-nvidia304", ++ "nvidia-xconfig", + "nvidia-settings"]} + + def __get_primary_driver(self): +@@ -120,7 +125,7 @@ + if self.driver_name == "fglrx": + self.os_driver = "radeon" + return self.os_driver +- elif self.driver_name in ["nvidia-current", "nvidia96", "nvidia173"]: ++ elif self.driver_name in ["nvidia-current", "nvidia96", "nvidia173", "nvidia304"]: + self.os_driver = "nouveau" + return self.os_driver + else: +@@ -169,10 +174,10 @@ + status, modified = self.update_grub_default_entries(arg) + if status in ["os", "generic", "vendor"] and modified: + self.update_grub_cfg() +- self.set_libGL(self.driver_name if self.driver_name in ["nvidia-current", "nvidia96", "nvidia173", "fglrx"] and status == "vendor" else "mesa") +- if self.driver_name in ["nvidia-current", "nvidia96", "nvidia173"] and status == "vendor": ++ self.set_libGL(self.driver_name if self.driver_name in ["nvidia-current", "nvidia96", "nvidia173", "nvidia304", "fglrx"] and status == "vendor" else "mesa") ++ if self.driver_name in ["nvidia-current", "nvidia96", "nvidia173", "nvidia304"] and status == "vendor": + open(nvidia_blacklist_file, "w").write("blacklist nouveau\n") +- elif self.driver_name in ["nvidia-current", "nvidia96", "nvidia173"] and os.path.isfile(nvidia_blacklist_file): ++ elif self.driver_name in ["nvidia-current", "nvidia96", "nvidia173", "nvidia304"] and os.path.isfile(nvidia_blacklist_file): + os.remove(nvidia_blacklist_file) + + +@@ -221,7 +226,7 @@ + if self.driver_name is None: + self.__get_primary_driver() + +- if self.driver_name in "fglrx" or self.driver_name in ["nvidia-current", "nvidia96", "nvidia173"]: ++ if self.driver_name in "fglrx" or self.driver_name in ["nvidia-current", "nvidia96", "nvidia173", "nvidia304"]: + return ["vendor", "os", "generic"] + elif "Not defined" == self.driver_name: + return ["os", "generic"] diff --git a/util/admin/panda/files/add_nvidia340.patch b/util/admin/panda/files/add_nvidia340.patch new file mode 100644 index 0000000000..720c3fd1f4 --- /dev/null +++ b/util/admin/panda/files/add_nvidia340.patch @@ -0,0 +1,53 @@ +--- panda-0.2.orig/panda.py 2014-11-14 02:12:02.000000000 +0200 ++++ panda-0.2/panda.py 2014-11-14 02:20:47.921188120 +0200 +@@ -46,6 +46,10 @@ + "xorg-video-nvidia173", + "nvidia-xconfig", + "nvidia-settings"], ++ "nvidia340": ["module-nvidia340", ++ "xorg-video-nvidia340", ++ "nvidia-xconfig", ++ "nvidia-settings"], + "nvidia304": ["module-nvidia304", + "xorg-video-nvidia304", + "nvidia-xconfig", +@@ -53,6 +58,7 @@ + if util.get_platform() == "linux-x86_64": + self.driver_packages["fglrx"].append("xorg-video-fglrx-32bit") + self.driver_packages["nvidia-current"].append("xorg-video-nvidia-current-32bit") ++ self.driver_packages["nvidia340"].append("xorg-video-nvidia340-32bit") + + def __get_primary_driver(self): + '''Get driver name for the working primary device''' +@@ -124,7 +130,7 @@ + if self.driver_name == "fglrx": + self.os_driver = "radeon" + return self.os_driver +- elif self.driver_name in ["nvidia-current", "nvidia96", "nvidia173", "nvidia304"]: ++ elif self.driver_name in ["nvidia-current", "nvidia96", "nvidia173", "nvidia304" ,"nvidia340"]: + self.os_driver = "nouveau" + return self.os_driver + else: +@@ -173,10 +179,10 @@ + status, modified = self.update_grub_default_entries(arg) + if status in ["os", "generic", "vendor"] and modified: + self.update_grub_cfg() +- self.set_libGL(self.driver_name if self.driver_name in ["nvidia-current", "nvidia96", "nvidia173", "nvidia304", "fglrx"] and status == "vendor" else "mesa") +- if self.driver_name in ["nvidia-current", "nvidia96", "nvidia173", "nvidia304"] and status == "vendor": ++ self.set_libGL(self.driver_name if self.driver_name in ["nvidia-current", "nvidia96", "nvidia173", "nvidia304", "nvidia340", "fglrx"] and status == "vendor" else "mesa") ++ if self.driver_name in ["nvidia-current", "nvidia96", "nvidia173", "nvidia304", "nvidia340"] and status == "vendor": + open(nvidia_blacklist_file, "w").write("blacklist nouveau\n") +- elif self.driver_name in ["nvidia-current", "nvidia96", "nvidia173", "nvidia304"] and os.path.isfile(nvidia_blacklist_file): ++ elif self.driver_name in ["nvidia-current", "nvidia96", "nvidia173", "nvidia304", "nvidia340"] and os.path.isfile(nvidia_blacklist_file): + os.remove(nvidia_blacklist_file) + + return status +@@ -224,7 +230,7 @@ + if self.driver_name is None: + self.__get_primary_driver() + +- if self.driver_name in "fglrx" or self.driver_name in ["nvidia-current", "nvidia96", "nvidia173", "nvidia304"]: ++ if self.driver_name in "fglrx" or self.driver_name in ["nvidia-current", "nvidia96", "nvidia173", "nvidia304", "nvidia340"]: + return ["vendor", "os", "generic"] + elif "Not defined" == self.driver_name: + return ["os", "generic"] diff --git a/util/admin/panda/files/fix_editing_grub_default.patch b/util/admin/panda/files/fix_editing_grub_default.patch new file mode 100644 index 0000000000..29533b71d3 --- /dev/null +++ b/util/admin/panda/files/fix_editing_grub_default.patch @@ -0,0 +1,50 @@ +--- panda.py~ 2013-06-26 23:14:48.709209877 +0200 ++++ panda.py 2013-06-26 23:15:23.467208607 +0200 +@@ -269,10 +269,10 @@ + + with open(grub_default_file) as grub_default: + for line in grub_default: +- if "GRUB_CMDLINE_LINUX=" in line: ++ if "GRUB_CMDLINE_LINUX_DEFAULT=" in line: + params = {} if line.startswith("#") else dict((k, v.split(',')) + for k,v in (item.split('=') if "=" in item else (item, '') +- for item in line.replace('"', '').split("LINUX=")[1].split())) ++ for item in line.replace('"', '').replace("'", "").split("DEFAULT=")[1].split())) + old_line = " ".join(["%s%s%s" % (k, "=" if l[0] else "", ",".join([v for v in l])) for k, l in sorted(params.items())]) + if arg == "os": + try : +@@ -285,10 +285,6 @@ + if not params["xorg"] or not params["xorg"][0]: del params["xorg"] + except KeyError: + pass +- try : +- del params["vga"] +- except KeyError: +- pass + status = "os" + + elif arg == "vendor": +@@ -302,7 +298,6 @@ + if not params["xorg"] or not params["xorg"][0]: del params["xorg"] + except KeyError: + pass +- if self.driver_name in ["nvidia-current"]: params["vga"] = ["794"] + status = "vendor" + + elif arg == "generic": +@@ -430,4 +425,3 @@ + # print p.update_grub_entries("vendor") + print p.update_system_files("vendor") + print p.get_needed_driver_packages(installable=False) +- +--- panda.py~ 2013-07-12 12:33:05.029649344 +0200 ++++ panda.py 2013-07-12 12:33:09.728649172 +0200 +@@ -309,7 +309,7 @@ + + new_line = " ".join(["%s%s" % ("%s=" % k if l[0] else k, ",".join([v for v in l])) for k, l in sorted(params.items())]) + configured = old_line != new_line +- new_line = 'GRUB_CMDLINE_LINUX="%s"\n' % new_line ++ new_line = 'GRUB_CMDLINE_LINUX_DEFAULT="%s"\n' % new_line + grub_tmp.write(new_line) + else: + grub_tmp.write(line) diff --git a/util/admin/panda/files/remove_module-fglrx-userspace.patch b/util/admin/panda/files/remove_module-fglrx-userspace.patch new file mode 100644 index 0000000000..d3ca024b63 --- /dev/null +++ b/util/admin/panda/files/remove_module-fglrx-userspace.patch @@ -0,0 +1,18 @@ +--- panda.py~ 2014-04-12 20:47:04.213380223 +0200 ++++ panda.py 2014-04-12 20:51:07.980049491 +0200 +@@ -30,7 +30,6 @@ + self.os_driver = None + self.driver_packages = {"fglrx": ["module-fglrx", + "module-pae-fglrx", +- "module-fglrx-userspace", + "xorg-video-fglrx"], + "nvidia-current": ["module-nvidia-current", + "module-pae-nvidia-current", +@@ -179,7 +178,6 @@ + open(nvidia_blacklist_file, "w").write("blacklist nouveau\n") + elif self.driver_name in ["nvidia-current", "nvidia96", "nvidia173", "nvidia304"] and os.path.isfile(nvidia_blacklist_file): + os.remove(nvidia_blacklist_file) +- + + return status + diff --git a/util/admin/panda/files/remove_module-nvidia-userspace.patch b/util/admin/panda/files/remove_module-nvidia-userspace.patch new file mode 100644 index 0000000000..ace79921f9 --- /dev/null +++ b/util/admin/panda/files/remove_module-nvidia-userspace.patch @@ -0,0 +1,27 @@ +--- panda.py~ 2014-03-10 21:18:48.173319857 +0100 ++++ panda.py 2014-03-10 21:19:43.726653009 +0100 +@@ -34,24 +34,20 @@ + "xorg-video-fglrx"], + "nvidia-current": ["module-nvidia-current", + "module-pae-nvidia-current", +- "module-nvidia-current-userspace", + "xorg-video-nvidia-current", + "nvidia-xconfig", + "nvidia-settings"], + "nvidia96": ["module-nvidia96", + "module-pae-nvidia96", +- "module-nvidia96-userspace", + "xorg-video-nvidia96", + "nvidia-xconfig", + "nvidia-settings"], + "nvidia173": ["module-nvidia173", + "module-pae-nvidia173", +- "module-nvidia173-userspace", + "xorg-video-nvidia173", + "nvidia-xconfig", + "nvidia-settings"], + "nvidia304": ["module-nvidia304", +- "module-nvidia304-userspace", + "xorg-video-nvidia304", + "nvidia-xconfig", + "nvidia-settings"]} diff --git a/util/admin/panda/pspec.xml b/util/admin/panda/pspec.xml new file mode 100644 index 0000000000..bf96b1f2e1 --- /dev/null +++ b/util/admin/panda/pspec.xml @@ -0,0 +1,44 @@ + + + + + panda + http://www.pisilinux.org + + PisiLinux Community + admins@pisilinux.org + + GPLv2 + app:console + PisiLinux Alternative Driver Administration + PANDA is an alternative driver administration for PisiLinux. + https://github.com/forYali/panda/archive/0.2.tar.gz + + + add-32bit_packages.diff + remove_module-nvidia-userspace.patch + remove_module-fglrx-userspace.patch + + + + + panda + + /usr/libexec + /usr/lib + /usr/share/doc + + + + + + 2017-03-05 + 0.2 + First release + Ertuğrul Erata + ertugrulerata@gmail.com + + + diff --git a/util/admin/panda/translations.xml b/util/admin/panda/translations.xml new file mode 100644 index 0000000000..c7c3d60682 --- /dev/null +++ b/util/admin/panda/translations.xml @@ -0,0 +1,8 @@ + + + + panda + PisiLinux Alternatif Sürücü Yönetimi + Panda, PisiLinux için alternatif sürücü yönetim modülüdür. + + diff --git a/x11/util/zorg/actions.py b/x11/util/zorg/actions.py new file mode 100644 index 0000000000..9e2b479836 --- /dev/null +++ b/x11/util/zorg/actions.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# +# Licensed under the GNU General Public License, version 3. +# See the file http://www.gnu.org/licenses/gpl.txt + +from pisi.actionsapi import pisitools +from pisi.actionsapi import pythonmodules + +def install(): + pythonmodules.install("--install-lib=/usr/lib/pardus") + + pisitools.dosym("zorg-cli", "/usr/bin/zorg") + + # This is now provided by xorg-server package. + pisitools.remove("/usr/share/X11/DriversDB") diff --git a/x11/util/zorg/comar/package.py b/x11/util/zorg/comar/package.py new file mode 100644 index 0000000000..249c5261f3 --- /dev/null +++ b/x11/util/zorg/comar/package.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- + +from pisi.version import Version + +def postInstall(fromVersion, fromRelease, toVersion, toRelease): + if fromVersion and Version("0.90") <= Version(fromVersion) <= Version("0.96"): + from zorg import config + + busId = call("zorg", "Xorg.Display", "activeDeviceID") + device = config.getDeviceInfo(busId) + + if device: + config.saveDeviceInfo(device) + config.saveXorgConfig(device) + + if fromRelease and int(fromRelease) < 81: + from zorg import config + + layout, variant = config.getKeymapOld() + config.saveKeymap(layout, variant) diff --git a/x11/util/zorg/comar/xorg.display.py b/x11/util/zorg/comar/xorg.display.py new file mode 100644 index 0000000000..1ac57c9994 --- /dev/null +++ b/x11/util/zorg/comar/xorg.display.py @@ -0,0 +1,222 @@ +# -*- coding: utf-8 -*- + +import os + +import comar +from pardus.sysutils import * + +from zorg.config import * +from zorg.consts import * +from zorg.probe import * +from zorg.utils import * + +kernel_module_file = os.path.join(config_dir, "kernel_module") + +def getDevice(): + bus = configuredBus() + if not bus: + return None + + return getDeviceInfo(bus) + +def getDeviceOutput(output): + dev = getDevice() + if not dev: + return None, None + + if output not in dev.outputs: + dev.outputs[output] = Output(output) + + return dev, dev.outputs[output] + +# Model methods + +def ready(boot): + opts = {} + + if boot: + opts = get_kernel_option("xorg") + + if "keymap" in opts: + keymap = opts["keymap"].split("/", 1) + setKeymap(*keymap) + + if "safe" in opts: + return False + + driver = opts.get("driver") + + if driver or "probe" in opts: + return initialConfig(driver) + + busId = configuredBus() + if not busId: + return initialConfig() + + if boot: + # Check if the active card is changed + try: + device = getDeviceInfo(busId) + except IOError: + # Device is not present on specified bus. + # Check if the new device is configured before. + newBus = getPrimaryCard() + if newBus: + device = getDeviceInfo(VideoDevice(newBus).bus_id) + if device and not device.isChanged(): + # Yes, it is configured before. + # Reenable driver and write xorg.conf. + device.enableDriver() + saveXorgConfig(device) + else: + # This is a different card. + return initialConfig() + else: + # No card is present. Return True in order to + # start with a manually edited xorg.conf. + return True + else: + if not device or device.isChanged(): + return initialConfig() + + # Check kernel module. Later, this should be done + # with Xorg.Driver.ready method. + if os.path.exists(kernel_module_file): + kernelModule = file(kernel_module_file).read() + if run("/sbin/modprobe", "-i", kernelModule) and kernelModule != "fglrx": + return False + + return True + +def initialConfig(preferredDriver=None): + bus = getPrimaryCard() + + if bus: + device = VideoDevice(bus) + else: + # This machine might be a terminal server with no video cards. + # We start X and leave the decision to the user. + log_debug("No video card found.") + return True + + if preferredDriver is None: + preferredDriver = device.preferredDriver() + + device.setDriver(preferredDriver) + + saveDeviceInfo(device) + saveXorgConfig(device) + + return True + +def safeConfig(): + bus = getPrimaryCard() + + if bus: + device = VideoDevice(bus) + else: + # See the comment in initialConfig + return True + + device.setDriver("vesa") + device.depth = 16 + device.outputs["default"] = Output("default") + device.monitors["default"] = Monitor() + + saveDeviceInfo(device) + saveXorgConfig(device) + + return True + +# FIXME Confusing method name +def activeDeviceID(): + return configuredBus() + +def listDrivers(): + drivers = listAvailableDrivers() + + link = comar.Link() + packages = list(link.Xorg.Driver) + for package in packages: + try: + info = link.Xorg.Driver[package].getInfo() + except dbus.DBusException: + continue + alias = str(info["alias"]) + driver = str(info["xorg-module"]) + drivers.append(alias) + if driver in drivers: + drivers.remove(driver) + + return sorted(drivers) + +def setDriver(driver): + dev = getDevice() + if dev: + dev.setDriver(driver) + saveDeviceInfo(dev) + +def setDepth(depth): + dev = getDevice() + if dev: + dev.depth = depth + saveDeviceInfo(dev) + +def setOutput(output, enabled, ignored): + dev, out = getDeviceOutput(output) + + if dev: + out.setEnabled(enabled) + out.setIgnored(ignored) + + saveDeviceInfo(dev) + +def setMode(output, resolution, rate): + dev, out = getDeviceOutput(output) + + if dev: + out.setMode(resolution, rate) + + saveDeviceInfo(dev) + +def setOrientation(output, rotation, reflection): + dev, out = getDeviceOutput(output) + + if dev: + out.setOrientation(rotation, reflection) + + saveDeviceInfo(dev) + +def setPosition(output, position, arg): + dev, out = getDeviceOutput(output) + + if dev: + out.setPosition(position, arg) + + saveDeviceInfo(dev) + +def setMonitor(output, vendor, model, horizSync, vertRefresh): + dev, out = getDeviceOutput(output) + + if dev: + if model: + mon = Monitor() + mon.vendor = vendor + mon.model = model + mon.hsync = horizSync + mon.vref = vertRefresh + dev.monitors[output] = mon + elif output in dev.monitors: + del dev.monitors[output] + else: + return + + saveDeviceInfo(dev) + +def syncConfigs(): + dev = getDevice() + if dev: + saveXorgConfig(dev) + +def setKeymap(layout, variant=""): + saveKeymap(layout, variant) diff --git a/x11/util/zorg/files/keyboard-config.patch b/x11/util/zorg/files/keyboard-config.patch new file mode 100644 index 0000000000..398528b610 --- /dev/null +++ b/x11/util/zorg/files/keyboard-config.patch @@ -0,0 +1,106 @@ +Index: zorg-2.0.4/zorg/config.py +=================================================================== +--- zorg-2.0.4.orig/zorg/config.py ++++ zorg-2.0.4/zorg/config.py +@@ -11,6 +11,21 @@ from zorg.parser import * + from zorg.probe import VideoDevice, Monitor, Output + from zorg.utils import * + ++KEYMAP_CONF_TEMPLATE="""\ ++# This file is generated by zorg. If you want to change settings ++# in this file, edit the file 10-keyboard.conf in the same ++# directory. ++ ++Section "InputClass" ++ Identifier "Configured Keymap" ++ MatchIsKeyboard "on" ++ MatchTag "use_configured_keymap" ++ ++ %(comment_layout)sOption "xkb_layout" "%(layout)s" ++ %(comment_variant)sOption "xkb_variant" "%(variant)s" ++EndSection ++""" ++ + def saveXorgConfig(card): + parser = XorgParser() + +@@ -265,7 +280,7 @@ def saveDeviceInfo(card): + f = open(consts.config_file, "w") + f.write(doc.toPrettyString().replace("\n\n", "")) + +-def getKeymap(): ++def getKeymapOld(): + layout = None + variant = "" + +@@ -297,24 +312,44 @@ def getKeymap(): + + return layout, variant + +-def saveKeymap(layout, variant=""): +- if not os.path.exists(consts.config_dir): +- os.mkdir(consts.config_dir, 0755) ++def getKeymap(): ++ layout = None ++ variant = "" + + try: +- doc = piksemel.parse(consts.config_file) ++ p = XorgParser() ++ p.parseFile(consts.keymap_conf) ++ section = p.getSections("InputClass")[0] ++ layout = section.get("xkb_layout") ++ variant = section.get("xkb_variant", "") ++ + except OSError: +- doc = piksemel.newDocument("ZORG") ++ pass ++ ++ if not layout: ++ from pardus.localedata import languages + +- keyboardTag = doc.getTag("Keyboard") ++ try: ++ language = file("/etc/mudur/language").read().strip() ++ except IOError: ++ language = "en" ++ ++ if not languages.has_key(language): ++ language = "en" + +- if keyboardTag: +- keyboardTag.hide() ++ keymap = languages[language].keymaps[0] ++ layout = keymap.xkb_layout ++ variant = keymap.xkb_variant + +- keyboardTag = doc.insertTag("Keyboard") +- keyboardTag.insertTag("Layout").insertData(layout) +- if variant: +- keyboardTag.insertTag("Variant").insertData(variant) ++ return layout, variant + +- f = file(consts.config_file, "w") +- f.write(doc.toPrettyString().replace("\n\n", "")) ++def saveKeymap(layout, variant=""): ++ opts = {"layout": layout, ++ "variant": variant, ++ "comment_layout": "" if layout else "#", ++ "comment_variant": "" if variant else "#"} ++ ++ with open(consts.keymap_conf, "w") as f: ++ f.write(KEYMAP_CONF_TEMPLATE % opts) ++ f.flush() ++ os.fsync(f.fileno()) +Index: zorg-2.0.4/zorg/consts.py +=================================================================== +--- zorg-2.0.4.orig/zorg/consts.py ++++ zorg-2.0.4/zorg/consts.py +@@ -8,6 +8,7 @@ data_dir = "/usr/share/X11" + modules_dir = "/usr/lib/xorg/modules" + + xorg_conf_file = "/etc/X11/xorg.conf" ++keymap_conf = "/etc/X11/xorg.conf.d/00-configured-keymap.conf" + config_file = join(config_dir, "config.xml") + configured_bus_file = join(config_dir, "configured_bus") + drivers_file = join(data_dir, "DriversDB") diff --git a/x11/util/zorg/files/setkeymap-signature.patch b/x11/util/zorg/files/setkeymap-signature.patch new file mode 100644 index 0000000000..6a953ed6c2 --- /dev/null +++ b/x11/util/zorg/files/setkeymap-signature.patch @@ -0,0 +1,19 @@ +Index: zorg-cli +=================================================================== +--- zorg-cli (revision 31546) ++++ zorg-cli (revision 31547) +@@ -94,8 +94,12 @@ + setDriver(opts.driver) + + elif opts.keymap: +- keymap = opts.keymap.split("/", 1) +- link.Xorg.Display["zorg"].setKeymap(*keymap) ++ if "/" in opts.keymap: ++ layout, variant = opts.keymap.split("/", 1) ++ else: ++ layout, variant = opts.keymap, "" + ++ link.Xorg.Display["zorg"].setKeymap(layout, variant) ++ + else: + parser.print_help() diff --git a/x11/util/zorg/files/xorg-safe.conf b/x11/util/zorg/files/xorg-safe.conf new file mode 100644 index 0000000000..e0b88812ac --- /dev/null +++ b/x11/util/zorg/files/xorg-safe.conf @@ -0,0 +1,40 @@ +Section "Module" + SubSection "extmod" + Option "omit xfree86-dga" "true" + EndSubSection +EndSection + +Section "ServerFlags" + Option "BlankTime" "0" + Option "OffTime" "0" + Option "SuspendTime" "0" + Option "AllowMouseOpenFail" "true" + Option "StandbyTime" "0" +EndSection + +Section "Device" + Identifier "VideoCard" + Driver "vesa" +EndSection + +Section "Screen" + Identifier "Screen" + Device "VideoCard" + Monitor "Default Monitor" + DefaultDepth 16 + SubSection "Display" + Depth 16 + Modes "800x600" "640x480" + EndSubSection +EndSection + +Section "ServerLayout" + Identifier "Layout" + Screen "Screen" +EndSection + +Section "Monitor" + Identifier "Default Monitor" + HorizSync 31.5 - 50 + VertRefresh 50 - 70 +EndSection diff --git a/x11/util/zorg/pspec.xml b/x11/util/zorg/pspec.xml new file mode 100644 index 0000000000..65209a6fa5 --- /dev/null +++ b/x11/util/zorg/pspec.xml @@ -0,0 +1,50 @@ + + + + + zorg + http://www.pisilinux.org + + PisiLinux Community + admins@pisilinux.org + + GPLv2 + app:console + Çomar's X configuration tools + zorg is a set of X configuration tools and monitor and display adapter database files. + https://github.com/forYali/zorg/archive/2.0.4.tar.gz + + keyboard-config.patch + + + + + + zorg + + /sbin + /usr/bin + /usr/lib + /usr/share/X11 + /usr/share/doc + /var/lib/zorg + + + xorg-safe.conf + + + Xorg.Display + System.Package + + + + + + 2017-03-05 + 2.0.4 + First release + Ertuğrul Erata + ertugrulerata@gmail.com + + + diff --git a/x11/util/zorg/translations.xml b/x11/util/zorg/translations.xml new file mode 100644 index 0000000000..fd617efbad --- /dev/null +++ b/x11/util/zorg/translations.xml @@ -0,0 +1,10 @@ + + + + zorg + Çomar'ın X yapılandırma araçları + X yapılandırma araçları, monitör ve ekran kartı veritabanları + outils de configuration de X, fichiers de base de données des écrans et des cartes vidéo. + Çomar's X-Konfigurationtools + +