mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-25 03:17:13 +00:00
dadc7eb329
Whenever we create scripts that are installed to $out, we must use runtimeShell in order to get the shell that can be executed on the machine we create the package for. This is relevant for cross-compiling. The only use case for stdenv.shell are scripts that are executed as part of the build system. Usages in checkPhase are borderline however to decrease the likelyhood of people copying the wrong examples, I decided to use runtimeShell as well.
41 lines
1.1 KiB
Nix
41 lines
1.1 KiB
Nix
{ stdenv, fetchFromGitHub, nix-update-source, lib, python
|
|
, which, runtimeShell, pychecker ? null }:
|
|
stdenv.mkDerivation rec {
|
|
version = "0.7.0";
|
|
src = fetchFromGitHub {
|
|
owner = "timbertson";
|
|
repo = "gup";
|
|
rev = "version-0.7.0";
|
|
sha256 = "1pwnmlq2pgkkln9sgz4wlb9dqlqw83bkf105qljnlvggc21zm3pv";
|
|
};
|
|
name = "gup-${version}";
|
|
buildInputs = lib.remove null [ python which pychecker ];
|
|
SKIP_PYCHECKER = pychecker == null;
|
|
buildPhase = "make python";
|
|
installPhase = ''
|
|
mkdir $out
|
|
cp -r python/bin $out/bin
|
|
'';
|
|
passthru.updateScript = ''
|
|
#!${runtimeShell}
|
|
set -e
|
|
echo
|
|
cd ${toString ./.}
|
|
${nix-update-source}/bin/nix-update-source \
|
|
--prompt version \
|
|
--replace-attr version \
|
|
--set owner timbertson \
|
|
--set repo gup \
|
|
--set type fetchFromGitHub \
|
|
--set rev 'version-{version}' \
|
|
--modify-nix default.nix
|
|
'';
|
|
meta = {
|
|
inherit (src.meta) homepage;
|
|
description = "A better make, inspired by djb's redo";
|
|
license = stdenv.lib.licenses.lgpl2Plus;
|
|
maintainers = [ stdenv.lib.maintainers.timbertson ];
|
|
platforms = stdenv.lib.platforms.all;
|
|
};
|
|
}
|