From fc9baeaec9dc60ba4ccb07acb61c7f11f3e0243c Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Sun, 12 Mar 2023 16:07:33 +0100 Subject: [PATCH 1/2] offpunk: standardize through buildPythonPackage --- .../networking/browsers/offpunk/default.nix | 31 ++++++------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/pkgs/applications/networking/browsers/offpunk/default.nix b/pkgs/applications/networking/browsers/offpunk/default.nix index 6945ce5245a2..fd4e8d9fbd7c 100644 --- a/pkgs/applications/networking/browsers/offpunk/default.nix +++ b/pkgs/applications/networking/browsers/offpunk/default.nix @@ -3,10 +3,8 @@ installShellFiles, less, lib, - makeWrapper, offpunk, - python3, - stdenv, + python3Packages, testers, timg, xdg-utils, @@ -14,7 +12,7 @@ }: let - pythonDependencies = with python3.pkgs; [ + pythonDependencies = with python3Packages; [ beautifulsoup4 cryptography feedparser @@ -30,40 +28,31 @@ let xsel ]; in -stdenv.mkDerivation (finalAttrs: { +python3Packages.buildPythonPackage rec { pname = "offpunk"; version = "1.9"; src = fetchFromSourcehut { owner = "~lioploum"; repo = "offpunk"; - rev = "v${finalAttrs.version}"; + rev = "v${version}"; sha256 = "sha256-sxX4/7jbNbLwHVfE1lDtjr/luby5zAf6Hy1RcwXZLBA="; }; - nativeBuildInputs = [ makeWrapper installShellFiles ]; - buildInputs = otherDependencies ++ pythonDependencies; + nativeBuildInputs = [ installShellFiles ]; + propagatedBuildInputs = otherDependencies ++ pythonDependencies; - installPhase = '' - runHook preInstall - - install -D ./offpunk.py $out/bin/offpunk - - wrapProgram $out/bin/offpunk \ - --set PYTHONPATH "$PYTHONPATH" \ - --set PATH ${lib.makeBinPath otherDependencies} - - installManPage man/*.1 - runHook postInstall + postInstall = '' + installManPage man/*.1 ''; passthru.tests.version = testers.testVersion { package = offpunk; }; meta = with lib; { description = "An Offline-First browser for the smolnet "; - homepage = finalAttrs.src.meta.homepage; + homepage = src.meta.homepage; maintainers = with maintainers; [ DamienCassou ]; platforms = platforms.linux; license = licenses.bsd2; }; -}) +} From e492322048ec9464b6fc9faa94b475f1c21fff37 Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Mon, 13 Mar 2023 17:19:30 +0100 Subject: [PATCH 2/2] offpunk: 1.9->1.9.2 --- pkgs/applications/networking/browsers/offpunk/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/browsers/offpunk/default.nix b/pkgs/applications/networking/browsers/offpunk/default.nix index fd4e8d9fbd7c..e9f2ea4261ef 100644 --- a/pkgs/applications/networking/browsers/offpunk/default.nix +++ b/pkgs/applications/networking/browsers/offpunk/default.nix @@ -30,13 +30,16 @@ let in python3Packages.buildPythonPackage rec { pname = "offpunk"; - version = "1.9"; + version = "1.9.2"; + format = "flit"; + + disabled = python3Packages.pythonOlder "3.7"; src = fetchFromSourcehut { owner = "~lioploum"; repo = "offpunk"; rev = "v${version}"; - sha256 = "sha256-sxX4/7jbNbLwHVfE1lDtjr/luby5zAf6Hy1RcwXZLBA="; + sha256 = "sha256-CYsuoj5/BaaboDRtcOrGzJoZDCfOLs7ROVWLVjOAnRU="; }; nativeBuildInputs = [ installShellFiles ];