Merge pull request #46556 from rnhmjoj/lastpass

qutebrowser: patch all python scripts
This commit is contained in:
xeji 2018-09-12 23:51:40 +02:00 committed by GitHub
commit decd819911
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 130 additions and 20 deletions

View file

@ -55,6 +55,9 @@ in python3Packages.buildPythonApplication rec {
propagatedBuildInputs = with python3Packages; [
pyyaml pyqt5 jinja2 pygments
pypeg2 cssutils pyopengl attrs
# scripts and userscripts libs
tldextract beautifulsoup4
pyreadability pykeepass stem
];
postPatch = ''
@ -81,15 +84,15 @@ in python3Packages.buildPythonApplication rec {
"$out/share/icons/hicolor/scalable/apps/qutebrowser.svg"
# Install scripts
sed -i "s,/usr/bin/qutebrowser,$out/bin/qutebrowser,g" scripts/open_url_in_instance.sh
install -Dm755 -t "$out/share/qutebrowser/scripts/" scripts/open_url_in_instance.sh
sed -i "s,/usr/bin/,$out/bin/,g" scripts/open_url_in_instance.sh
install -Dm755 -t "$out/share/qutebrowser/scripts/" $(find scripts -type f)
install -Dm755 -t "$out/share/qutebrowser/userscripts/" misc/userscripts/*
# Install and patch python scripts
# Patch python scripts
buildPythonPath "$out $propagatedBuildInputs"
for i in importer dictcli keytester utils; do
install -Dm755 -t "$out/share/qutebrowser/scripts/" scripts/$i.py
patchPythonScript "$out/share/qutebrowser/scripts/$i.py"
scripts=$(grep -rl python "$out"/share/qutebrowser/{user,}scripts/)
for i in $scripts; do
patchPythonScript "$i"
done
'';
@ -97,10 +100,10 @@ in python3Packages.buildPythonApplication rec {
wrapProgram $out/bin/qutebrowser --add-flags "--backend webkit"
'';
meta = {
homepage = https://github.com/The-Compiler/qutebrowser;
meta = with stdenv.lib; {
homepage = https://github.com/The-Compiler/qutebrowser;
description = "Keyboard-focused browser with a minimal GUI";
license = stdenv.lib.licenses.gpl3Plus;
maintainers = [ stdenv.lib.maintainers.jagajaga ];
license = licenses.gpl3Plus;
maintainers = with maintainers; [ jagajaga rnhmjoj ];
};
}

View file

@ -1,23 +1,26 @@
{ stdenv, buildPythonPackage, fetchFromGitHub, six, pytest }:
{ stdenv, buildPythonPackage, fetchFromGitHub
, six, pytest, arrow
}:
buildPythonPackage rec {
pname = "construct";
version = "2.8.16";
name = pname + "-" + version;
pname = "construct";
version = "2.9.45";
src = fetchFromGitHub {
owner = "construct";
repo = "construct";
rev = "v${version}";
sha256 = "0lzz1dy419n254qccch7yx4nkpwd0fsyjhnsnaf6ysgwzqxxv63j";
owner = pname;
repo = pname;
rev = "v${version}";
sha256 = "0ig66xrzswpkhhmw123p2nvr15a9lxz54a1fmycfdh09327c1d3y";
};
propagatedBuildInputs = [ six ];
checkInputs = [ pytest ];
checkInputs = [ pytest arrow ];
# TODO: figure out missing dependencies
doCheck = false;
checkPhase = ''
py.test -k 'not test_numpy' tests
py.test -k 'not test_numpy and not test_gallery' tests
'';
meta = with stdenv.lib; {

View file

@ -0,0 +1,26 @@
{ lib, fetchPypi, buildPythonPackage
, lxml, pycryptodome, construct
, argon2_cffi, dateutil, enum34
}:
buildPythonPackage rec {
pname = "pykeepass";
version = "3.0.2";
src = fetchPypi {
inherit pname version;
sha256 = "1kfnh42nimsbdpwpny2c9df82b2n4fb5fagh54ck06f3x483vd90";
};
propagatedBuildInputs = [
lxml pycryptodome construct
argon2_cffi dateutil enum34
];
meta = {
homepage = https://github.com/pschmitt/pykeepass;
description = "Python library to interact with keepass databases (supports KDBX3 and KDBX4)";
license = lib.licenses.gpl3;
};
}

View file

@ -0,0 +1,26 @@
{ lib, fetchPypi, buildPythonPackage
, requests, chardet, cssselect, lxml
, pytest
}:
buildPythonPackage rec {
pname = "PyReadability";
version = "0.4.0";
src = fetchPypi {
inherit pname version;
sha256 = "1k6fq416pdmjcdqh6gdxl0y0k8kj1zlpzwp5574xsvsha18p2zpn";
};
propagatedBuildInputs = [ requests chardet cssselect lxml ];
# ModuleNotFoundError: No module named 'tests'
doCheck = false;
meta = {
homepage = https://github.com/hyperlinkapp/python-readability;
description = "fast python port of arc90's readability tool, updated to match latest readability.js!";
license = lib.licenses.asl20;
};
}

View file

@ -0,0 +1,20 @@
{ lib, fetchPypi, buildPythonPackage, requests, six }:
buildPythonPackage rec {
pname = "requests-file";
version = "1.4.3";
src = fetchPypi {
inherit pname version;
sha256 = "1yp2jaxg3v86pia0q512dg3hz6s9y5vzdivsgrba1kds05ial14g";
};
propagatedBuildInputs = [ requests six ];
meta = {
homepage = https://github.com/dashea/requests-file;
description = "Transport adapter for fetching file:// URLs with the requests python library";
license = lib.licenses.asl20;
};
}

View file

@ -0,0 +1,24 @@
{ lib, fetchPypi, buildPythonPackage
, requests, requests-file, idna, pytest
, responses
}:
buildPythonPackage rec {
pname = "tldextract";
version = "2.2.0";
src = fetchPypi {
inherit pname version;
sha256 = "1d5s8v6kpsgazyahflhji1cfdcf89rv7l7z55v774bhzvcjp2y99";
};
propagatedBuildInputs = [ requests requests-file idna ];
checkInputs = [ pytest responses ];
meta = {
homepage = https://github.com/john-kurkowski/tldextract;
description = "Accurately separate the TLD from the registered domain and subdomains of a URL, using the Public Suffix List.";
license = lib.licenses.bsd3;
};
}

View file

@ -469,6 +469,8 @@ in {
pykerberos = callPackage ../development/python-modules/pykerberos { };
pykeepass = callPackage ../development/python-modules/pykeepass { };
pymatgen = callPackage ../development/python-modules/pymatgen { };
pymatgen-lammps = callPackage ../development/python-modules/pymatgen-lammps { };
@ -2010,6 +2012,8 @@ in {
requests-cache = callPackage ../development/python-modules/requests-cache { };
requests-file = callPackage ../development/python-modules/requests-file { };
requests-kerberos = callPackage ../development/python-modules/requests-kerberos { };
requests-unixsocket = callPackage ../development/python-modules/requests-unixsocket {};
@ -11153,6 +11157,8 @@ in {
};
});
pyreadability = callPackage ../development/python-modules/pyreadability { };
pyscss = buildPythonPackage rec {
name = "pyScss-${version}";
version = "1.3.5";
@ -17085,6 +17091,8 @@ EOF
textacy = callPackage ../development/python-modules/textacy { };
tldextract = callPackage ../development/python-modules/tldextract { };
pyemd = callPackage ../development/python-modules/pyemd { };
pulp = callPackage ../development/python-modules/pulp { };