Merge pull request #21516 from timbertson/gup

gup: 0.5.5 -> 0.6.0 and extract src into JSON

authored by

Michael Raskin and committed by
GitHub
1d44213c 4276844c

+62 -23
+23 -7
pkgs/development/tools/build-managers/gup/build.nix
··· 1 - # NOTE: this file is copied from the upstream repository for this package. 2 - # Please submit any changes you make here to https://github.com/timbertson/gup/ 1 + # NOTE: the `nixpkgs` version of this file is copied from the upstream repository 2 + # for this package. Please make any changes to https://github.com/timbertson/gup/ 3 3 4 - { stdenv, lib, python, which, pychecker ? null }: 5 - { src, version, meta ? {} }: 4 + { stdenv, lib, pythonPackages }: 5 + { src, version, meta ? {}, passthru ? {}, forceTests ? false }: 6 + let 7 + testInputs = [ 8 + pythonPackages.mocktest or null 9 + pythonPackages.whichcraft 10 + pythonPackages.nose 11 + pythonPackages.nose_progressive 12 + ]; 13 + pychecker = pythonPackages.pychecker or null; 14 + usePychecker = forceTests || pychecker != null; 15 + enableTests = forceTests || (lib.all (dep: dep != null) testInputs); 16 + in 6 17 stdenv.mkDerivation { 7 - inherit src meta; 18 + inherit src meta passthru; 8 19 name = "gup-${version}"; 9 - buildInputs = lib.remove null [ python which pychecker ]; 10 - SKIP_PYCHECKER = pychecker == null; 20 + buildInputs = [ pythonPackages.python ] 21 + ++ (lib.optionals enableTests testInputs) 22 + ++ (lib.optional usePychecker pychecker) 23 + ; 24 + SKIP_PYCHECKER = !usePychecker; 11 25 buildPhase = "make python"; 26 + inherit pychecker; 27 + testPhase = if enableTests then "make test" else "true"; 12 28 installPhase = '' 13 29 mkdir $out 14 30 cp -r python/bin $out/bin
+6
pkgs/development/tools/build-managers/gup/build.nix.gup
··· 1 + #!/bin/bash 2 + set -eu 3 + if [ -n "${GUP_TARGET:-}" ]; then 4 + gup --always 5 + fi 6 + curl -LSs -o "$1" https://raw.githubusercontent.com/timbertson/gup/master/nix/gup-python.nix
+13 -13
pkgs/development/tools/build-managers/gup/default.nix
··· 1 - { stdenv, fetchFromGitHub, lib, python, which }: 2 - let 3 - version = "0.5.5"; 4 - src = fetchFromGitHub { 5 - sha256 = "12yv0j333z6jkaaal8my3jx3k4ml9hq8ldis5zfvr8179d4xah7q"; 6 - rev = "version-${version}"; 7 - repo = "gup"; 8 - owner = "timbertson"; 9 - }; 10 - in 1 + { stdenv, fetchFromGitHub, lib, pythonPackages, nix-update-source, curl }: 11 2 import ./build.nix 12 - { inherit stdenv lib python which; } 13 - { inherit src version; 3 + { inherit stdenv lib pythonPackages; } 4 + { inherit (nix-update-source.fetch ./src.json) src version; 14 5 meta = { 15 - inherit (src.meta) homepage; 6 + homepage = https://github.com/timbertson/gup/; 16 7 description = "A better make, inspired by djb's redo"; 17 8 license = stdenv.lib.licenses.lgpl2Plus; 18 9 maintainers = [ stdenv.lib.maintainers.timbertson ]; 19 10 platforms = stdenv.lib.platforms.all; 11 + }; 12 + passthru = { 13 + updateScript = '' 14 + set -e 15 + echo 16 + cd ${toString ./.} 17 + ${nix-update-source}/bin/nix-update-source --prompt version src.json 18 + ./build.nix.gup build.nix 19 + ''; 20 20 }; 21 21 }
+17
pkgs/development/tools/build-managers/gup/src.json
··· 1 + { 2 + "fetch": { 3 + "args": { 4 + "owner": "timbertson", 5 + "repo": "gup", 6 + "rev": "version-0.6.0", 7 + "sha256": "053xnx39jh9kn9l572z4k0q7bbxjpisf1fm9aq27ybj2ha1rh6wr" 8 + }, 9 + "fn": "fetchFromGitHub", 10 + "rev": "version-0.6.0", 11 + "version": "0.6.0" 12 + }, 13 + "owner": "timbertson", 14 + "repo": "gup", 15 + "rev": "version-{version}", 16 + "type": "fetchFromGitHub" 17 + }
+3 -3
pkgs/tools/package-management/nix-update-source/default.nix
··· 1 1 { lib, pkgs, fetchFromGitHub, python3Packages, nix-prefetch-scripts }: 2 2 python3Packages.buildPythonApplication rec { 3 - version = "0.2.1"; 3 + version = "0.2.2"; 4 4 name = "nix-update-source-${version}"; 5 5 src = fetchFromGitHub { 6 6 owner = "timbertson"; 7 7 repo = "nix-update-source"; 8 8 rev = "version-${version}"; 9 - sha256 = "1w3aj0kjp8zhxkzqxnm5srrsqsvrmxhn4sqkr4kjffh61jg8jq8a"; 9 + sha256 = "0liigkr37ib2xy269bcp53ivpir4mpg6lzwnfrsqc4kbkz3l16gg"; 10 10 }; 11 11 propagatedBuildInputs = [ nix-prefetch-scripts ]; 12 12 passthru = { ··· 20 20 fetchFn = builtins.getAttr json.fetch.fn fetchers; 21 21 src = fetchFn json.fetch.args; 22 22 in 23 - json // { inherit src; }; 23 + json // json.fetch // { inherit src; }; 24 24 }; 25 25 meta = { 26 26 description = "Utility to autimate updating of nix derivation sources";