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 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228
|
#!/usr/bin/make -f
#export DH_VERBOSE=1
# bring in VERSION/ARCH/BUILD variables
include /usr/share/dpkg/default.mk
include debian/mono-archs.make
RUN_MONO = MONO_PATH=debian/tmp/usr/lib/mono/4.5 runtime/mono-wrapper
DH_INTERNAL_MONO_PARAM = --internal-mono
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
CONF_FLAGS += --build $(DEB_HOST_GNU_TYPE)
else
CONF_FLAGS += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif
ifeq ($(DEB_HOST_ARCH_OS), kfreebsd)
CONF_FLAGS += --enable-minimal=aot
endif
ifeq ($(DEB_HOST_ARCH), armel)
CONF_FLAGS += --with-fpu=NONE --with-tls=pthread
BTLS_ARCH = true
else ifeq ($(DEB_HOST_ARCH), armhf)
CONF_FLAGS += --with-tls=pthread
BTLS_ARCH = true
else ifeq ($(DEB_HOST_ARCH), arm64)
BTLS_ARCH = true
else ifeq ($(DEB_HOST_ARCH), i386)
BTLS_ARCH = true
else ifeq ($(DEB_HOST_ARCH), amd64)
BTLS_ARCH = true
else ifeq ($(DEB_HOST_ARCH), mipsel)
CONF_FLAGS += --with-tls=pthread
else ifeq ($(DEB_HOST_ARCH), powerpc)
CONF_FLAGS += --with-tls=pthread
else ifeq ($(DEB_HOST_ARCH), ppc64)
CONF_FLAGS += --with-tls=pthread
else ifeq ($(DEB_HOST_ARCH), ppc64el)
CONF_FLAGS += --with-tls=pthread
BTLS_ARCH = true
else ifeq ($(DEB_HOST_ARCH), riscv64)
BTLS_ARCH = true
else ifeq ($(DEB_HOST_ARCH), s390x)
BTLS_ARCH = true
endif
ifneq (,$(findstring $(DEB_HOST_ARCH),$(DEB_MONO_SGEN_ARCHS)))
CONF_FLAGS += --with-sgen=yes
else
CONF_FLAGS += --with-sgen=no
endif
# Skip building Boehm's garbage collector on unsupported architectures.
ifeq (,$(findstring $(DEBHOST_ARCH),$(DEB_MONO_BOEHM_ARCHS)))
DISABLE_BOEHM = true
endif
ifdef DISABLE_BOEHM
CONF_FLAGS += --disable-boehm
endif
# Set Boehm's garbage collector build flags.
ifndef DISABLE_BOEHM
CONFIGURE_BOEHM = \
--prefix=/usr/local --cache-file=/dev/null --srcdir=. \
--no-create --no-recursion \
--with-libgc-threads=pthreads \
--enable-parallel-mark --enable-maintainer-mode --enable-compile-warnings --enable-single-obj-compilation \
--disable-option-checking --disable-embed-check \
CFLAGS_FOR_LIBGC='-Wno-deprecated-declarations -g -mno-tls-direct-seg-refs' \
CPPFLAGS_FOR_LIBGC='-Wall -Wunused -Wmissing-declarations -Wpointer-arith -Wno-cast-qual -Wwrite-strings -Wno-switch -Wno-switch-enum -Wno-unused-value -Wno-attributes -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP -DUSE_MUNMAP -g -DUSE_COMPILER_TLS'
endif
%:
dh $@
CONFIGURE = --libdir=/usr/lib/ --libexecdir=/usr/lib/ \
--with-ikvm-native=no --disable-quiet-build --with-csc=mcs \
--disable-system-aot --enable-llvm=no --enable-loadedllvm=no \
--with-libatomic-ops=none \
$(CONF_FLAGS)
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
MONO_MAKE_FLAGS += -j$(NUMJOBS)
endif
override_dh_auto_configure:
dh_auto_configure -- $(CONFIGURE)
execute_after_dh_auto_configure:
ifndef DISABLE_BOEHM
env --chdir=external/bdwgc ./configure $(CONFIGURE_BOEHM)
endif
execute_before_dh_auto_build:
ifndef DISABLE_BOEHM
env --chdir=external/bdwgc $(MAKE) $(MONO_MAKE_FLAGS)
endif
override_dh_auto_build:
cd mono/eglib && $(MAKE) $(MONO_MAKE_FLAGS)
cd mono && $(MAKE) $(MONO_MAKE_FLAGS)
LC_ALL=C $(MAKE) $(MAKE_FLAGS) EXTERNAL_MCS=false EXTERNAL_MONO=false
chmod +x debian/dh_makeclilibs \
debian/dh_clistrip
cp -a ./external/binary-reference-assemblies/v4.7.1 ./external/binary-reference-assemblies/v4.7.1.debbak
find ./external/binary-reference-assemblies/v4.7.1/ -name \*.dll -print -delete
MONO_PATH=$(CURDIR)/mcs/class/lib/net_4_x-linux/ $(MAKE) $(MONO_MAKE_FLAGS) -C external/binary-reference-assemblies/ \
V=$(DH_VERBOSE) CSC="$(CURDIR)/runtime/mono-wrapper $(CURDIR)/mcs/class/lib/net_4_x-linux/mcs.exe"
# Build the late-GAC tool, using the built Mono runtime
MONO_PATH=$(CURDIR)/mcs/class/lib/net_4_x-linux/ runtime/mono-wrapper \
mcs/class/lib/net_4_x-linux/mcs.exe -target:exe \
-out:debian/MonoGetAssemblyName.exe debian/MonoGetAssemblyName.cs
override_dh_auto_test:
-cd mono/mini && timeout -k 15m 1h make check
-cd mono/tests && MONO_ENV_OPTIONS="$(MONO_ENV_OPTIONS) --gc=boehm" timeout -k 15m 1h make check
-cd mono/tests && MONO_ENV_OPTIONS="$(MONO_ENV_OPTIONS) --gc=sgen" timeout -k 15m 1h make check
# funny bug-459094.cs creates too long directory names which
# pbuilder is unable to remove, eh
rm -rf mono/tests/abcde12345abcde12345abcde12345abcde12345/
override_dh_auto_clean:
ifneq ("$(wildcard external/binary-reference-assemblies/v4.7.1.debbak)","")
rm -rf external/binary-reference-assemblies/v4.7.1
mv external/binary-reference-assemblies/v4.7.1.debbak external/binary-reference-assemblies/v4.7.1
endif
[ ! -f Makefile ] || $(MAKE) distclean
# distclean misses stuff
find -name "*.mdb" -delete
find ./external/binary-reference-assemblies/ -name "*.dll" -not -path "./external/binary-reference-assemblies/v4.7.1/*" -print -delete
rm -rf mcs/class/lib/basic/ \
mcs/class/lib/net_4_5/
rm -f debian/MonoGetAssemblyName.exe
rm -f mcs/packages/*.dll mcs/packages/*.exe* mcs/packages/*.rsp
dh_auto_clean
execute_before_dh_install:
# Boehm's garbage collector is not built on all architectures,
# so can not be handled by debian/${pkg}.install files.
ifndef DISABLE_BOEHM
install -D --mode=755 \
--target-directory=debian/mono-runtime/usr/bin/ \
debian/tmp/usr/bin/mono-boehm
install -D --mode=644 \
--target-directory=debian/mono-devel/usr/lib/ \
debian/tmp/usr/lib/libmonoboehm-2.0.a \
debian/tmp/usr/lib/libmonoboehm-2.0.so.1.0.0
## install always dereference symbolic links,
## so we need to create them explicitly.
ln --symbolic libmonoboehm-2.0.so.1.0.0 \
debian/mono-devel/usr/lib/libmonoboehm-2.0.so.1
ln --symbolic libmonoboehm-2.0.so.1 \
debian/mono-devel/usr/lib/libmonoboehm-2.0.so
rm \
debian/tmp/usr/bin/mono-boehm \
debian/tmp/usr/lib/libmonoboehm-2.0.a \
debian/tmp/usr/lib/libmonoboehm-2.0.so \
debian/tmp/usr/lib/libmonoboehm-2.0.so.1 \
debian/tmp/usr/lib/libmonoboehm-2.0.so.1.0.0
endif
execute_after_dh_install:
cd mcs/jay && \
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
# don't want docs of bundled libgc
rm -rf debian/tmp/usr/share/libgc-mono
# Mono.Security.Win32.dll is only useful on windows, as it wrap the win api
rm -rf $(CURDIR)/debian/tmp/usr/lib/mono/gac/Mono.Security.Win32/
rm -f $(CURDIR)/debian/tmp/usr/lib/mono/4.5/Mono.Security.Win32.dll*
# we don't ship bundled nunit of mono
rm -f $(CURDIR)/debian/tmp/usr/lib/mono/4.5/nunit*
rm -f $(CURDIR)/debian/tmp/usr/lib/pkgconfig/mono-nunit.pc
rm -rf $(CURDIR)/debian/tmp/usr/lib/mono/gac/nunit*/
rm -f $(CURDIR)/debian/tmp/usr/bin/nunit*
# mono 2.10.1 bug, prj2make was removed but the start script not
rm -f $(CURDIR)/debian/tmp/usr/bin/prj2make
ifndef DISABLE_BOEHM
strip --strip-unneeded --remove-section=.comment --remove-section=.note \
debian/tmp/usr/bin/pedump
endif
ifdef BTLS_ARCH
install -D -m 644 debian/tmp/usr/lib/libmono-btls-shared.so \
debian/mono-runtime/usr/lib/libmono-btls-shared.so
endif
# Late GAC
install -D --mode=644 \
--target-directory=debian/mono-libraries/usr/lib/mono/gac/System.Data/4.0.0.0__b77a5c561934e089/ \
debian/System.Data.dll.config
install -D --mode=644 \
--target-directory=debian/mono-libraries/usr/lib/mono/gac/System.Drawing/4.0.0.0__b03f5f7f11d50a3a/ \
debian/System.Drawing.dll.config
install -D --mode=644 \
--target-directory=debian/mono-libraries/usr/lib/mono/gac/System.Windows.Forms/4.0.0.0__b77a5c561934e089/ \
debian/System.Windows.Forms.dll.config
install -D --mode=644 \
--target-directory=debian/mono-libraries/usr/lib/mono/gac/Mono.Cairo/4.0.0.0__0738eb9f132ed756/ \
debian/Mono.Cairo.dll.config
install -D --mode=644 \
--target-directory=debian/mono-libraries/usr/lib/mono/gac/Mono.WebBrowser/4.0.0.0__0738eb9f132ed756/ \
debian/Mono.WebBrowser.dll.config
debian/dh_clistrip -i --dbg-package=mono-libraries-debug
debian/dh_makeclilibs -i -m 1.0 $(DH_INTERNAL_MONO_PARAM)
debian/dh_makeclilibs -p mono-libraries $(DH_INTERNAL_MONO_PARAM)
# debian/package.install can not be used for -dbgsym packages.
install -D --mode=755 \
--target-directory=debian/mono-runtime-dbgsym/usr/lib/debug/usr/bin/ \
debian/tmp/usr/bin/mono-gdb.py
rm debian/tmp/usr/bin/mono-gdb.py
execute_after_dh_fixperms:
find debian/mono-*/usr/lib/mono \
\( -name "*.dll" -o -name "*.mdb" \) \
-exec chmod 644 {} +
override_dh_strip:
dh_strip -a --dbgsym-migration='libmonoboehm-2.0-1-dbg (<< 6.14.1+ds-3), libmonosgen-2.0-1-dbg (<< 6.14.1+ds-3)'
override_dh_makeshlibs:
dh_makeshlibs -a -V
# no elves here, skip zipping debug info
override_dh_dwz:
|