Skip to content

Commit 175ecba

Browse files
committedMay 26, 2017
gitRepo: Improve the packaging
Improvements: - Use a versioned URL - The build won't break anymore (due to a wrong hash) after a new version is being released - It will be possible to build older versions - Add (hopefully all) runtime dependencies (Git, GnuPG and less (for "repo help")) - Add the upstream license - Add a long description - Use the name of the Git tag for the version - The version number from the script (currently 1.23) is only incremented after "important" changes (i.e. there are slightly different different scripts with "VERSION = (1, 23)")
1 parent 00672de commit 175ecba

File tree

1 file changed

+31
-14
lines changed
  • pkgs/applications/version-management/git-repo

1 file changed

+31
-14
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,41 @@
1-
{ stdenv, fetchurl, python }:
1+
{ stdenv, fetchFromGitHub, makeWrapper
2+
, python, git, gnupg1compat, less }:
23

3-
stdenv.mkDerivation {
4-
name = "git-repo-1.23";
5-
src = fetchurl {
6-
# I could not find a versioned url for the 1.21 version. In case
7-
# the sha mismatches, check the homepage for new version and sha.
8-
url = "http://commondatastorage.googleapis.com/git-repo-downloads/repo";
9-
sha256 = "1i8xymxh630a7d5nkqi49nmlwk77dqn36vsygpyhri464qwz0iz1";
4+
stdenv.mkDerivation rec {
5+
name = "git-repo-${version}";
6+
version = "1.12.37";
7+
8+
src = fetchFromGitHub {
9+
owner = "android";
10+
repo = "tools_repo";
11+
rev = "v${version}";
12+
sha256 = "0qp7jqhblv7xblfgpcq4n18dyjdv8shz7r60c3vnjxx2fngkj2jd";
1013
};
1114

12-
unpackPhase = "true";
15+
nativeBuildInputs = [ makeWrapper ];
16+
buildInputs = [ python git gnupg1compat less ];
17+
1318
installPhase = ''
1419
mkdir -p $out/bin
15-
sed -e 's,!/usr/bin/env python,!${python}/bin/python,' < $src > $out/bin/repo
16-
chmod +x $out/bin/repo
20+
cp $src/repo $out/bin/repo
21+
'';
22+
23+
postFixup = ''
24+
wrapProgram $out/bin/repo --prefix PATH ":" \
25+
"${stdenv.lib.makeBinPath [ git gnupg1compat less ]}"
1726
'';
1827

19-
meta = {
20-
homepage = "http://source.android.com/source/downloading.html";
28+
meta = with stdenv.lib; {
2129
description = "Android's repo management tool";
22-
platforms = stdenv.lib.platforms.unix;
30+
longDescription = ''
31+
Repo is a Python script based on Git that helps manage many Git
32+
repositories, does the uploads to revision control systems, and automates
33+
parts of the development workflow. Repo is not meant to replace Git, only
34+
to make it easier to work with Git.
35+
'';
36+
homepage = "https://android.googlesource.com/tools/repo";
37+
license = licenses.asl20;
38+
maintainers = [ maintainers.primeos ];
39+
platforms = platforms.unix;
2340
};
2441
}

0 commit comments

Comments
 (0)
Please sign in to comment.