Skip to content

Commit

Permalink
Merge pull request #137 from spmzt/ungoogled_chromium
Browse files Browse the repository at this point in the history
ungoogled-chromium support for FreeBSD (with updated PR126)
  • Loading branch information
dominikschulz authored Jan 10, 2025
2 parents daf788d + e35193f commit b312e6f
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ crosscompile:
@echo -n ">> CROSSCOMPILE darwin/amd64"
@GOOS=darwin GOARCH=amd64 $(GO) build -o $(GOPASS_OUTPUT)-darwin-amd64
@printf '%s\n' '$(OK)'
@echo -n ">> CROSSCOMPILE freebsd/amd64"
@GOOS=freebsd GOARCH=amd64 $(GO) build -o $(GOPASS_OUTPUT)-freebsd-amd64
@printf '%s\n' '$(OK)'
@echo -n ">> CROSSCOMPILE windows/amd64"
@GOOS=windows GOARCH=amd64 $(GO) build -o $(GOPASS_OUTPUT)-windows-amd64
@printf '%s\n' '$(OK)'
Expand Down
2 changes: 2 additions & 0 deletions internal/jsonapi/manifest/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ func renaderManifestContent(browser, wrapperPath string) ([]byte, error) {
fallthrough
case "chromium":
return newChromeManifest(wrapperPath).Format()
case "ungoogled-chromium":
return newChromeManifest(wrapperPath).Format()
default:
return nil, fmt.Errorf("no manifest template for browser %s", browser)
}
Expand Down
18 changes: 18 additions & 0 deletions internal/jsonapi/manifest/manifest_path_freebsd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package manifest

var manifestPaths = &manifestPath{
local: map[string]string{
"firefox": "~/.mozilla/native-messaging-hosts",
"chrome": "~/.config/google-chrome/NativeMessagingHosts",
"chromium": "~/.config/chromium/NativeMessagingHosts",
"ungoogled-chromium": "~/.config/ungoogled-chromium/NativeMessagingHosts",
"iridium": "~/.config/iridium/NativeMessagingHosts",
},
global: map[string]string{
"firefox": "/usr/local/lib/mozilla/native-messaging-hosts",
"chrome": "/usr/local/lib/chrome/native-messaging-hosts",
"chromium": "/usr/local/lib/chromium/native-messaging-hosts",
"ungoogled-chromium": "/usr/local/lib/ungoogled-chromium/native-messaging-hosts",
"iridium": "/usr/local/lib/iridium-browser/native-messaging-hosts",
},
}
4 changes: 2 additions & 2 deletions internal/jsonapi/manifest/manifest_path_others.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build !linux && !darwin
// +build !linux,!darwin
//go:build !linux && !darwin && !freebsd
// +build !linux,!darwin,!freebsd

package manifest

Expand Down
2 changes: 2 additions & 0 deletions internal/jsonapi/manifest/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ func TestValidBrowsers(t *testing.T) {
validBrowsers = []string{"chrome", "chromium", "firefox"}
case "linux": // Linux
validBrowsers = []string{"brave", "chrome", "chromium", "firefox", "iridium", "slimjet", "vivaldi"}
case "freebsd": // FreeBSD
validBrowsers = []string{"chrome", "chromium", "ungoogled-chromium", "firefox", "iridium"}
default: // Fallback, not suppoerted OS
t.Fatalf("Unsupported OS: %s", runtime.GOOS)
}
Expand Down

0 comments on commit b312e6f

Please sign in to comment.