Skip to content

Instantly share code, notes, and snippets.

@lufia
Last active June 4, 2020 09:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lufia/54f6d8635e55ad642773089e1f4a6483 to your computer and use it in GitHub Desktop.
Save lufia/54f6d8635e55ad642773089e1f4a6483 to your computer and use it in GitHub Desktop.
Plan 9でgit

(作業中メモ)

準備

c=/mnt/term/Users/lufia/src/github.com/0intro/plan9-contrib
bind -a $c/sys/lib/tls /sys/lib/tls
bind /tmp/x/ape /sys/include/ape
bind /tmp/x/arch /386/include/ape/
bind $home/bin/386/cpp /bin/cpp
bind -c $home/lib/386/ape /386/lib/ape

Plan 9標準のライブラリを更新する場合

c=/mnt/term/Users/lufia/src/github.com/0intro/plan9-contrib
bind $c/sys/src /sys/src
bind $c/sys/lib /sys/lib
bind $c/sys/include /sys/include
bind $c/$cputype/include/ape /$cputype/include/ape

# mkdir -p /tmp/x/openssl
bind -bc /tmp/x /$cputype/lib/ape

gmake

% srv -nq tcp!9p.io sources /n/sources
% cp /n/sources/contrib/andrey/make-3.81.tgz /tmp/
% unmount /n/sources
% rm /srv/sources

% mk
% mk install

zlib

$ git clone https://github.com/lufia/zlib
$ cd zlib
$ git checkout plan9

% mk
% mk test
% mk install

libexpat

$ git clone https://github.com/lufia/libexpat
$ cd zlib
$ git checkout plan9

% cd expat/lib
% mk
% mk install

libressl

$ git clone https://github.com/lufia/portable
$ cd portable
$ git checkout plan9  # if need
$ bash update.sh
$ patch -p0 <plan9/crypto.patch
$ patch -p0 <plan9/ssl.patch
$ patch -p0 <plan9/tls.patch
$ patch -p0 <plan9/apps.patch

% cd crypto
% mk

git

$ git clone https://github.com/lufia/git
$ cd git

% ./remove-bitfields.sh
% SHELL_PATH=/bin/ape/psh
% gmake 'prefix=' 'gitexecdir=bin/git-core' 'sysconfdir=sys/lib/git' 'template_dir=sys/lib/git/templates' all
% gmake 'prefix=' 'gitexecdir=bin/git-core' 'sysconfdir=sys/lib/git' 'template_dir=sys/lib/git/templates' test

# ape/installを置き換える必要がある
#bind -b $home/bin/rc/ape /rc/bin/ape
% mkdir ./bin
% DESTDIR=./out
% bind $home/bin/rc/ape/install /rc/bin/ape/install
% gmake 'prefix=' 'gitexecdir=bin/git-core' 'sysconfdir=sys/lib/git' 'template_dir=sys/lib/git/templates' install

memo

#prefix = 
#bindir = $(prefix)/bin
#gitexecdir = bin/git-core
#sysconfdir = sys/lib/git
#template_dir = sys/lib/git/templates
#mandir = $(prefix)/sys/man
#infodir = (empty)
#htmldir = (empty)

fix-cc

git grep -n '{[   ]*OPTION_' ':*.c'
git grep -ni '	struct.*[a-z0-9_][ 	]*=[ 	]*{'
git grep -E '     \.[a-zA-Z0-9]+ ?= ?'
@lufia
Copy link
Author

lufia commented Jun 1, 2020

現在残っている { OPTION_XXX ... } で初期化のあるオプションは、ほとんどの場合

// config.c
#define OPT_INTEGER_VALUE(...)
#define OPT_STRING_VALUE(...)
#define OPT_CALLBACK_VALUE(...)

のように_VALUEがあれば対応できそう。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment