mirror of
https://github.com/oasislinux/oasis.git
synced 2026-02-05 11:33:57 +01:00
Note to self: never try to move submodules again
To migrate your existing submodules (more or less):
set -x
set -e
mkdir .git/modules/pkg
for old in */*/src ; do
new="pkg/${old#*/}"
if ! [ -f "$old/.git" ] || [ "${old%%/*}" = pkg ] ; then
continue
fi
git -C ".git/modules/$old" config core.worktree "../../../../../$new"
rmdir "$new"
mv "$old" "$new"
sed -e "s,$old,$new," "$new/.git" > "$new/.git.tmp"
mv "$new/.git.tmp" "$new/.git"
mkdir ".git/modules/${new%/src}"
mv ".git/modules/$old" ".git/modules/$new"
rm "${old%/src}"/*.ninja
mv "${old%/src}"/*.tar.{gz,xz,bz2} "${new%/src}/"
rmdir "${old%/src}" || true
done
sed -e 's,^\[submodule "[^/]*/,[submodule "pkg/,' .git/config > .git/config.tmp
mv .git/config.tmp .git/config
181 lines
3.3 KiB
Plaintext
181 lines
3.3 KiB
Plaintext
cflags=(\
|
|
-fwrapv\
|
|
-D NDEBUG\
|
|
-D Py_BUILD_CORE\
|
|
-I include\
|
|
-I '$dir' \
|
|
-I '$srcdir'/Include\
|
|
)
|
|
|
|
srcs=(\
|
|
Modules/^(\
|
|
getbuildinfo.c\
|
|
getpath.c.o\
|
|
main.c\
|
|
gcmodule.c\
|
|
`{awk -f modules.awk Setup | sort -u}\
|
|
)\
|
|
Objects/^(\
|
|
abstract.c\
|
|
accu.c\
|
|
boolobject.c\
|
|
bytes_methods.c\
|
|
bytearrayobject.c\
|
|
bytesobject.c\
|
|
cellobject.c\
|
|
classobject.c\
|
|
codeobject.c\
|
|
complexobject.c\
|
|
descrobject.c\
|
|
enumobject.c\
|
|
exceptions.c\
|
|
genobject.c\
|
|
fileobject.c\
|
|
floatobject.c\
|
|
frameobject.c\
|
|
funcobject.c\
|
|
iterobject.c\
|
|
listobject.c\
|
|
longobject.c\
|
|
dictobject.c\
|
|
odictobject.c\
|
|
memoryobject.c\
|
|
methodobject.c\
|
|
moduleobject.c\
|
|
namespaceobject.c\
|
|
object.c\
|
|
obmalloc.c\
|
|
capsule.c\
|
|
rangeobject.c\
|
|
setobject.c\
|
|
sliceobject.c\
|
|
structseq.c\
|
|
tupleobject.c\
|
|
typeobject.c\
|
|
unicodeobject.c\
|
|
unicodectype.c\
|
|
weakrefobject.c\
|
|
)\
|
|
Parser/^(\
|
|
acceler.c\
|
|
grammar1.c\
|
|
listnode.c\
|
|
node.c\
|
|
parser.c\
|
|
bitset.c\
|
|
metagrammar.c\
|
|
firstsets.c\
|
|
grammar.c\
|
|
pgen.c\
|
|
myreadline.c parsetok.c tokenizer.c\
|
|
)\
|
|
Python/^(\
|
|
_warnings.c\
|
|
Python-ast.c\
|
|
asdl.c\
|
|
ast.c\
|
|
bltinmodule.c\
|
|
ceval.c\
|
|
compile.c\
|
|
codecs.c\
|
|
dynamic_annotations.c\
|
|
errors.c\
|
|
frozenmain.c\
|
|
future.c\
|
|
getargs.c\
|
|
getcompiler.c\
|
|
getcopyright.c\
|
|
getplatform.c\
|
|
getversion.c\
|
|
graminit.c\
|
|
import.c\
|
|
importdl.c\
|
|
marshal.c\
|
|
modsupport.c\
|
|
mystrtoul.c\
|
|
mysnprintf.c\
|
|
peephole.c\
|
|
pyarena.c\
|
|
pyctype.c\
|
|
pyfpe.c\
|
|
pyhash.c\
|
|
pylifecycle.c\
|
|
pymath.c\
|
|
pystate.c\
|
|
pythonrun.c\
|
|
pytime.c\
|
|
random.c\
|
|
structmember.c\
|
|
symtable.c\
|
|
sysmodule.c\
|
|
traceback.c\
|
|
getopt.c\
|
|
pystrcmp.c\
|
|
pystrtod.c\
|
|
pystrhex.c\
|
|
dtoa.c\
|
|
formatter_unicode.c\
|
|
fileutils.c\
|
|
dynload_stub.c\
|
|
thread.c\
|
|
frozen.c\
|
|
)\
|
|
'$outdir'/config.c\
|
|
)
|
|
checkstatus
|
|
|
|
libs=()
|
|
deps=()
|
|
|
|
if(grep -q '^_ctypes' Setup) {
|
|
cflags=($cflags -isystem '$builddir'/pkg/libffi/include)
|
|
deps=($deps pkg/libffi/headers)
|
|
libs=($libs libffi/libffi.a)
|
|
}
|
|
if(grep -qE '^(_hashlib|_ssl)' Setup) {
|
|
cflags=($cflags -isystem '$builddir'/pkg/libressl/include)
|
|
deps=($deps pkg/libressl/headers)
|
|
libs=($libs (libressl/^(libssl.a libcrypto.a) openbsd/libbsd.a))
|
|
}
|
|
if(grep -q '^pyexpat' Setup) {
|
|
cflags=($cflags -isystem '$builddir'/pkg/expat/include)
|
|
deps=($deps pkg/expat/headers)
|
|
libs=($libs expat/libexpat.a)
|
|
}
|
|
if(grep -q '^zlib' Setup) {
|
|
cflags=($cflags -isystem '$builddir'/pkg/zlib/include)
|
|
deps=($deps pkg/zlib/headers)
|
|
libs=($libs zlib/libz.a)
|
|
}
|
|
|
|
rule makesetup 'wd=$$PWD && cd $outdir && $$wd/$srcdir/Modules/makesetup -s $$wd/$srcdir -m - $$wd/$in'
|
|
build '$outdir'/config.c makesetup '$dir'/Setup '|' '$srcdir'/Modules/^(makesetup config.c.in)
|
|
|
|
cflags $cflags
|
|
|
|
cc Modules/getpath.c ; defs='-D '''^(\
|
|
'PYTHONPATH='":plat-linux"\
|
|
'PREFIX='"/"\
|
|
'EXEC_PREFIX='"/"\
|
|
'VERSION='"3.5"\
|
|
'VPATH='""\
|
|
)^'''' with cflags '$cflags '$"defs
|
|
|
|
phony deps $deps
|
|
lib libpython.a -d '$dir'/deps $srcs
|
|
|
|
exe python Programs/python.c libpython.a '$builddir'/pkg/$libs
|
|
file bin/python3 '$outdir'/python 755
|
|
sym bin/python python3
|
|
|
|
pylibs=`{grep -v '^#' pylibs.txt}
|
|
checkstatus
|
|
for(f in $pylibs)
|
|
file lib/python3.5/$f '$srcdir'/Lib/$f 644
|
|
for(f in _sysconfigdata.py Makefile)
|
|
file lib/python3.5/$f '$dir'/lib/$f 644
|
|
dir lib/python3.5/lib-dynload 755
|
|
|
|
gen_inputs='$dir'/^(Setup modules.awk)
|
|
fetch curl
|