diff --git a/pkgs/development/tools/asmfmt/default.nix b/pkgs/development/tools/asmfmt/default.nix new file mode 100644 index 00000000000..d2cb7e807b5 --- /dev/null +++ b/pkgs/development/tools/asmfmt/default.nix @@ -0,0 +1,37 @@ +{ buildGoPackage +, lib +, fetchFromGitHub +, fetchpatch +}: + +buildGoPackage rec { + name = "asmfmt-${version}"; + version = "1.1"; + + goPackagePath = "github.com/klauspost/asmfmt"; + + src = fetchFromGitHub { + owner = "klauspost"; + repo = "asmfmt"; + rev = "v${version}"; + sha256 = "08mybfizcvck460axakycz9ndzcgwqilp5mmgm4bl8hfrn36mskw"; + }; + + patches = [ + (fetchpatch { + excludes = ["README.md"]; + url = "https://github.com/klauspost/asmfmt/commit/39a37c8aed8095e0fdfb07f78fc8acbd465d9627.patch"; + sha256 = "18bc77l87mf0yvqc3adlakxz6wflyqfsc2wrmh9q0nlqghlmnw5k"; + }) + ]; + + goDeps = ./deps.nix; + + meta = with lib; { + description = "Go Assembler Formatter"; + homepage = https://github.com/klauspost/asmfmt; + license = licenses.mit; + maintainers = with maintainers; [ kalbasit ]; + platforms = platforms.linux ++ platforms.darwin; + }; +} diff --git a/pkgs/development/tools/asmfmt/deps.nix b/pkgs/development/tools/asmfmt/deps.nix new file mode 100644 index 00000000000..0288fc206d4 --- /dev/null +++ b/pkgs/development/tools/asmfmt/deps.nix @@ -0,0 +1,20 @@ +[ + { + goPackagePath = "golang.org/x/tools"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/tools"; + rev = "3a10b9bf0a52df7e992a8c3eb712a86d3c896c75"; + sha256 = "19f3dijcc54jnd7458jab2dgpd0gzccmv2qympd9wi8cc8jpnhws"; + }; + } + { + goPackagePath = "sourcegraph.com/sqs/goreturns"; + fetch = { + type = "git"; + url = "https://github.com/sqs/goreturns"; + rev = "538ac601451833c7c4449f8431d65d53c1c60e41"; + sha256 = "0gcplch8zmcgwl6xvcffxg50g3xnf60n7dlqxgn51179qcjr354p"; + }; + } +] diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 62cef2d5068..9ee9fc5ccd2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -801,6 +801,8 @@ with pkgs; }; aria = aria2; + asmfmt = callPackage ../development/tools/asmfmt { }; + aspcud = callPackage ../tools/misc/aspcud { }; at = callPackage ../tools/system/at { };