How do I build vala from scratch - gnome

When I try to build vala (https://github.com/gnome/vala), I get an error from autogen that vala must already be installed in order to build vala. So how can I build it on a system that doesn't have it already? I get that it is self hosting, but there has to be some way to boot strap it.
My os is Android-x86 6.x

You can download a source tarball from download.gnome.org and build from there. The tarballs contain generated C code to build the compiler without a Vala compiler installed.
The procedure would be something like:
curl --location https://download.gnome.org/sources/vala/0.38/vala-0.38.4.tar.xz \
--output vala-0.38.4.tar.xz
tar --extract --file vala-0.38.4.tar.xz
cd vala-0.38.4/
./configure
make
The configure script should detect there is no valac installed and select the bootstrap option. You could also try make bootstrap if you run in to problems.
You can then run the test suite and install to the usual Unix file locations with:
make check
make install
Although the install part may not be relevant to Android.

Related

Rustup: how to add/build components for custom toolchain

I need to build a repo using a custom toolchain. However, that repo requires
rust-src rustc-dev llvm-tools-preview
However, it seems rustup can't install components for custom toolchains(correct me if I'm wrong).
Do you know how can I install them or build them by myself?
Thanks
The correct workflow is:
build & install your custom toolchain to a folder.
run ./x.py dist, then you can get many compressed components in the build/dist folder.
select the component you want and decompress it, there is an install.sh script, you can use that script to install the component to your custom toolchain. One example of mine is ./install.sh --prefix=~/rust_custom --components=rustc-dev, suppose I installed my toolchain in ~/rust_custom folder.
P.S.
It seems x.py doesn't have an install command for the llvm-tools, so at least this component needs to be installed manually for a custom toolchain.

Integrating custom Linux test project package with Alpine

I have downloaded the Linux Test Project repository and compiled it. I now want to integrate it with the Alpine's binary image while compiling. A unix shell script that has Alpine specific commands will kick-in during compile time which adds these packages to the Alpine's binary. All the standard packages (like Python, Nginx and memcached) are getting integrated successfully by this script except LTP. The command used here is apk add <package name>. The same command doesn't work with the custom LTP's binary.
I tried n number of things like upgrading the apk package, supplying the entire LTP repository using --repository option, trying to manually generate an APKBUILD.tar.gz. Nothing works. Any help would be deeply appreciated.
Thanks in advance !

how I can build mozilla projects

I found https://github.com/mozilla/gecko-dev/tree/master/b2g Mozilla repositories where have the moz.build file, can anybody help, how I can build this plugin. What are tools I need use for build project with use moz.build ?
thank you
If you are trying to build B2G (Firefox OS), then you should follow the procedure documented here. But I have to advise you that you're using the wrong repository if that's your objective, since the correct one for B2G should be this.
In any case, you would need to install the build prerequisites for Linux, as described here, by using the following command:
wget -O bootstrap.py https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py && python bootstrap.py
Now, if you really wanted to just build the b2g folder in the repository you linked, once you've downloaded and installed the prerequisites, simply issue the following command from the root of gecko-dev:
./mach build b2g
This will invoke mach, the build system Mozilla uses, to build the code in the b2g directory.

Cross Compiling Go

I am trying to cross compile Go for ubuntu linux x86_64 on my macbook. I have followed instructions outlined here but when I run go-linux-amd64 build I get the following message go build runtime: linux/amd64 must be bootstrapped using make.bash. Any help with this will be appreciated.
What it's saying you need to do is rebuild the library and runtime for linux-amd64. You can do that this way:
Find the root of your Go installation (if you don't know where this is, running which go may help - the binary is often installed with the rest of the sources).
cd into the src directory
Run GOOS=linux GOARCH=amd64 ./make.bash --no-clean (or GOOS=linux GOARCH=amd64 bash make.bash --no-clean if make.bash is not executable). This will rebuild the library and runtime using the specified OS and architecture.
Once you've done this, you can build a go package or binary for this architecture using GOOS=linux GOARCH=amd64 go build. You can follow the same instructions for other architectures and operating systems.
Edit (08/13/15):
As of Go 1.5, cross compiling is much easier. Since the runtime is written in Go, there's no need to set anything up in order to be able to cross-compile. You can now just run GOOS=<os> GOARCH=<arch> go build from a vanilla Go installation and it will work.
However, there's one exception to this. If you're using cgo, you'll still need to set stuff up ahead of time. And you'll need to inform the tooling that you want to enable cgo cross-compiling by setting the CGO_ENABLED environment variable to 1. So, to be precise:
cd into the src directory of your Go installation (see the instructions above).
Run CGO_ENABLED=1 GOOS=<os> GOARCH=<arch> ./make.bash --no-clean
Run CGO_ENABLED=1 go build to build your project. It is important that you specify CGO_ENABLED=1 even when you're compiling.
Following the above answer https://stackoverflow.com/a/27413148/3675575, I needed to set GOROOT_BOOTSTRAP to recompile my GO source tree:
GOROOT_BOOTSTRAP=/usr/lib/golang/ CGO_ENABLED=1 GOOS=linux GOARCH=386 ./make.bash --no-clean
(I'm using Fedora 23, so the GOROOT_BOOTSTRAP may vary in your operating system)
You must cd %goroot%/src/,find make.bash
Then execute ./make.bash
execute your command. Try it!

Building library from source files in Unix-like OS

When building any library from sources files, is it possible to set the place where I want it to be installed? I have read about some prefix flag, but I was wondering if all aplications have that flag.
For instance, I was building OpenCV from sources and when I made make && make install the contents where installed in /usr/local/opencv but what If I want it to be installed in /other/place/opencv?
If I follow you correctly, that stuff is done during the configure phase with something like:
$ ./configure --prefix=/other/place/opencv
If the project doesn't have a configure script then it's a case of editing the Makefile directly.

Resources