From d04389aeb29f1074b68a16cbf0f99efc7a298367 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Tue, 30 Mar 2021 17:16:22 +0200 Subject: [PATCH] drone: add option to build oss edition By default drone is distributed under an unfree license that only permits non-commercial or evaluation use. To build the OSS edition, two tags have to be passed as build flags. This commit adds an option to build the OSS edition to the package and defines drone-oss as an alias for this. --- .../tools/continuous-integration/drone/default.nix | 11 ++++++++--- pkgs/top-level/all-packages.nix | 3 +++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/continuous-integration/drone/default.nix b/pkgs/development/tools/continuous-integration/drone/default.nix index c6d609e38cf1..a2bc47b6408b 100644 --- a/pkgs/development/tools/continuous-integration/drone/default.nix +++ b/pkgs/development/tools/continuous-integration/drone/default.nix @@ -1,7 +1,8 @@ -{ lib, fetchFromGitHub, buildGoModule }: +{ lib, fetchFromGitHub, buildGoModule +, enableUnfree ? true }: buildGoModule rec { - name = "drone.io-${version}"; + pname = "drone.io${lib.optionalString (!enableUnfree) "-oss"}"; version = "1.10.0"; vendorSha256 = "sha256-cKHX/GnvGELQBfoo0/1UmDQ4Z66GGnnHG7+1CzjinL0="; @@ -15,9 +16,13 @@ buildGoModule rec { sha256 = "sha256-12Jac+mXWdUX8gWvmpdO9ROv7Bi0YzvyqnNDVNJOr34="; }; + preBuild = '' + buildFlagsArray+=( "-tags" "${lib.optionalString (!enableUnfree) "oss nolimit"}" ) + ''; + meta = with lib; { maintainers = with maintainers; [ elohmeier vdemeester ]; - license = licenses.asl20; + license = with licenses; if enableUnfree then unfreeRedistributable else asl20; description = "Continuous Integration platform built on container technology"; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2d1e74fedc63..dbdc7ff4e0b0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3869,6 +3869,9 @@ in }; drone = callPackage ../development/tools/continuous-integration/drone { }; + drone-oss = callPackage ../development/tools/continuous-integration/drone { + enableUnfree = false; + }; drone-cli = callPackage ../development/tools/continuous-integration/drone-cli { };