git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #39324 from timbertson/gup

gup: simplify build expression

commit0589b4aac5102240eb36ed23ba765d6ef34f79a5 authorJörg Thalheim <Mic92@users.noreply.github.com> dateSun 22 Apr 2018, 12:55 (9 years ago) parent180cf91ad5b090
2 files changed+34−33
pkgs/development/tools/build-managers/gup/build.nix−16 pkgs/development/tools/build-managers/gup/default.nix+34−17
pkgs/development/tools/build-managers/gup/build.nixdeleted−16
@@ -1,16 +0,0 @@
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/
3−
4−{ stdenv, lib, python, which, pychecker ? null }:
5−{ src, version, meta ? {} }:
6−stdenv.mkDerivation {
7− inherit src meta;
8− name = "gup-${version}";
9− buildInputs = lib.remove null [ python which pychecker ];
10− SKIP_PYCHECKER = pychecker == null;
11− buildPhase = "make python";
12− installPhase = ''
13− mkdir $out
14− cp -r python/bin $out/bin
15− '';
16−}
pkgs/development/tools/build-managers/gup/default.nix+34−17
@@ -1,21 +1,38 @@
1−{ stdenv, fetchFromGitHub, lib, python, which }:
2−let
1+{ stdenv, fetchFromGitHub, nix-update-source, lib, python, which, pychecker ? null }:
2+stdenv.mkDerivation rec {
33 version = "0.7.0";
44 src = fetchFromGitHub {
5− sha256 = "1pwnmlq2pgkkln9sgz4wlb9dqlqw83bkf105qljnlvggc21zm3pv";
6− rev = "version-${version}";
7− repo = "gup";
85 owner = "timbertson";
6+ repo = "gup";
7+ rev = "version-0.7.0";
8+ sha256 = "1pwnmlq2pgkkln9sgz4wlb9dqlqw83bkf105qljnlvggc21zm3pv";
9+ };
10+ name = "gup-${version}";
11+ buildInputs = lib.remove null [ python which pychecker ];
12+ SKIP_PYCHECKER = pychecker == null;
13+ buildPhase = "make python";
14+ installPhase = ''
15+ mkdir $out
16+ cp -r python/bin $out/bin
17+ '';
18+ passthru.updateScript = ''
19+ set -e
20+ echo
21+ cd ${toString ./.}
22+ ${nix-update-source}/bin/nix-update-source \
23+ --prompt version \
24+ --replace-attr version \
25+ --set owner timbertson \
26+ --set repo gup \
27+ --set type fetchFromGitHub \
28+ --set rev 'version-{version}' \
29+ --modify-nix default.nix
30+ '';
31+ meta = {
32+ inherit (src.meta) homepage;
33+ description = "A better make, inspired by djb's redo";
34+ license = stdenv.lib.licenses.lgpl2Plus;
35+ maintainers = [ stdenv.lib.maintainers.timbertson ];
36+ platforms = stdenv.lib.platforms.all;
937 };
10−in
11−import ./build.nix
12− { inherit stdenv lib python which; }
13− { inherit src version;
14− meta = {
15− inherit (src.meta) homepage;
16− description = "A better make, inspired by djb's redo";
17− license = stdenv.lib.licenses.lgpl2Plus;
18− maintainers = [ stdenv.lib.maintainers.timbertson ];
19− platforms = stdenv.lib.platforms.all;
20− };
21− }
38+}