2021-01-17 02:09:27 +00:00
|
|
|
{ lib, buildGoPackage, fetchFromGitHub, go-bindata, pkg-config, makeWrapper
|
2018-11-16 22:18:51 +00:00
|
|
|
, glib, gtk3, libappindicator-gtk3, gpgme, openshift, ostree, libselinux, btrfs-progs
|
2018-10-19 22:26:36 +01:00
|
|
|
, lvm2, docker-machine-kvm
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2020-10-25 21:34:38 +00:00
|
|
|
version = "1.34.3";
|
2018-10-19 22:26:36 +01:00
|
|
|
|
|
|
|
# Update these on version bumps according to Makefile
|
2020-10-25 21:34:38 +00:00
|
|
|
centOsIsoVersion = "v1.17.0";
|
2018-10-19 22:26:36 +01:00
|
|
|
openshiftVersion = "v3.11.0";
|
|
|
|
|
|
|
|
in buildGoPackage rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "minishift";
|
2018-10-19 22:26:36 +01:00
|
|
|
inherit version;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "minishift";
|
|
|
|
repo = "minishift";
|
|
|
|
rev = "v${version}";
|
2020-10-25 21:34:38 +00:00
|
|
|
sha256 = "0yhln3kyc0098hbnjyxhbd915g6j7s692c0z8yrhh9gdpc5cr2aa";
|
2018-10-19 22:26:36 +01:00
|
|
|
};
|
|
|
|
|
2021-01-17 02:09:27 +00:00
|
|
|
nativeBuildInputs = [ pkg-config go-bindata makeWrapper ];
|
2018-10-19 22:26:36 +01:00
|
|
|
buildInputs = [ glib gtk3 libappindicator-gtk3 gpgme ostree libselinux btrfs-progs lvm2 ];
|
|
|
|
|
|
|
|
goPackagePath = "github.com/minishift/minishift";
|
|
|
|
subPackages = [ "cmd/minishift" ];
|
|
|
|
|
|
|
|
postPatch = ''
|
2018-11-16 22:18:51 +00:00
|
|
|
# minishift downloads openshift if not found therefore set the cache to /nix/store/...
|
|
|
|
substituteInPlace pkg/minishift/cache/oc_caching.go \
|
|
|
|
--replace 'filepath.Join(oc.MinishiftCacheDir, OC_CACHE_DIR, oc.OpenShiftVersion, runtime.GOOS)' '"${openshift}/bin"' \
|
|
|
|
--replace '"runtime"' ""
|
2018-10-19 22:26:36 +01:00
|
|
|
'';
|
|
|
|
|
2021-08-26 04:31:57 +01:00
|
|
|
ldflags = [
|
|
|
|
"-X ${goPackagePath}/pkg/version.minishiftVersion=${version}"
|
|
|
|
"-X ${goPackagePath}/pkg/version.centOsIsoVersion=${centOsIsoVersion}"
|
|
|
|
"-X ${goPackagePath}/pkg/version.openshiftVersion=${openshiftVersion}"
|
|
|
|
];
|
2018-10-19 22:26:36 +01:00
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
(cd go/src/github.com/minishift/minishift
|
|
|
|
mkdir -p out/bindata
|
|
|
|
go-bindata -prefix addons -o out/bindata/addon_assets.go -pkg bindata addons/...)
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
2020-04-28 02:50:57 +01:00
|
|
|
wrapProgram "$out/bin/minishift" \
|
2018-11-16 22:18:51 +00:00
|
|
|
--prefix PATH ':' '${lib.makeBinPath [ docker-machine-kvm openshift ]}'
|
2018-10-19 22:26:36 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Run OpenShift locally";
|
|
|
|
longDescription = ''
|
|
|
|
Minishift is a tool that helps you run OpenShift locally by running
|
|
|
|
a single-node OpenShift cluster inside a VM. You can try out OpenShift
|
|
|
|
or develop with it, day-to-day, on your local host.
|
|
|
|
'';
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/minishift/minishift";
|
2018-12-24 10:08:52 +00:00
|
|
|
maintainers = with maintainers; [ fpletz vdemeester ];
|
2018-10-19 22:26:36 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.asl20;
|
|
|
|
};
|
|
|
|
}
|