git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #149729 from WolfangAukang/cobang
commitf7791e01c04680eade1965db625d490a387fa532 authorSandro <sandro.jaeckel@gmail.com> dateTue 8 Mar 2022, 00:31 (5 years ago) parent24b5071834e7e8
8 files changed+276
pkgs/applications/misc/cobang/0001-Poetry-core-and-pillow-9.patch+31 pkgs/applications/misc/cobang/default.nix+102 pkgs/development/python-modules/kiss-headers/default.nix+39 pkgs/development/python-modules/python-zbar/default.nix+42 pkgs/development/python-modules/single-version/0001-set-poetry-core.patch+21 pkgs/development/python-modules/single-version/default.nix+31 pkgs/top-level/all-packages.nix+4 pkgs/top-level/python-packages.nix+6
pkgs/applications/misc/cobang/0001-Poetry-core-and-pillow-9.patchnew file+31
@@ -0,0 +1,31 @@
1+From 324a267b0e5505c9124874581bc48fb174fb2542 Mon Sep 17 00:00:00 2001
2+From: "P. R. d. O" <d.ol.rod@tutanota.com>
3+Date: Fri, 4 Mar 2022 07:03:17 -0600
4+Subject: [PATCH] Pillow update
5+
6+---
7+ pyproject.toml | 4 ++--
8+ 1 file changed, 2 insertions(+), 2 deletions(-)
9+
10+diff --git a/pyproject.toml b/pyproject.toml
11+index 5dc25e0..b3ba397 100644
12+--- a/pyproject.toml
13++++ b/pyproject.toml
14+@@ -11,7 +11,7 @@ readme = "README.rst"
15+ [tool.poetry.dependencies]
16+ python = "^3.7"
17+ logbook = "^1.5.3"
18+-Pillow = "^8.2.0"
19++Pillow = "^9.0.0"
20+ requests = "^2.24.0"
21+ kiss-headers = "^2.2.3"
22+ single-version = "^1.5.1"
23+@@ -33,4 +33,4 @@ skip-string-normalization = true
24+
25+ [build-system]
26+ requires = ["poetry>=0.12"]
27+-build-backend = "poetry.masonry.api"
28++build-backend = "poetry.core.masonry.api"
29+--
30+2.35.1
31+
pkgs/applications/misc/cobang/default.nixnew file+102
@@ -0,0 +1,102 @@
1+{ lib
2+, buildPythonApplication
3+, fetchFromGitHub
4+, wrapGAppsHook
5+, atk
6+, gdk-pixbuf
7+, gobject-introspection
8+, gtk3
9+, gst-plugins-good
10+, libhandy
11+, librsvg
12+, networkmanager
13+, pango
14+, gst-python
15+, kiss-headers
16+, Logbook
17+, pillow
18+, poetry-core
19+, pygobject3
20+, python
21+, python-zbar
22+, requests
23+, single-version
24+, pytestCheckHook }:
25+
26+buildPythonApplication rec {
27+ pname = "cobang";
28+ version = "0.9.6";
29+ format = "pyproject";
30+
31+ src = fetchFromGitHub {
32+ owner = "hongquan";
33+ repo = "CoBang";
34+ rev = "v${version}";
35+ sha256 = "sha256-YcXQ2wAgFSsJEqcaDQotpX1put4pQaF511kwq/c2yHw=";
36+ };
37+
38+ patches = [
39+ ./0001-Poetry-core-and-pillow-9.patch
40+ ];
41+
42+ nativeBuildInputs = [
43+ gobject-introspection
44+ wrapGAppsHook
45+ ];
46+
47+ propagatedBuildInputs = [
48+ gst-python
49+ kiss-headers
50+ Logbook
51+ pillow
52+ poetry-core
53+ pygobject3
54+ python-zbar
55+ requests
56+ single-version
57+ ];
58+
59+ buildInputs = [
60+ atk
61+ gdk-pixbuf
62+ # Needed to detect namespaces
63+ gobject-introspection
64+ gst-plugins-good
65+ libhandy
66+ networkmanager
67+ pango
68+ ];
69+
70+ checkInputs = [
71+ pytestCheckHook
72+ ];
73+
74+ # Wrapping this manually for SVG recognition
75+ dontWrapGApps = true;
76+
77+ postInstall = ''
78+ # Needed by the application
79+ cp -R data $out/${python.sitePackages}/
80+
81+ # Icons and applications
82+ install -Dm 644 $out/${python.sitePackages}/data/vn.hoabinh.quan.CoBang.svg -t $out/share/pixmaps/
83+ install -Dm 644 $out/${python.sitePackages}/data/vn.hoabinh.quan.CoBang.desktop -t $out/share/applications/
84+ substituteInPlace $out/share/applications/vn.hoabinh.quan.CoBang.desktop \
85+ --replace "Exec=" "Exec=$out/bin/"
86+ '';
87+
88+ preFixup = ''
89+ wrapProgram $out/bin/cobang \
90+ ''${gappsWrapperArgs[@]} \
91+ --prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \
92+ --set GDK_PIXBUF_MODULE_FILE "${librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"
93+ '';
94+
95+ meta = with lib; {
96+ description = "A QR code scanner desktop app for Linux";
97+ homepage = "https://github.com/hongquan/CoBang";
98+ license = licenses.gpl3Only;
99+ maintainers = with maintainers; [ wolfangaukang ];
100+ platforms = [ "x86_64-linux" ];
101+ };
102+}
pkgs/development/python-modules/kiss-headers/default.nixnew file+39
@@ -0,0 +1,39 @@
1+{ lib, buildPythonPackage, fetchFromGitHub, requests, pytestCheckHook }:
2+
3+buildPythonPackage rec {
4+ pname = "kiss-headers";
5+ version = "2.3.0";
6+ format = "setuptools";
7+
8+ src = fetchFromGitHub {
9+ owner = "Ousret";
10+ repo = pname;
11+ rev = version;
12+ sha256 = "sha256-/eTRyxFyAKQMzE/JjdoEN3w0lRiaIJcsJHTWV8M0CYQ=";
13+ };
14+
15+ propagatedBuildInputs = [ requests ];
16+
17+ checkInputs = [ pytestCheckHook ];
18+
19+ postPatch = ''
20+ substituteInPlace setup.cfg \
21+ --replace "--cov=kiss_headers --doctest-modules --cov-report=term-missing -rxXs" "--doctest-modules -rxXs"
22+ '';
23+
24+ disabledTestPaths = [
25+ # Tests require internet access
26+ "kiss_headers/__init__.py"
27+ "tests/test_serializer.py"
28+ "tests/test_with_http_request.py"
29+ ];
30+
31+ pythonImportsCheck = [ "kiss_headers" ];
32+
33+ meta = with lib; {
34+ description = "Python package for HTTP/1.1 style headers";
35+ homepage = "https://github.com/Ousret/kiss-headers";
36+ license = licenses.mit;
37+ maintainers = with maintainers; [ wolfangaukang ];
38+ };
39+}
pkgs/development/python-modules/python-zbar/default.nixnew file+42
@@ -0,0 +1,42 @@
1+{ lib , buildPythonPackage , fetchFromGitHub , pillow , zbar , pytestCheckHook }:
2+
3+buildPythonPackage rec {
4+ pname = "python-zbar";
5+ version = "0.23.90";
6+ format = "setuptools";
7+
8+ src = fetchFromGitHub {
9+ owner = "mchehab";
10+ repo = "zbar";
11+ rev = version;
12+ sha256 = "sha256-FvV7TMc4JbOiRjWLka0IhtpGGqGm5fis7h870OmJw2U=";
13+ };
14+
15+ propagatedBuildInputs = [ pillow ];
16+
17+ buildInputs = [ zbar ];
18+
19+ checkInputs = [ pytestCheckHook ];
20+
21+ preBuild = ''
22+ cd python
23+ '';
24+
25+ disabledTests = [
26+ #AssertionError: b'Y800' != 'Y800'
27+ "test_format"
28+ "test_new"
29+ #Requires loading a recording device
30+ #zbar.SystemError: <zbar.Processor object at 0x7ffff615a680>
31+ "test_processing"
32+ ];
33+
34+ pythonImportsCheck = [ "zbar" ];
35+
36+ meta = with lib; {
37+ description = "Python bindings for zbar";
38+ homepage = "https://github.com/mchehab/zbar";
39+ license = licenses.lgpl21Only;
40+ maintainers = with maintainers; [ wolfangaukang ];
41+ };
42+}
pkgs/development/python-modules/single-version/0001-set-poetry-core.patchnew file+21
@@ -0,0 +1,21 @@
1+From d949b37151cd538d4c6a15e1ba6c1343f8bff76d Mon Sep 17 00:00:00 2001
2+From: "P. R. d. O" <d.ol.rod@protonmail.com>
3+Date: Mon, 6 Dec 2021 15:26:19 -0600
4+Subject: [PATCH] set poetry-core
5+
6+---
7+ pyproject.toml | 2 +-
8+ 1 file changed, 1 insertion(+), 1 deletion(-)
9+
10+diff --git a/pyproject.toml b/pyproject.toml
11+index d3fdc52..bd7ddc2 100644
12+--- a/pyproject.toml
13++++ b/pyproject.toml
14+@@ -27,4 +27,4 @@ black = "^19.10b0"
15+
16+ [build-system]
17+ requires = ["poetry>=0.12"]
18+-build-backend = "poetry.masonry.api"
19++build-backend = "poetry.core.masonry.api"
20+--
21+2.33.1
pkgs/development/python-modules/single-version/default.nixnew file+31
@@ -0,0 +1,31 @@
1+{ lib, buildPythonPackage, fetchFromGitHub, poetry-core, pytestCheckHook }:
2+
3+buildPythonPackage rec {
4+ pname = "single-version";
5+ version = "1.5.1";
6+ format = "pyproject";
7+
8+ src = fetchFromGitHub {
9+ owner = "hongquan";
10+ repo = pname;
11+ rev = "v${version}";
12+ sha256 = "sha256-I8ATQzPRH9FVjqPoqrNjYMBU5azpmkLjRmHcz943C10=";
13+ };
14+
15+ patches = [
16+ ./0001-set-poetry-core.patch
17+ ];
18+
19+ nativeBuildInputs = [ poetry-core ];
20+
21+ checkInputs = [ pytestCheckHook ];
22+
23+ pythonImportsCheck = [ "single_version" ];
24+
25+ meta = with lib; {
26+ description = "Utility to let you have a single source of version in your code base";
27+ homepage = "https://github.com/hongquan/single-version";
28+ license = licenses.mit;
29+ maintainers = with maintainers; [ wolfangaukang ];
30+ };
31+}
pkgs/top-level/all-packages.nix+4
@@ -4484,6 +4484,10 @@ with pkgs;
44844484 inherit (darwin.apple_sdk.frameworks) CoreServices;
44854485 };
44864486
4487+ cobang = python3Packages.callPackage ../applications/misc/cobang {
4488+ gst-plugins-good = gst_all_1.gst-plugins-good.override { gtkSupport = true; };
4489+ };
4490+
44874491 cocoapods = callPackage ../development/mobile/cocoapods { };
44884492
44894493 cocoapods-beta = lowPrio (callPackage ../development/mobile/cocoapods { beta = true; });
pkgs/top-level/python-packages.nix+6
@@ -4476,6 +4476,8 @@ in {
44764476
44774477 kinparse = callPackage ../development/python-modules/kinparse { };
44784478
4479+ kiss-headers = callPackage ../development/python-modules/kiss-headers { };
4480+
44794481 kitchen = callPackage ../development/python-modules/kitchen { };
44804482
44814483 kivy = callPackage ../development/python-modules/kivy {
@@ -8275,6 +8277,8 @@ in {
82758277
82768278 python-xmp-toolkit = callPackage ../development/python-modules/python-xmp-toolkit { };
82778279
8280+ python-zbar = callPackage ../development/python-modules/python-zbar { };
8281+
82788282 pythran = callPackage ../development/python-modules/pythran {
82798283 inherit (pkgs.llvmPackages) openmp;
82808284 };
@@ -9194,6 +9198,8 @@ in {
91949198
91959199 simpy = callPackage ../development/python-modules/simpy { };
91969200
9201+ single-version = callPackage ../development/python-modules/single-version { };
9202+
91979203 signify = callPackage ../development/python-modules/signify { };
91989204
91999205 siosocks = callPackage ../development/python-modules/siosocks { };