dq: 20241027 -> 20250201 (#377180)
[NixPkgs.git] / pkgs / by-name / ga / garble / package.nix
blob4a1c2e93fced84ac181ae140c50d37dfe232042d
2   lib,
3   stdenv,
4   buildGoModule,
5   fetchFromGitHub,
6   diffoscope,
7   git,
8   versionCheckHook,
9   replaceVars,
10   nix-update-script,
13 buildGoModule rec {
14   pname = "garble";
15   version = "0.13.0";
17   src = fetchFromGitHub {
18     owner = "burrowers";
19     repo = "garble";
20     tag = "v${version}";
21     hash = "sha256-FtI5lAeqjRPN47iC46bcEsRLQb7mItw4svsnLkRpNxY=";
22   };
24   __darwinAllowLocalNetworking = true;
26   ldflags = [
27     "-buildid=00000000000000000000" # length=20
28   ];
30   patches = [
31     (replaceVars ./0001-Add-version-info.patch {
32       inherit version;
33     })
34   ];
36   checkFlags = [
37     "-skip"
38     "TestScript/gogarble"
39   ];
41   vendorHash = "sha256-mSdajYiMEg2ik0ocfmHK+XddEss1qLu6rDwzjocaaW0=";
43   # Used for some of the tests.
44   nativeCheckInputs = [
45     diffoscope
46     git
47     versionCheckHook
48   ];
50   preCheck = ''
51     export HOME=$(mktemp -d)
52     export WORK=$(mktemp -d)
53   '';
55   # Several tests fail with
56   # FAIL: testdata/script/goenv.txtar:27: "$WORK/.temp 'quotes' and spaces" matches "garble|importcfg|cache\\.gob|\\.go"
57   doCheck = !stdenv.hostPlatform.isDarwin;
59   nativeInstallCheckInputs = [
60     versionCheckHook
61   ];
62   versionCheckProgramArg = [ "version" ];
63   doInstallCheck = false;
65   passthru.updateScript = nix-update-script { };
67   meta = {
68     description = "Obfuscate Go code by wrapping the Go toolchain";
69     homepage = "https://github.com/burrowers/garble/";
70     maintainers = with lib.maintainers; [
71       davhau
72       bot-wxt1221
73     ];
74     license = lib.licenses.bsd3;
75     mainProgram = "garble";
76   };