| 6 | ) |
| 7 | |
| 8 | func patchCmd() *cobra.Command { |
| 9 | builder := &patchpkg.DerivationBuilder{} |
| 10 | cmd := &cobra.Command{ |
| 11 | Use: "patch <store-path>", |
| 12 | Short: "Apply Devbox patches to a package to fix common linker errors", |
| 13 | Args: cobra.ExactArgs(1), |
| 14 | Hidden: true, |
| 15 | RunE: func(cmd *cobra.Command, args []string) error { |
| 16 | return builder.Build(cmd.Context(), args[0]) |
| 17 | }, |
| 18 | } |
| 19 | cmd.Flags().StringVar(&builder.Glibc, "glibc", "", "patch binaries to use a different glibc") |
| 20 | cmd.Flags().StringVar(&builder.Gcc, "gcc", "", "patch binaries to use a different gcc") |
| 21 | cmd.Flags().BoolVar(&builder.RestoreRefs, "restore-refs", false, "restore references to removed store paths") |
| 22 | return cmd |
| 23 | } |