Open ikrabbe opened 9 years ago
As with all autconf packages, that are meant to automatically work in all environments, they don't! Some tool at one or the other end always misses, which would be much easier to fix if autoconf and friends would just be banished from the developers world.
So.... as commented previously, autoconf is quite contra productive in most environments I used yet. But GNU seems to love them. To configure pacman-HEAD we need to bootstrap libtool and gettext too. I added both packages (as I cloned some packages to /src, I excluded the /src path from the buildenv package too):
diff --git a/Makefile b/Makefile
index a1914dc..a8923cb 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@ STAGE1= musl binutils gcc busybox patch make
STAGE2= linux-headers musl binutils gcc file ncurses busybox make patch \
zlib perl openssl pkg-config m4 autoconf automake \
readline bash patch perl openssl curl \
-libarchive git pacman
+libarchive git gettext libtool pacman
# The following are additional packages for extending functionality in pacman:
# python libelf pyalpm pyelftools distribute namcap
@@ -181,7 +181,8 @@ package: unmount
--exclude=$(shell basename $(MY_BASE)) \
--exclude=$(shell basename $(SRC)) \
--exclude=$(shell basename $(TT)) \
- --exclude=lost+found *
+ --exclude=src \
+ --exclude=lost+found ./*
# Using || true to avoid make showing ignored errors via '-'
unmount:
diff --git a/packages/gettext/Makefile b/packages/gettext/Makefile
new file mode 100644
index 0000000..ee292d7
--- /dev/null
+++ b/packages/gettext/Makefile
@@ -0,0 +1,18 @@
+NM= gettext
+VRS= 0.19.4
+DIR= $(NM)-$(VRS)
+
+FILE= $(DIR).tar.xz
+URL-$(FILE)= http://ftp.gnu.org/gnu/$(NM)/$(FILE)
+SHA256-$(FILE)= 719adadb8bf3e36bac52c243a01c0add18d23506a3a40437e6f5899ceab18d20
+
+include $(MY_ROOT)/scripts/functions.mk
+
+stage2: Makefile $(FILE)
+ $(std_build)
+
+compile-stage2:
+ $(musl_prep)
+ ./configure --prefix=''
+ make V=1 $(PM)
+ make install
diff --git a/packages/libtool/Makefile b/packages/libtool/Makefile
new file mode 100644
index 0000000..131e791
--- /dev/null
+++ b/packages/libtool/Makefile
@@ -0,0 +1,18 @@
+NM= libtool
+VRS= 2.4.6
+DIR= $(NM)-$(VRS)
+
+FILE= $(DIR).tar.xz
+URL-$(FILE)= http://ftp.gnu.org/gnu/$(NM)/$(FILE)
+SHA256-$(FILE)= 7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+
+include $(MY_ROOT)/scripts/functions.mk
+
+stage2: Makefile $(FILE)
+ $(std_build)
+
+compile-stage2:
+ $(musl_prep)
+ ./configure --prefix=''
+ make V=1 $(PM)
+ make install
diff --git a/scripts/functions.mk b/scripts/functions.mk
index 7011d80..6b8e1be 100644
--- a/scripts/functions.mk
+++ b/scripts/functions.mk
@@ -51,9 +51,12 @@ define sep_dir_build_noclean
endef
define musl_prep
- sed -i -e 's/linux-gnu/linux-musl/g' \
+ FILES=`find ../$(DIR)/ -name "confi*.guess" -o -name "confi*.sub"`
+ if [ ! -z "$$FILES" ]; \
+ then sed -i -e 's/linux-gnu/linux-musl/g' \
-e 's@LIBC=gnu@LIBC=musl@' \
- `find ../$(DIR)/ -name "confi*.guess" -o -name "confi*.sub"`
+ $$FILES; \
+ fi
endef
# This takes the form of 'download [filename] [url] [sha256sum]'
now the bootstrap works for me.
Nice! When I saw your first comment, I realized you were also going to hit issues with pacman, since it has changed since I first created this bootstrap. I'm glad you got it sorted out.
As for sed -i, perhaps the most portable way to fix that is to just use cp first and then skip using -i altogether. If you're interested in providing an actual pull request, I'll review and hopefully merge your changes as well.
If you want to help with the actual OS I'm building, see the repo here: https://github.com/jhuntwork/LightCube-OS - unfortunately some things have changed since I first bootstrapped the environment, and now my configuration requires some tools (like fakeroot) that weren't part of the original bootstrap. I need to create a public http server to house the built packages and the pacman database, I might be able to have that done within the next day or so.
Nice! When I saw your first comment, I realized you were also going to hit issues with pacman, since it has changed since I first created this bootstrap. I'm glad you got it sorted out.
As for sed -i, perhaps the most portable way to fix that is to just use cp first and then skip using -i altogether. If you're interested in providing an actual pull request, I'll review and hopefully merge your changes as well.
If you want to help with the actual OS I'm building, see the repo here: https://github.com/jhuntwork/LightCube-OS - unfortunately some things have changed since I first bootstrapped the environment, and now my configuration requires some tools (like fakeroot) that weren't part of the original bootstrap. I need to create a public http server to house the built packages and the pacman database, I might be able to have that done within the next day or so.
Reply to this email directly or view it on GitHub: https://github.com/jhuntwork/lightcube-bootstrap-musl/issues/2#issuecomment-95932109
Hey Jeremy,
I stumbled over your project as I'm searching for a lean server environment and musl seems to be quite usefull for such purpose.
Actually I moved my work environment a bit away from linux towards plan9, which is a great, quite featureless system. I still miss git in the plan9 core though.
Anyway, I might be interested in contributing to LightCube-OS too. I will create that pull request first.
I already checked out your LightCube-OS repository too, but I found now bootstrap, so I tried to bootstrap with this other repo.
bye ingo
As for sed -i, perhaps the most portable way to fix that is to just use cp first and then skip using -i altogether. If you're interested in providing an actual pull request, I'll review and hopefully merge your changes as well.
No. For sed -i there are two alternatives:
1. Check your arguments and continue using sed -i
2. What I often do is not use sed as it's a "stream editor", but use ed, that is actually The UNIX File Editor.
In case of musl_prep you can do this (not tested!).
define muslprep for x in find ../$(DIR)/ -name "confi.guess" -o -name "confi_.sub" \ do (\ echo "g/linux-gnu/s/l/linux-musl/g'" \ echo "g@LIBC=gnu@s@@LIBC=musl@" \ echo "wq" \ ) | ed $x; \ done EOF endef
It might be even simpler to carry another file around "musl_prep.ed" with the commands
cat >/musl_prep.ed<<EOF g/linux-gnu/s/l/linux-musl/g\ g@LIBC=gnu@s@@LIBC=musl@ wq EOF
and do
define muslprep for x in find ../$(DIR)/ -name "confi.guess" -o -name "confi_.sub"; do ed $x < /musl_prep.ed ; done endef
I think ed is useful as a system editor anyway, though most wisdom about ed seems to be lost. Actually I used ed about a year even for bigger projects before I started to use sam and acme of plan9 (see cat-v.org).
bye ingo
Sorry my previous message was just wrong. I'm going to add a fix, but the message that -i needs an argument is just wrong. -i Of course needs a file and cannot work on stdin, which is a problem if the find in musl-prep does not find a file, which is again true for pacman-HEAD.