nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at netboot-syslinux-multiplatform 51 lines 1.4 kB view raw
1{ buildGoModule, fetchFromGitHub, lib, installShellFiles, testers, cue }: 2 3buildGoModule rec { 4 pname = "cue"; 5 version = "0.5.0"; 6 7 src = fetchFromGitHub { 8 owner = "cue-lang"; 9 repo = "cue"; 10 rev = "v${version}"; 11 hash = "sha256-4E50VrekIkVXhzHVNehgm6/DbkofvqlNSgX9oK9SLu4="; 12 }; 13 14 postPatch = '' 15 # Disable script tests 16 rm -f cmd/cue/cmd/script_test.go 17 ''; 18 19 vendorHash = "sha256-0N0bZdimGHu3vkLe+eGKBTm/YeSQOnp+Pxhz3LVniTk="; 20 21 excludedPackages = [ "internal/ci/updatetxtar" "internal/cmd/embedpkg" "internal/cmd/qgo" "pkg/gen" ]; 22 23 nativeBuildInputs = [ installShellFiles ]; 24 25 ldflags = [ "-s" "-w" "-X cuelang.org/go/cmd/cue/cmd.version=${version}" ]; 26 27 postInstall = '' 28 # Completions 29 installShellCompletion --cmd cue \ 30 --bash <($out/bin/cue completion bash) \ 31 --fish <($out/bin/cue completion fish) \ 32 --zsh <($out/bin/cue completion zsh) 33 ''; 34 35 doInstallCheck = true; 36 installCheckPhase = '' 37 $out/bin/cue eval - <<<'a: "all good"' > /dev/null 38 ''; 39 40 passthru.tests.version = testers.testVersion { 41 package = cue; 42 command = "cue version"; 43 }; 44 45 meta = with lib; { 46 description = "A data constraint language which aims to simplify tasks involving defining and using data"; 47 homepage = "https://cuelang.org/"; 48 license = lib.licenses.asl20; 49 maintainers = with maintainers; [ aaronjheng ]; 50 }; 51}