From b984d5d25f3c5f4d8c700f3c5e0b41bd48cfcb79 Mon Sep 17 00:00:00 2001 From: Tim Cuthbertson Date: Wed, 25 Jan 2017 22:23:52 +1100 Subject: [PATCH 1/2] nix-update-source: 0.2.1 -> 0.2.2 --- pkgs/tools/package-management/nix-update-source/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/package-management/nix-update-source/default.nix b/pkgs/tools/package-management/nix-update-source/default.nix index 06ac8203f822..08b5dcb319ca 100644 --- a/pkgs/tools/package-management/nix-update-source/default.nix +++ b/pkgs/tools/package-management/nix-update-source/default.nix @@ -1,12 +1,12 @@ { lib, pkgs, fetchFromGitHub, python3Packages, nix-prefetch-scripts }: python3Packages.buildPythonApplication rec { - version = "0.2.1"; + version = "0.2.2"; name = "nix-update-source-${version}"; src = fetchFromGitHub { owner = "timbertson"; repo = "nix-update-source"; rev = "version-${version}"; - sha256 = "1w3aj0kjp8zhxkzqxnm5srrsqsvrmxhn4sqkr4kjffh61jg8jq8a"; + sha256 = "0liigkr37ib2xy269bcp53ivpir4mpg6lzwnfrsqc4kbkz3l16gg"; }; propagatedBuildInputs = [ nix-prefetch-scripts ]; passthru = { @@ -20,7 +20,7 @@ python3Packages.buildPythonApplication rec { fetchFn = builtins.getAttr json.fetch.fn fetchers; src = fetchFn json.fetch.args; in - json // { inherit src; }; + json // json.fetch // { inherit src; }; }; meta = { description = "Utility to autimate updating of nix derivation sources"; From a59c3038cd26863ab0eb90aad813440dfec1a59e Mon Sep 17 00:00:00 2001 From: Tim Cuthbertson Date: Wed, 25 Jan 2017 22:25:14 +1100 Subject: [PATCH 2/2] gup: 0.5.5 -> 0.6.0 and derivation update --- .../tools/build-managers/gup/build.nix | 30 ++++++++++++++----- .../tools/build-managers/gup/build.nix.gup | 6 ++++ .../tools/build-managers/gup/default.nix | 26 ++++++++-------- .../tools/build-managers/gup/src.json | 17 +++++++++++ 4 files changed, 59 insertions(+), 20 deletions(-) create mode 100755 pkgs/development/tools/build-managers/gup/build.nix.gup create mode 100644 pkgs/development/tools/build-managers/gup/src.json diff --git a/pkgs/development/tools/build-managers/gup/build.nix b/pkgs/development/tools/build-managers/gup/build.nix index a9af037bb81e..b2a60c309b32 100644 --- a/pkgs/development/tools/build-managers/gup/build.nix +++ b/pkgs/development/tools/build-managers/gup/build.nix @@ -1,14 +1,30 @@ -# NOTE: this file is copied from the upstream repository for this package. -# Please submit any changes you make here to https://github.com/timbertson/gup/ +# NOTE: the `nixpkgs` version of this file is copied from the upstream repository +# for this package. Please make any changes to https://github.com/timbertson/gup/ -{ stdenv, lib, python, which, pychecker ? null }: -{ src, version, meta ? {} }: +{ stdenv, lib, pythonPackages }: +{ src, version, meta ? {}, passthru ? {}, forceTests ? false }: +let + testInputs = [ + pythonPackages.mocktest or null + pythonPackages.whichcraft + pythonPackages.nose + pythonPackages.nose_progressive + ]; + pychecker = pythonPackages.pychecker or null; + usePychecker = forceTests || pychecker != null; + enableTests = forceTests || (lib.all (dep: dep != null) testInputs); +in stdenv.mkDerivation { - inherit src meta; + inherit src meta passthru; name = "gup-${version}"; - buildInputs = lib.remove null [ python which pychecker ]; - SKIP_PYCHECKER = pychecker == null; + buildInputs = [ pythonPackages.python ] + ++ (lib.optionals enableTests testInputs) + ++ (lib.optional usePychecker pychecker) + ; + SKIP_PYCHECKER = !usePychecker; buildPhase = "make python"; + inherit pychecker; + testPhase = if enableTests then "make test" else "true"; installPhase = '' mkdir $out cp -r python/bin $out/bin diff --git a/pkgs/development/tools/build-managers/gup/build.nix.gup b/pkgs/development/tools/build-managers/gup/build.nix.gup new file mode 100755 index 000000000000..915d4287566a --- /dev/null +++ b/pkgs/development/tools/build-managers/gup/build.nix.gup @@ -0,0 +1,6 @@ +#!/bin/bash +set -eu +if [ -n "${GUP_TARGET:-}" ]; then + gup --always +fi +curl -LSs -o "$1" https://raw.githubusercontent.com/timbertson/gup/master/nix/gup-python.nix diff --git a/pkgs/development/tools/build-managers/gup/default.nix b/pkgs/development/tools/build-managers/gup/default.nix index 8e85c63cb6e5..e73beb031645 100644 --- a/pkgs/development/tools/build-managers/gup/default.nix +++ b/pkgs/development/tools/build-managers/gup/default.nix @@ -1,21 +1,21 @@ -{ stdenv, fetchFromGitHub, lib, python, which }: -let - version = "0.5.5"; - src = fetchFromGitHub { - sha256 = "12yv0j333z6jkaaal8my3jx3k4ml9hq8ldis5zfvr8179d4xah7q"; - rev = "version-${version}"; - repo = "gup"; - owner = "timbertson"; - }; -in +{ stdenv, fetchFromGitHub, lib, pythonPackages, nix-update-source, curl }: import ./build.nix - { inherit stdenv lib python which; } - { inherit src version; + { inherit stdenv lib pythonPackages; } + { inherit (nix-update-source.fetch ./src.json) src version; meta = { - inherit (src.meta) homepage; + homepage = https://github.com/timbertson/gup/; description = "A better make, inspired by djb's redo"; license = stdenv.lib.licenses.lgpl2Plus; maintainers = [ stdenv.lib.maintainers.timbertson ]; platforms = stdenv.lib.platforms.all; }; + passthru = { + updateScript = '' + set -e + echo + cd ${toString ./.} + ${nix-update-source}/bin/nix-update-source --prompt version src.json + ./build.nix.gup build.nix + ''; + }; } diff --git a/pkgs/development/tools/build-managers/gup/src.json b/pkgs/development/tools/build-managers/gup/src.json new file mode 100644 index 000000000000..6b9719a30762 --- /dev/null +++ b/pkgs/development/tools/build-managers/gup/src.json @@ -0,0 +1,17 @@ +{ + "fetch": { + "args": { + "owner": "timbertson", + "repo": "gup", + "rev": "version-0.6.0", + "sha256": "053xnx39jh9kn9l572z4k0q7bbxjpisf1fm9aq27ybj2ha1rh6wr" + }, + "fn": "fetchFromGitHub", + "rev": "version-0.6.0", + "version": "0.6.0" + }, + "owner": "timbertson", + "repo": "gup", + "rev": "version-{version}", + "type": "fetchFromGitHub" +} \ No newline at end of file