diff options
author | Maksim Fomin | 2019-08-10 14:04:42 +0000 |
---|---|---|
committer | Maksim Fomin | 2019-08-10 14:04:42 +0000 |
commit | ed139fbfbc36275f2b2c7d8c81fe30c6d939cb15 (patch) | |
tree | dcfc88ab4b267f6bc2f5e33111ec64cd79be33af | |
parent | 48d07b478499f0c8037ef2e2dd7714a4d1d0de63 (diff) | |
download | aur-ed139fbfbc36275f2b2c7d8c81fe30c6d939cb15.tar.gz |
Add support for polkit; add gksu as optdepends
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | 01-add-pkexec-support.patch | 65 | ||||
-rw-r--r-- | PKGBUILD | 16 |
3 files changed, 83 insertions, 4 deletions
@@ -1,15 +1,19 @@ pkgbase = wxhexeditor pkgdesc = A free hex editor / disk editor for Linux, Windows and MacOSX pkgver = 0.24 - pkgrel = 2 + pkgrel = 3 url = http://www.wxhexeditor.org arch = i686 arch = x86_64 license = GPL2 makedepends = python depends = wxgtk3 + optdepends = gksu: For root access support + optdepends = polkit: For root access support source = https://github.com/EUA/wxHexEditor/archive/v0.24.tar.gz + source = 01-add-pkexec-support.patch md5sums = 1b77bddc026e22797fd0e7a82e52cd28 + md5sums = e62ae9e6b0aac2afdcc41b51cab39272 pkgname = wxhexeditor diff --git a/01-add-pkexec-support.patch b/01-add-pkexec-support.patch new file mode 100644 index 000000000000..81edf8b0c6da --- /dev/null +++ b/01-add-pkexec-support.patch @@ -0,0 +1,65 @@ +From f30fc44b365a99f7a784f10d15054b0a661f626d Mon Sep 17 00:00:00 2001
+From: gitfib <gitfib@users.noreply.github.com>
+Date: Sat, 10 Aug 2019 14:00:50 +0300
+Subject: [PATCH] Add pkexec support
+
+---
+ src/FAL.cpp | 22 +++++++++++++++-------
+ 1 file changed, 15 insertions(+), 7 deletions(-)
+
+diff --git a/src/FAL.cpp b/src/FAL.cpp
+index cccb6fa..fb48e6d 100644
+--- a/src/FAL.cpp
++++ b/src/FAL.cpp
+@@ -247,18 +247,22 @@ bool FAL::OSDependedOpen(wxFileName& myfilename, FileAccessMode FAM, unsigned Fo
+ //Changing owner of file...
+ //I think it's better than changing permissions directly. Doesn't it?
+ //Will restore owner on file close.
+- wxString cmd;
+- if( wxFile::Exists( wxT("/usr/bin/gnomesu")))
++ wxString cmd, spacer = wxT(" ");
++ if ( wxFile::Exists( wxT("/usr/bin/pkexec"))){
++ cmd = wxT("pkexec --user root chown \"");
++ spacer = wxT("\" \"");
++ }
++ else if( wxFile::Exists( wxT("/usr/bin/gnomesu")))
+ cmd = wxT("gnomesu -u root -c \"chown ");
+ else if( wxFile::Exists( wxT("/usr/bin/gksu")))
+ cmd = wxT("gksu -u root \"chown ");
+ else if( wxFile::Exists( wxT("/usr/bin/gksudo")))
+ cmd = wxT("gksudo -u root \"chown ");
+ else{
+- wxMessageBox(_("For using this function, please install \"gnomesu\" or \"gksu\" tools first."),_("Error"), wxOK|wxCANCEL|wxICON_ERROR);
++ wxMessageBox(_("For using this function, please install \"pkexec\", \"gnomesu\" or \"gksu\" tools first."),_("Error"), wxOK|wxCANCEL|wxICON_ERROR);
+ return false;
+ }
+- cmd+=wxGetUserId() + wxT(" ")+ myfilename.GetFullPath() +wxT("\"");
++ cmd+=wxGetUserId() + spacer + myfilename.GetFullPath() +wxT("\"");
+ #ifdef _DEBUG_
+ std::cout << "Changing permission of " << myfilename.GetFullPath().ToAscii() << std::endl;
+ std::cout << cmd.ToAscii() << std::endl;
+@@ -358,14 +362,18 @@ FAL::~FAL(){
+ #ifndef __WXMSW__
+ if(!oldOwner.IsEmpty() ){
+ //Will restore owner on file close.
+- wxString cmd;
+- if( wxFile::Exists( wxT("/usr/bin/gnomesu")))
++ wxString cmd, spacer = wxT(" ");
++ if ( wxFile::Exists( wxT("/usr/bin/pkexec"))){
++ cmd = wxT("pkexec --user root chown \"");
++ spacer = wxT("\" \"");
++ }
++ else if( wxFile::Exists( wxT("/usr/bin/gnomesu")))
+ cmd = wxT("gnomesu -c \"chown ");
+ else if( wxFile::Exists( wxT("/usr/bin/gksu")))
+ cmd = wxT("gksu -u root \"chown ");
+ else if( wxFile::Exists( wxT("/usr/bin/gksudo")))
+ cmd = wxT("gksudo -u root \"chown ");
+- cmd += oldOwner + wxT(" ")+ the_file.GetFullPath() +wxT("\"");
++ cmd += oldOwner + spacer + the_file.GetFullPath() +wxT("\"");
+ #ifdef _DEBUG_
+ std::cout << "Changing permission of " << the_file.GetFullPath().ToAscii() << std::endl;
+ std::cout << cmd.ToAscii() << std::endl;
+--
+2.22.0 + @@ -1,16 +1,26 @@ # Maintainer: Steven Honeyman <stevenhoneyman at gmail com> +# Maintainer: Maxim Fomin <maxim at fomin one> pkgname=wxhexeditor pkgver=0.24 -pkgrel=2 +pkgrel=3 pkgdesc="A free hex editor / disk editor for Linux, Windows and MacOSX" arch=('i686' 'x86_64') url="http://www.wxhexeditor.org" license=('GPL2') depends=('wxgtk3') makedepends=('python') -source=("https://github.com/EUA/wxHexEditor/archive/v$pkgver.tar.gz") -md5sums=('1b77bddc026e22797fd0e7a82e52cd28') +optdepends=('gksu: For root access support' + 'polkit: For root access support') +source=("https://github.com/EUA/wxHexEditor/archive/v$pkgver.tar.gz" + "01-add-pkexec-support.patch") +md5sums=('1b77bddc026e22797fd0e7a82e52cd28' + 'e62ae9e6b0aac2afdcc41b51cab39272') + +prepare() { + cd "$srcdir/wxHexEditor-$pkgver" + patch -Np1 -i "${srcdir}/01-add-pkexec-support.patch" +} build() { cd "$srcdir/wxHexEditor-$pkgver" |