about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/pinnwand
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/servers/pinnwand')
-rw-r--r--nixpkgs/pkgs/servers/pinnwand/default.nix57
-rw-r--r--nixpkgs/pkgs/servers/pinnwand/steck.nix51
2 files changed, 108 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/pinnwand/default.nix b/nixpkgs/pkgs/servers/pinnwand/default.nix
new file mode 100644
index 000000000000..fac861d56b02
--- /dev/null
+++ b/nixpkgs/pkgs/servers/pinnwand/default.nix
@@ -0,0 +1,57 @@
+{ lib
+, python3
+, fetchFromGitHub
+, nixosTests
+}:
+
+with python3.pkgs; buildPythonApplication rec {
+  pname = "pinnwand";
+  version = "1.4.0";
+  format = "pyproject";
+
+  src = fetchFromGitHub {
+    owner = "supakeen";
+    repo = pname;
+    rev = "refs/tags/v${version}";
+    hash = "sha256-zJH2ojLQChElRvU2TWg4lW+Mey+wP0XbLJhVF16nvss=";
+  };
+
+  nativeBuildInputs = [
+    poetry-core
+    pythonRelaxDepsHook
+  ];
+
+  pythonRelaxDeps = [
+    "docutils"
+    "sqlalchemy"
+  ];
+
+  propagatedBuildInputs = [
+    click
+    docutils
+    pygments
+    pygments-better-html
+    sqlalchemy
+    token-bucket
+    tomli
+    tornado
+  ];
+
+  nativeCheckInputs = [
+    pytestCheckHook
+  ];
+
+  __darwinAllowLocalNetworking = true;
+
+  passthru.tests = nixosTests.pinnwand;
+
+  meta = with lib; {
+    changelog = "https://github.com/supakeen/pinnwand/releases/tag/v${version}";
+    description = "A Python pastebin that tries to keep it simple";
+    homepage = "https://supakeen.com/project/pinnwand/";
+    license = licenses.mit;
+    maintainers = with maintainers; [ hexa ];
+    mainProgram = "pinnwand";
+  };
+}
+
diff --git a/nixpkgs/pkgs/servers/pinnwand/steck.nix b/nixpkgs/pkgs/servers/pinnwand/steck.nix
new file mode 100644
index 000000000000..32e2141d2a9d
--- /dev/null
+++ b/nixpkgs/pkgs/servers/pinnwand/steck.nix
@@ -0,0 +1,51 @@
+{ lib
+, pkgs
+, python3Packages
+, fetchPypi
+, nixosTests
+}:
+
+python3Packages.buildPythonApplication rec {
+  pname = "steck";
+  version = "0.7.0";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1a3l427ibwck9zzzy1sp10hmjgminya08i4r9j4559qzy7lxghs1";
+  };
+
+  postPatch = ''
+    cat setup.py
+    substituteInPlace setup.py \
+      --replace 'click>=7.0,<8.0' 'click' \
+      --replace 'termcolor>=1.1.0,<2.0.0' 'termcolor'
+  '';
+
+  nativeBuildInputs = with python3Packages; [
+    setuptools
+  ];
+
+  propagatedBuildInputs = with python3Packages; [
+    pkgs.git
+    appdirs
+    click
+    python-magic
+    requests
+    termcolor
+    toml
+  ];
+
+  # tests are not in pypi package
+  doCheck = false;
+
+  passthru.tests = nixosTests.pinnwand;
+
+  meta = with lib; {
+    homepage = "https://github.com/supakeen/steck";
+    license = licenses.mit;
+    description = "Client for pinnwand pastebin";
+    mainProgram = "steck";
+    maintainers = with maintainers; [ hexa ];
+  };
+}
+