Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installer_linux.sh: 他OSとの互換性向上 #401

Merged
merged 4 commits into from
Oct 28, 2021
Merged

installer_linux.sh: 他OSとの互換性向上 #401

merged 4 commits into from
Oct 28, 2021

Conversation

eggplants
Copy link
Contributor

@eggplants eggplants commented Oct 27, 2021

内容

sed-iを使用しない

installer_linux.shの300行目で上書き置換のためにsed -iを用いています。
しかし、MacやBSD系OSのsedはsed -iでバックアップファイル拡張子を要求するために、現状のinstaller_linux.shではエラーが起きます。
またPOSIX sedでは-i自体が無いためこれまたエラーが起きます。
なので、-iを使わない実装に変更しました。

libsndfileの存在確認方法

Macにはldconfigが無いため、ldcondig -p|grep libsndfileではなく[ -d /usr/local/Cellar/libsndfile ]で調べる必要があります。

readarrayをなくす

readarrayはbash 4.xから導入されたものなので、古い環境では動作しません。
特にMacのプレインストールはbash 3.2です。
そのため独自実装のものに置き換えました。
またdeclare -gAもbash 4.2以上なので、eval "$var"'=()'でグローバル配列を宣言しています。

_readarray(){
  [[ -z "$1" ]] && return 1
  [[ "$1" =~ [[:space:]] ]] && return 1
  var="$1"
  eval "$var"'=()'
  while IFS=$'\n' read -r r; do
    eval "$var"'+=("'"$r"'")'
  done
}

関連 Issue

なし

スクリーンショット・動画など

なし

その他

@eggplants
Copy link
Contributor Author

eggplants commented Oct 28, 2021

Mac用インストーラを用意してもいいなと思います。(CLI/GUI)

@Hiroshiba
Copy link
Member

Mac用インストーラを用意してもいいなと思います。(CLI/GUI)

たぶんユーザーはGUIインストーラがあれば十分だと思うので、一旦GUIインストーラだけで良いかなと思います。

@eggplants
Copy link
Contributor Author

とりあえずLinuxでは概ねの環境で動くようになったはずです。
また、Mac向けビルドのAppImageアーカイブ+アーカイブリストを上げて貰えれば、このinstaller_linux.shを使いまわせそうです。
しかし #399 があれば不要になりますが…

@Hiroshiba
Copy link
Member

なるほど、良いですね!!

mac版ですが、インストーラを作成するためには年間1万円ほどかかるapple開発者登録をする必要がある可能性があります。
そのときにinstaller_linux.shを提供する判断になるかもです!

Ready for reviewにしちゃいますね。

@Hiroshiba Hiroshiba marked this pull request as ready for review October 28, 2021 19:25
Copy link
Member

@Hiroshiba Hiroshiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Hiroshiba Hiroshiba merged commit e05bf23 into VOICEVOX:main Oct 28, 2021
@eggplants
Copy link
Contributor Author

eggplants commented Oct 28, 2021

Macではmd5はあるんですが、md5sumbrew install md5sha1sumが必要なようです。
Mac版のビルドとリリースが整いインストーラが必要になったらまた修正します。

@eggplants eggplants deleted the sed_compat branch October 29, 2021 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants