forked from ProcursusTeam/Procursus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
glib2.0.mk
86 lines (73 loc) · 3.32 KB
/
glib2.0.mk
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
ifneq ($(PROCURSUS),1)
$(error Use the main Makefile)
endif
SUBPROJECTS += glib2.0
GLIB2.0_MAJOR_V := 2.65
GLIB2.0_VERSION := $(GLIB2.0_MAJOR_V).0
DEB_GLIB2.0_V ?= $(GLIB2.0_VERSION)-1
glib2.0-setup: setup
wget -q -nc -P $(BUILD_SOURCE) https://ftp.gnome.org/pub/gnome/sources/glib/$(GLIB2.0_MAJOR_V)/glib-$(GLIB2.0_VERSION).tar.xz
$(call EXTRACT_TAR,glib-$(GLIB2.0_VERSION).tar.xz,glib-$(GLIB2.0_VERSION),glib2.0)
mkdir -p $(BUILD_WORK)/glib2.0/build
echo -e "[host_machine]\n \
cpu_family = '$(shell echo $(GNU_HOST_TRIPLE) | cut -d- -f1)'\n \
cpu = '$(ARCHES)'\n \
endian = 'little'\n \
system = 'darwin'\n \
[properties]\n \
root = '$(BUILD_BASE)'\n \
[paths]\n \
prefix ='/usr'\n \
[binaries]\n \
c = '$(CC)'\n \
cpp = '$(CXX)'\n" > $(BUILD_WORK)/glib2.0/build/cross.txt
ifneq ($(wildcard $(BUILD_WORK)/glib2.0/.build_complete),)
glib2.0:
@echo "Using previously built glib2.0."
else
glib2.0: glib2.0-setup gettext pcre libffi
cd $(BUILD_WORK)/glib2.0/build && PKG_CONFIG="pkg-config" meson \
--cross-file cross.txt \
-Diconv=auto \
-Dbsymbolic_functions=false \
-Ddtrace=false \
..
cd $(BUILD_WORK)/glib2.0/build; \
DESTDIR="$(BUILD_STAGE)/glib2.0" meson install; \
DESTDIR="$(BUILD_BASE)" meson install
touch $(BUILD_WORK)/glib2.0/.build_complete
endif
glib2.0-package: glib2.0-stage
# glib2.0.mk Package Structure
rm -rf $(BUILD_DIST)/libglib2.0-{0,bin,dev{,-bin}}
mkdir -p $(BUILD_DIST)/libglib2.0-0/usr/{lib,share} \
$(BUILD_DIST)/libglib2.0-dev/usr/{lib,share/glib-2.0} \
$(BUILD_DIST)/libglib2.0-bin/usr/{bin,share} \
$(BUILD_DIST)/libglib2.0-dev-bin/usr/{bin,share/glib-2.0}
# glib2.0.mk Prep libglib2.0-0
cp -a $(BUILD_STAGE)/glib2.0/usr/lib/*2.0.0.dylib $(BUILD_DIST)/libglib2.0-0/usr/lib
cp -a $(BUILD_STAGE)/glib2.0/usr/share/locale $(BUILD_DIST)/libglib2.0-0/usr/share
# glib2.0.mk Prep libglib2.0-dev
cp -a $(BUILD_STAGE)/glib2.0/usr/include $(BUILD_DIST)/libglib2.0-dev/usr
cp -a $(BUILD_STAGE)/glib2.0/usr/lib/!(*2.0.0*) $(BUILD_DIST)/libglib2.0-dev/usr/lib
cp -a $(BUILD_STAGE)/glib2.0/usr/share/{gdb,gettext} $(BUILD_DIST)/libglib2.0-dev/usr/share
cp -a $(BUILD_STAGE)/glib2.0/usr/share/glib-2.0/{gdb,schemas,valgrind} $(BUILD_DIST)/libglib2.0-dev/usr/share/glib-2.0
# glib2.0.mk Prep libglib2.0-bin
cp -a $(BUILD_STAGE)/glib2.0/usr/bin/{gapplication,gdbus,gio,gresource,gsettings} $(BUILD_DIST)/libglib2.0-bin/usr/bin
cp -a $(BUILD_STAGE)/glib2.0/usr/share/bash-completion $(BUILD_DIST)/libglib2.0-bin/usr/share
# glib2.0.mk Prep libglib2.0-dev-bin
cp -a $(BUILD_STAGE)/glib2.0/usr/bin/{gdbus-codegen,glib-{compile-resources,genmarshal,gettextize,mkenums},gobject-query,gtester{,-report}} $(BUILD_DIST)/libglib2.0-dev-bin/usr/bin
cp -a $(BUILD_STAGE)/glib2.0/usr/share/aclocal $(BUILD_DIST)/libglib2.0-dev-bin/usr/share
cp -a $(BUILD_STAGE)/glib2.0/usr/share/glib-2.0/{codegen,gettext} $(BUILD_DIST)/libglib2.0-dev-bin/usr/share/glib-2.0
# glib2.0.mk Sign
$(call SIGN,libglib2.0-0,general.xml)
$(call SIGN,libglib2.0-bin,general.xml)
$(call SIGN,libglib2.0-dev-bin,general.xml)
# glib2.0.mk Make .debs
$(call PACK,libglib2.0-0,DEB_GLIB2.0_V)
$(call PACK,libglib2.0-dev,DEB_GLIB2.0_V)
$(call PACK,libglib2.0-bin,DEB_GLIB2.0_V)
$(call PACK,libglib2.0-dev-bin,DEB_GLIB2.0_V)
# glib2.0.mk Build cleanup
rm -rf $(BUILD_DIST)/libglib2.0-{0,bin,dev{,-bin}}
.PHONY: glib2.0 glib2.0-package