Allow slashes in status-go branch names
Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
This commit is contained in:
parent
572e028f32
commit
68508a1500
|
@ -2,7 +2,7 @@
|
||||||
{ stdenv, utils, callPackage,
|
{ stdenv, utils, callPackage,
|
||||||
buildGoPackage, go, gomobile, openjdk, xcodeWrapper }:
|
buildGoPackage, go, gomobile, openjdk, xcodeWrapper }:
|
||||||
|
|
||||||
{ owner, repo, rev, version, goPackagePath, src, host,
|
{ owner, repo, rev, version, sanitizedVersion, goPackagePath, src, host,
|
||||||
|
|
||||||
# mobile-only arguments
|
# mobile-only arguments
|
||||||
goBuildFlags, goBuildLdFlags,
|
goBuildFlags, goBuildLdFlags,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{ buildGoPackage, go, xcodeWrapper, stdenv, utils }:
|
{ buildGoPackage, go, xcodeWrapper, stdenv, utils }:
|
||||||
|
|
||||||
{ owner, repo, rev, version, goPackagePath, src, host,
|
{ owner, repo, rev, version, sanitizedVersion, goPackagePath, src, host,
|
||||||
nativeBuildInputs ? [],
|
nativeBuildInputs ? [],
|
||||||
buildPhase, buildMessage,
|
buildPhase, buildMessage,
|
||||||
installPhase ? "",
|
installPhase ? "",
|
||||||
|
@ -19,7 +19,7 @@ let
|
||||||
args = removeAttrs args' [ "buildMessage" ]; # Remove our arguments from args before passing them on to buildGoPackage
|
args = removeAttrs args' [ "buildMessage" ]; # Remove our arguments from args before passing them on to buildGoPackage
|
||||||
buildStatusGo = buildGoPackage (args // {
|
buildStatusGo = buildGoPackage (args // {
|
||||||
pname = repo;
|
pname = repo;
|
||||||
version = "${version}-${strings.substring 0 7 rev}-${host}";
|
version = "${sanitizedVersion}-${strings.substring 0 7 rev}-${host}";
|
||||||
|
|
||||||
nativeBuildInputs =
|
nativeBuildInputs =
|
||||||
nativeBuildInputs ++
|
nativeBuildInputs ++
|
||||||
|
@ -58,7 +58,7 @@ let
|
||||||
return # make sure we stop fixup so as to not allow the host preFixup script to proceed
|
return # make sure we stop fixup so as to not allow the host preFixup script to proceed
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru = { inherit owner version rev; };
|
passthru = { inherit owner repo version rev; };
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
# Add default meta information
|
# Add default meta information
|
||||||
|
|
|
@ -43,13 +43,17 @@ let
|
||||||
versionJSON = importJSON ../../status-go-version.json; # TODO: Simplify this path search with lib.locateDominatingFile
|
versionJSON = importJSON ../../status-go-version.json; # TODO: Simplify this path search with lib.locateDominatingFile
|
||||||
versionRegex = "^v?[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+(-[[:alnum:].]+)$";
|
versionRegex = "^v?[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+(-[[:alnum:].]+)$";
|
||||||
sha256 = versionJSON.src-sha256;
|
sha256 = versionJSON.src-sha256;
|
||||||
|
sanitizeVersion = builtins.replaceStrings
|
||||||
|
[ "/" ]
|
||||||
|
[ "_" ];
|
||||||
in rec {
|
in rec {
|
||||||
inherit (versionJSON) owner repo version;
|
inherit (versionJSON) owner repo version;
|
||||||
|
sanitizedVersion = sanitizeVersion versionJSON.version;
|
||||||
goPackagePath = "github.com/${owner}/${repo}";
|
goPackagePath = "github.com/${owner}/${repo}";
|
||||||
rev = versionJSON.commit-sha1;
|
rev = versionJSON.commit-sha1;
|
||||||
shortRev = strings.substring 0 7 rev;
|
shortRev = strings.substring 0 7 rev;
|
||||||
versionName = if (builtins.match versionRegex version) != null
|
versionName = if (builtins.match versionRegex sanitizedVersion) != null
|
||||||
then removePrefix "v" version # Geth forces a 'v' prefix
|
then removePrefix "v" sanitizedVersion # Geth forces a 'v' prefix
|
||||||
else "develop"; # to reduce metrics cardinality in Prometheus
|
else "develop"; # to reduce metrics cardinality in Prometheus
|
||||||
src = fetchFromGitHub { inherit rev owner repo sha256; name = "${repo}-${srcData.shortRev}-source"; };
|
src = fetchFromGitHub { inherit rev owner repo sha256; name = "${repo}-${srcData.shortRev}-source"; };
|
||||||
};
|
};
|
||||||
|
@ -100,7 +104,7 @@ let
|
||||||
"-w" # -w disables DWARF debugging information
|
"-w" # -w disables DWARF debugging information
|
||||||
];
|
];
|
||||||
|
|
||||||
statusGoArgs = { inherit (srcData) src owner repo rev version goPackagePath; inherit goBuildFlags goBuildLdFlags; };
|
statusGoArgs = { inherit (srcData) src owner repo rev version sanitizedVersion goPackagePath; inherit goBuildFlags goBuildLdFlags; };
|
||||||
status-go-packages = {
|
status-go-packages = {
|
||||||
desktop = buildStatusGoDesktopLib (statusGoArgs // {
|
desktop = buildStatusGoDesktopLib (statusGoArgs // {
|
||||||
outputFileName = "libstatus.a";
|
outputFileName = "libstatus.a";
|
||||||
|
|
Loading…
Reference in New Issue