From 856cae1f3f0168149893bb274b0a234b171e4f9b Mon Sep 17 00:00:00 2001 From: Rmys Date: Sun, 5 Jan 2020 19:52:15 +0300 Subject: [PATCH] pisi-2.6.1:ver. bump mesontools --- system/base/pisi/actions.py | 4 +- .../kernel-5.4-kerneltools-headers.patch | 14 +++ system/base/pisi/files/mesontools.py | 99 +++++++++++++++++++ system/base/pisi/pspec.xml | 9 ++ 4 files changed, 124 insertions(+), 2 deletions(-) create mode 100644 system/base/pisi/files/kernel-5.4-kerneltools-headers.patch create mode 100644 system/base/pisi/files/mesontools.py diff --git a/system/base/pisi/actions.py b/system/base/pisi/actions.py index 50aeff92..e69d74bb 100644 --- a/system/base/pisi/actions.py +++ b/system/base/pisi/actions.py @@ -9,8 +9,8 @@ from pisi.actionsapi import shelltools from pisi.actionsapi import pythonmodules def build(): - pisitools.dosed("pisi/__init__.py", "2.4", "2.6") - pisitools.dosed("pisi/db/lazydb.py", "2.4", "2.6") + pisitools.dosed("pisi/__init__.py", "2.4", "2.6.1") + pisitools.dosed("pisi/db/lazydb.py", "2.4", "2.6.1") pythonmodules.compile() def install(): diff --git a/system/base/pisi/files/kernel-5.4-kerneltools-headers.patch b/system/base/pisi/files/kernel-5.4-kerneltools-headers.patch new file mode 100644 index 00000000..69b2d443 --- /dev/null +++ b/system/base/pisi/files/kernel-5.4-kerneltools-headers.patch @@ -0,0 +1,14 @@ +diff -Nuar a/pisi/actionsapi/kerneltools.py b/pisi/actionsapi/kerneltools.py +--- a/pisi/actionsapi/kerneltools.py 2014-03-08 00:03:46.000000000 +0200 ++++ b/pisi/actionsapi/kerneltools.py 2020-01-05 19:42:38.461427561 +0300 +@@ -268,7 +268,9 @@ + #######################Workaround ends here ... + + # make defconfig and install the headers +- autotools.make("%s defconfig" % make_cmd) ++ #autotools.make("%s defconfig" % make_cmd) ++ #kernel-5.4 ++ autotools.make("%s mrproper" % make_cmd) + autotools.rawInstall(make_cmd, "headers_install") + + oldwd = os.getcwd() diff --git a/system/base/pisi/files/mesontools.py b/system/base/pisi/files/mesontools.py new file mode 100644 index 00000000..9bada612 --- /dev/null +++ b/system/base/pisi/files/mesontools.py @@ -0,0 +1,99 @@ +# -*- coding: utf-8 -*- +import gettext + +import pisi.actionsapi +import pisi.context as ctx +from pisi.actionsapi import get +from pisi.actionsapi.shelltools import system + +__trans = gettext.translation('pisi', fallback=True) +_ = __trans.ugettext + + +class ConfigureError(pisi.actionsapi.Error): + def __init__(self, value=''): + pisi.actionsapi.Error.__init__(self, value) + self.value = value + ctx.ui.error(value) + + +class CompileError(pisi.actionsapi.Error): + def __init__(self, value=''): + pisi.actionsapi.Error.__init__(self, value) + self.value = value + ctx.ui.error(value) + + +class InstallError(pisi.actionsapi.Error): + def __init__(self, value=''): + pisi.actionsapi.Error.__init__(self, value) + self.value = value + ctx.ui.error(value) + + +def configure(parameters='', build_dir='build'): + """ + Configures the project into the build directory with the parameters using meson. + + Args: + parameters (str): Extra parameters for the command. Default is empty string. + build_dir (str): Build directory. Default is 'build'. + + Examples: + >>> mesontools.configure() + >>> mesontools.configure('extra parameters') + >>> mesontools.configure('extra parameters', 'custom_build_dir') + """ + default_parameters = ' '.join([ + '--prefix=/%s' % get.defaultprefixDIR(), + '--bindir=/usr/bin', + '--datadir=/%s' % get.dataDIR(), + '--includedir=/usr/include', + '--infodir=/%s' % get.infoDIR(), + '--libdir=/%s' % ('usr/lib32' if get.buildTYPE() == 'emul32' else 'usr/lib'), + '--libexecdir=/%s' % get.libexecDIR(), + '--localedir=/usr/share/locale', + '--localstatedir=/%s' % get.localstateDIR(), + '--mandir=/%s' % get.manDIR(), + '--sbindir=/%s' % get.sbinDIR(), + '--sharedstatedir=com', + '--sysconfdir=/etc', + '--default-library=shared', + ]) + if system('meson setup %s %s %s' % (default_parameters, parameters, build_dir)): + raise ConfigureError(_('Configuration failed.')) + + +def build(parameters='', build_dir='build'): + """ + Builds the project into the build directory with the parameters using ninja. Instead of letting ninja + to detect number of cores, this function gets the number from PISI configurations. + + Args: + parameters (str): Extra parameters for the command. Default is empty string. + build_dir (str): Build directory. Default is 'build'. + + Examples: + >>> mesontools.build() + >>> mesontools.build('extra parameters') + >>> mesontools.build('extra parameters', 'custom_build_dir') + """ + if system('ninja -C %s %s %s' % (build_dir, parameters, get.makeJOBS())): + raise CompileError(_('Make failed.')) + + +def install(parameters='', build_dir='build'): + """ + Installs the project to the destination directory. + + Args: + parameters (str): Extra parameters for the command. Default is empty string. + build_dir (str): Build directory. Default is 'build'. + + Examples: + >>> mesontools.install() + >>> mesontools.install('extra parameters') + >>> mesontools.install('extra parameters', 'custom_build_dir') + """ + if system('DESTDIR=%s ninja -C %s %s install' % (get.installDIR(), build_dir, parameters, )): + raise InstallError(_('Install failed.')) diff --git a/system/base/pisi/pspec.xml b/system/base/pisi/pspec.xml index b4abc8fa..ad71351a 100644 --- a/system/base/pisi/pspec.xml +++ b/system/base/pisi/pspec.xml @@ -36,6 +36,7 @@ emergeup.patch fetch.patch kerneltools_extra_headers_moved.patch + kernel-5.4-kerneltools-headers.patch @@ -80,6 +81,7 @@ tmpfiles.conf qt5.py kde5.py + mesontools.py System.Package @@ -88,6 +90,13 @@ + + 2020-01-05 + 2.6.1 + add parameters + PisiLinux Community + admin@pisilinux.org + 2019-12-27 2.6