Skip to content

Commit

Permalink
feat: support openbsd (#808)
Browse files Browse the repository at this point in the history
* feat: support openbsd

* fix: support updater on openbsd
  • Loading branch information
mrexox authored Aug 16, 2024
1 parent 302f67a commit 1aa06dc
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ builds:
- darwin
- windows
- freebsd
- openbsd
goarch:
- amd64
- arm64
Expand All @@ -26,6 +27,8 @@ builds:
goarch: 386
- goos: freebsd
goarch: 386
- goos: openbsd
goarch: 386
flags:
- -trimpath
ldflags:
Expand All @@ -40,6 +43,7 @@ builds:
- darwin
- windows
- freebsd
- openbsd
goarch:
- amd64
- arm64
Expand All @@ -51,6 +55,8 @@ builds:
goarch: 386
- goos: freebsd
goarch: 386
- goos: openbsd
goarch: 386
flags:
- -trimpath
ldflags:
Expand Down
1 change: 1 addition & 0 deletions internal/updater/updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ var (
"darwin": "MacOS",
"linux": "Linux",
"freebsd": "Freebsd",
"openbsd": "Openbsd",
}

archNames = map[string]string{
Expand Down
22 changes: 22 additions & 0 deletions packaging/npm/lefthook-openbsd-arm64/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "lefthook-openbsd-arm64",
"version": "1.7.12",
"description": "The OpenBSD ARM 64-bit binary for lefthook, git hooks manager.",
"preferUnplugged": false,
"repository": {
"type": "git",
"url": "git+https://github.com/evilmartians/lefthook.git"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/evilmartians/lefthook/issues",
"email": "lefthook@evilmartians.com"
},
"homepage": "https://github.com/evilmartians/lefthook#readme",
"os": [
"openbsd"
],
"cpu": [
"arm64"
]
}
22 changes: 22 additions & 0 deletions packaging/npm/lefthook-openbsd-x64/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "lefthook-openbsd-x64",
"version": "1.7.12",
"description": "The OpenBSD 64-bit binary for lefthook, git hooks manager.",
"preferUnplugged": false,
"repository": {
"type": "git",
"url": "git+https://github.com/evilmartians/lefthook.git"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/evilmartians/lefthook/issues",
"email": "lefthook@evilmartians.com"
},
"homepage": "https://github.com/evilmartians/lefthook#readme",
"os": [
"openbsd"
],
"cpu": [
"x64"
]
}
6 changes: 6 additions & 0 deletions packaging/pack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ def put_binaries
"#{DIST}/no_self_update_linux_arm64/lefthook" => "npm/lefthook-linux-arm64/bin/lefthook",
"#{DIST}/no_self_update_freebsd_amd64_v1/lefthook" => "npm/lefthook-freebsd-x64/bin/lefthook",
"#{DIST}/no_self_update_freebsd_arm64/lefthook" => "npm/lefthook-freebsd-arm64/bin/lefthook",
"#{DIST}/no_self_update_openbsd_amd64_v1/lefthook" => "npm/lefthook-openbsd-x64/bin/lefthook",
"#{DIST}/no_self_update_openbsd_arm64/lefthook" => "npm/lefthook-openbsd-arm64/bin/lefthook",
"#{DIST}/no_self_update_windows_amd64_v1/lefthook.exe" => "npm/lefthook-windows-x64/bin/lefthook.exe",
"#{DIST}/no_self_update_windows_arm64/lefthook.exe" => "npm/lefthook-windows-arm64/bin/lefthook.exe",
"#{DIST}/no_self_update_darwin_amd64_v1/lefthook" => "npm/lefthook-darwin-x64/bin/lefthook",
Expand All @@ -72,6 +74,8 @@ def put_binaries
"#{DIST}/no_self_update_linux_arm64/lefthook" => "npm-bundled/bin/lefthook-linux-arm64/lefthook",
"#{DIST}/no_self_update_freebsd_amd64_v1/lefthook" => "npm-bundled/bin/lefthook-freebsd-x64/lefthook",
"#{DIST}/no_self_update_freebsd_arm64/lefthook" => "npm-bundled/bin/lefthook-freebsd-arm64/lefthook",
"#{DIST}/no_self_update_openbsd_amd64_v1/lefthook" => "npm-bundled/bin/lefthook-openbsd-x64/lefthook",
"#{DIST}/no_self_update_openbsd_arm64/lefthook" => "npm-bundled/bin/lefthook-openbsd-arm64/lefthook",
"#{DIST}/no_self_update_windows_amd64_v1/lefthook.exe" => "npm-bundled/bin/lefthook-windows-x64/lefthook.exe",
"#{DIST}/no_self_update_windows_arm64/lefthook.exe" => "npm-bundled/bin/lefthook-windows-arm64/lefthook.exe",
"#{DIST}/no_self_update_darwin_amd64_v1/lefthook" => "npm-bundled/bin/lefthook-darwin-x64/lefthook",
Expand All @@ -86,6 +90,8 @@ def put_binaries
"#{DIST}/no_self_update_linux_arm64/lefthook" => "rubygems/libexec/lefthook-linux-arm64/lefthook",
"#{DIST}/no_self_update_freebsd_amd64_v1/lefthook" => "rubygems/libexec/lefthook-freebsd-x64/lefthook",
"#{DIST}/no_self_update_freebsd_arm64/lefthook" => "rubygems/libexec/lefthook-freebsd-arm64/lefthook",
"#{DIST}/no_self_update_openbsd_amd64_v1/lefthook" => "rubygems/libexec/lefthook-openbsd-x64/lefthook",
"#{DIST}/no_self_update_openbsd_arm64/lefthook" => "rubygems/libexec/lefthook-openbsd-arm64/lefthook",
"#{DIST}/no_self_update_windows_amd64_v1/lefthook.exe" => "rubygems/libexec/lefthook-windows-x64/lefthook.exe",
"#{DIST}/no_self_update_windows_arm64/lefthook.exe" => "rubygems/libexec/lefthook-windows-arm64/lefthook.exe",
"#{DIST}/no_self_update_darwin_amd64_v1/lefthook" => "rubygems/libexec/lefthook-darwin-x64/lefthook",
Expand Down
1 change: 1 addition & 0 deletions packaging/rubygems/bin/lefthook
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ os =
when "mingw32" then "windows" # Windows with MINGW64 reports RUBY_PLATFORM as "x64-mingw32"
when "mingw" then "windows"
when "freebsd" then "freebsd"
when "openbsd" then "openbsd"
else raise "Unknown OS: #{platform.os}"
end

Expand Down

0 comments on commit 1aa06dc

Please sign in to comment.