File: build_linux.py

package info (click to toggle)
libxmlbird 1.2.15-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 308 kB
  • sloc: python: 649; xml: 122; sh: 51; makefile: 14
file content (36 lines) | stat: -rwxr-xr-x 1,037 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/python

import os
import glob

from config import PREFIX
from run import run
from version import LIBXMLBIRD_SO_VERSION
from pkgconfig import generate_pkg_config_file

run ("mkdir -p build/bin");

run ("valac --ccode --pkg posix --library libxmlbird --vapi=xmlbird.vapi "
     + "--directory=./build -H ./build/xmlbird.h " + " ".join(sorted(glob.glob('libxmlbird/*.vala'))))

run ("""gcc -fPIC -c \
     $(pkg-config --cflags glib-2.0) \
     $(pkg-config --cflags gobject-2.0) \
     build/libxmlbird/*.c""");

run ("mv *.o build/libxmlbird/");

run ("""gcc -shared \
     -Wl,-soname,""" + "libxmlbird.so." + LIBXMLBIRD_SO_VERSION + "\
     build/libxmlbird/*.o \
     $(pkg-config --libs glib-2.0) \
     $(pkg-config --libs gobject-2.0) \
     -o build/bin/libxmlbird.so.""" + LIBXMLBIRD_SO_VERSION);

if os.path.islink('build/bin/libxmlbird.so'):
    run("unlink build/bin/libxmlbird.so")
    
run ("cd build/bin/ && \
     ln -s libxmlbird.so.""" + LIBXMLBIRD_SO_VERSION + " libxmlbird.so");
	
generate_pkg_config_file()