続 go製のプロジェクトのebulidを書く
go製のプロジェクトのebulidを書く - karubabuの日記
後はgo系のebuild classがやたら一杯あるのが謎だったね 結局golang-vcs-snapshotのみを使ったけれど、これでよかったのか、もっと相性の良いものがあったのか、全然わからん!
ここの話です
なにがあった
GitHub - imthaghost/scdl: SoundCloud music downloader 🎶
これのebuildを書こうと、前と同じ様にgolang-vcs-snapshot
を使った書いたらビルドが通らなかった
詳しいエラーメッサゲはもう残っていないのだけれど、
is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
と出るしなんか駄目らしい
そんなこと言ったって前(https://karubabu.hateblo.jp/entry/2020/02/13/034634)はこれで出来てたじゃんね
どうすりゃいい
諦めてgolang様のeclassについて多少調べた
どうやら、基本的にはgo-moduleというクラスを使うこと考えて、go-muduleに適合しないソフトウエアはgolang-*クラスを使うべきらしい
go-module.eclass – Gentoo Development Guide
This eclass provides basic settings and functions needed by all software written in the go programming language that uses modules. If the software you are packaging has a file named go.mod in its top level directory, it uses modules and your ebuild should inherit this eclass. If it does not, your ebuild should use the golang-* eclasses.
If, besides go.mod, your software has a directory named vendor in its top level directory, the only thing you need to do is inherit the eclass. If there is no vendor directory, you need to also populate EGO_SUM and call go-module_set_globals as discussed below.
scdlはgo.modがtop level directoryにあるのでこのmoduleを使い、かつvendor directoryが無いのでEGO_SUMを作らないといけないらしい
どうした
go-moduleの説明通りに書いた
go.sumを内容をEGO_SUMの列挙フォーマットに合わせるのはcat go.sum | cut --fields=1-2 -d" " | sed -e 's:$:":' | sed -e 's:^:":' | xsel -ci
とかやれば捗る
gentoo-overlay/scdl-2.0.2.ebuild at master · karubabu/gentoo-overlay · GitHub
完成したものがこれ
おわりに
golang製のソフトウエアも一枚岩ではないらしい
じゃあ前にやったdns-over-httpsはotp level directoryにgo.modがないプロジェクトだったんだなあ☺️と思って見に行ったら、普通にあった
GitHub - m13253/dns-over-https: High performance DNS over HTTPS client & server
どういうことなものなの??やっぱり分からん!