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 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267
|
#!/usr/bin/make -f
# add DEB_* variables to the environment
include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/pkg-info.mk
include /usr/share/dpkg/vendor.mk
# determine whether this is a stable or development build
VERSION=$(shell echo $(DEB_SOURCE) | sed s/wine//g)
ifeq (x$(VERSION), x)
DEBSUFFIX=-stable
else
DEBSUFFIX=$(VERSION)
endif
export DEBSUFFIX
# installation paths
MANDIR=usr/share/man
BINDIR=usr/lib/wine$(VERSION)
DATDIR=usr/share/wine$(VERSION)
INCDIR=usr/include/wine$(VERSION)
LIBDIR=usr/lib/$(DEB_HOST_MULTIARCH)/wine$(VERSION)
# enable verbose build log
export DH_VERBOSE=1
# specify buildflags (stack protector, fortify, and LTO are not yet supported upstream)
export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-fortify,-stackprotector optimize=-lto
# configure options
CONFLAGS=--with-gnutls \
--without-oss \
--without-sane \
--without-netapi \
--disable-tests \
--enable-werror \
--enable-maintainer-mode \
--libdir=/$(LIBDIR) \
--bindir=/$(BINDIR) \
--mandir=/$(MANDIR) \
--includedir=/$(INCDIR) \
--datarootdir=/$(DATDIR) \
LDFLAGS="" \
CFLAGS="$(shell dpkg-buildflags --get CFLAGS)" \
# enable wine64 on 64-bit architectures
ifeq ($(DEB_HOST_ARCH_BITS), 64)
CONFLAGS+=--enable-win64
# set "-Wno-format" (many format strings are not yet updated for 64-bit)
export DEB_CFLAGS_MAINT_APPEND+=-Wno-format
export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-fortify,-stackprotector,-format optimize=-lto
endif
# build with mingw on intel architectures
ifneq (,$(filter $(DEB_HOST_ARCH),i386 amd64))
CONFLAGS+=--with-mingw ZLIB_PE_LIBS=z
endif
# ignore -fstack-clash-protection on arm64
ifeq ($(DEB_HOST_ARCH), arm64)
export DEB_CFLAGS_MAINT_APPEND+=-Wno-unused-command-line-argument -Wno-error
endif
# ignore arm-specific unused functions
ifneq (,$(filter $(DEB_HOST_ARCH),armhf arm64))
export DEB_CFLAGS_MAINT_APPEND+=-Wno-unused-function
endif
# extra information to add to the version string
export VENDOR=$(DEB_VENDOR) $(DEB_VERSION)
# parse wine's cpu string from DEB_HOST_MULTIARCH
export WINE_CPU=$(shell echo $(DEB_HOST_MULTIARCH) | cut -d- -f1)
# use date of the latest changelog update as the build date
export WIDL_TIME_OVERRIDE=$(SOURCE_DATE_EPOCH)
# additional files to generate
INSTALLS=$(shell ls debian/*VERSION* | sed s/VERSION/$(VERSION)/) \
debian/bug-control \
debian/control: debian/control.in debian/control.stable.in
sed "s/VERSION/$(VERSION)/g;s/DEBSUFFIX/$(DEBSUFFIX)/g" < $< > $@
ifeq (x$(DEBSUFFIX),x-stable)
echo >> $@
cat debian/control.stable.in >> $@
endif
debian/wine$(VERSION)%: debian/wineVERSION%
sed "s/VERSION/$(VERSION)/g;s/DEBSUFFIX/$(DEBSUFFIX)/g" < $< > $@
debian/wine32$(VERSION)%: debian/wine32VERSION%
sed "s/VERSION/$(VERSION)/g;s/DEBSUFFIX/$(DEBSUFFIX)/g" < $< > $@
debian/wine64$(VERSION)%: debian/wine64VERSION%
sed "s/VERSION/$(VERSION)/g;s/DEBSUFFIX/$(DEBSUFFIX)/g" < $< > $@
debian/libwine$(VERSION)%: debian/libwineVERSION%
sed "s/VERSION/$(VERSION)/g;s/DEB_HOST_MULTIARCH/$(DEB_HOST_MULTIARCH)/g;s/WINE_CPU/$(WINE_CPU)/g" < $< > $@
debian/bug-control: debian/bug-control.in
sed s/VERSION/$(VERSION)/g < $< > $@
%:
dh $@
override_dh_auto_configure:
# cc version
$(CC) --version
# mingw version
$(DEB_HOST_GNU_CPU)-w64-mingw32-gcc --version || echo ""
# automatically generated files
./tools/make_unicode
./tools/make_requests
./tools/make_specfiles
cd dlls/dsound && ./make_fir
cd dlls/opengl32 && ./make_opengl
cd dlls/winevulkan && ./make_vulkan -x /usr/share/vulkan/registry/vk.xml -X /usr/share/vulkan/registry/video.xml
# autotools files
ln -sf /usr/share/misc/config.sub tools
ln -sf /usr/share/misc/config.guess tools
# image files used to generate icons for parts of wine
ln -sf ../../dlls/user32/resources/oic_hand.svg dlls/display.drv16/oic_hand.svg
ln -sf ../../dlls/user32/resources/oic_note.svg dlls/comctl32/idi_tt_info_md.svg
ln -sf ../../dlls/user32/resources/oic_note.svg dlls/comctl32/idi_tt_info_sm.svg
ln -sf ../../dlls/user32/resources/oic_bang.svg dlls/comctl32/idi_tt_warn_md.svg
ln -sf ../../dlls/user32/resources/oic_bang.svg dlls/comctl32/idi_tt_warn_sm.svg
ln -sf ../../dlls/user32/resources/oic_hand.svg dlls/comctl32/idi_tt_error_md.svg
ln -sf ../../dlls/user32/resources/oic_hand.svg dlls/comctl32/idi_tt_error_sm.svg
ln -sf ../../dlls/shell32/resources/move.svg dlls/comctl32/idi_dragarrow.svg
ln -sf ../../dlls/shell32/resources/image.svg programs/regedit/bin.svg
ln -sf ../../dlls/shell32/resources/folder.svg programs/regedit/folder.svg
ln -sf ../../dlls/shell32/resources/document.svg programs/regedit/string.svg
ln -sf ../../dlls/shell32/resources/mycomputer.svg programs/regedit/computer.svg
ln -sf ../../dlls/shell32/resources/folder_open.svg programs/regedit/folderopen.svg
ln -sf ../../dlls/shell32/resources/window.svg programs/taskmgr/window.svg
ln -sf ../../dlls/shell32/resources/window.svg programs/taskmgr/windowsm.svg
ln -sf ../../dlls/shell32/resources/drive.svg dlls/comdlg32/hdisk.svg
ln -sf ../../dlls/shell32/resources/folder.svg dlls/comdlg32/folder.svg
ln -sf ../../dlls/shell32/resources/network.svg dlls/comdlg32/network.svg
ln -sf ../../dlls/shell32/resources/folder_open.svg dlls/comdlg32/folder2.svg
ln -sf ../../dlls/shell32/resources/disk_drive.svg dlls/comdlg32/floppy.svg
ln -sf ../../dlls/shell32/resources/optical_drive.svg dlls/comdlg32/cdrom.svg
ifneq (,$(filter $(DEB_HOST_ARCH),i386 amd64))
# ensure system zlib files are used for i386 and amd64
rm -rf libs/zlib
endif
# execute wine's configure script
./configure $(CONFLAGS)
override_dh_auto_build-indep:
# only build fonts for the architecture-independent packages
make -C tools/sfnt2fon
make -C fonts
override_dh_auto_build-arch:
# build wine's headers upfront to avoid incompatible mingw versions
make -C include
dh_auto_build
override_dh_auto_test:
# disabled, there are currently too many failing tests
override_dh_install-indep:
dh_install
# create font symlinks
./debian/scripts/font-symlinks
override_dh_auto_install-indep: $(INSTALLS)
mkdir -p debian/tmp
cp ANNOUNCE.md debian/tmp/NEWS
cp programs/winedbg/README debian/tmp/README.winedbg
sed "s|DEBSUFFIX|$(DEBSUFFIX)|g" debian/scripts/wineapploader.in > debian/tmp/wineapploader
chmod 755 debian/tmp/wineapploader
sed "s|BINDIR|$(BINDIR)|g;s|VERSION|$(VERSION)|g" debian/scripts/wine.in > debian/tmp/wine$(DEBSUFFIX)
make $(shell find . ! -path "./.pc/*" -name *\\.man\\.in | sed s/\\.in//)
for file in $$(find . ! -path "./debian/*" -name \*.man); do \
rename=$$(basename $$file | sed "s/\\./$(DEBSUFFIX)./;s/UTF-8\\.//"); \
mv $$file debian/tmp/$$rename || true; \
done
# files to exclude from the architecture-independent packages
rm -f debian/tmp/usr/lib/*/wineserver
rm -f debian/tmp/notepad*.man debian/tmp/winemine*.man
# extract hicolor icon from logo.svg
sed '/image\/png/d;s|width="611"|width="209"|' programs/winecfg/logo.svg > debian/tmp/wine$(DEBSUFFIX).svg
override_dh_auto_install-arch: $(INSTALLS)
mkdir -p debian/tmp
cp ANNOUNCE.md debian/tmp/NEWS
cp tools/winedump/README debian/tmp/README.winedump
mv server/wineserver debian/tmp/wineserver$(DEB_HOST_ARCH_BITS)
sed "s|BINDIR|$(BINDIR)|g" debian/scripts/winegcc.in > debian/tmp/winegcc$(DEBSUFFIX)
sed "s|BINDIR|$(BINDIR)|g;s|VERSION|$(VERSION)|g" debian/scripts/wineserver.in > debian/tmp/wineserver
chmod 755 debian/tmp/wineserver
ifeq ($(DEB_HOST_ARCH), i386)
echo >> debian/libwine$(VERSION).install
echo "# 16-bit windows PE files" >> debian/libwine$(VERSION).install
echo "debian/tmp/usr/lib/*/*/*/*.vxd" >> debian/libwine$(VERSION).install
echo "debian/tmp/usr/lib/*/*/*/*.dll16" >> debian/libwine$(VERSION).install
echo "debian/tmp/usr/lib/*/*/*/*.drv16" >> debian/libwine$(VERSION).install
echo "debian/tmp/usr/lib/*/*/*/*.exe16" >> debian/libwine$(VERSION).install
echo "debian/tmp/usr/lib/*/*/*/*.mod16" >> debian/libwine$(VERSION).install
endif
ifeq (,$(filter $(DEB_HOST_ARCH),i386 amd64))
rm -f debian/libwine$(VERSION).prerm debian/libwine$(VERSION).postinst
endif
dh_installdirs
dh_auto_install
for file in $$(find . ! -path "./debian/*" -name \*.man); do \
rename=$$(basename $$file | sed "s/\\./$(DEBSUFFIX)./;s/UTF-8\\.//"); \
mv $$file debian/tmp/$$rename || true; \
done
ifeq ($(DEB_HOST_ARCH_BITS), 64)
# copy 64 bit wine-preloader
test -f debian/tmp/$(BINDIR)/wine64-preloader && \
mv debian/tmp/$(BINDIR)/wine64-preloader debian/tmp/$(BINDIR)/wine64-preloader.static || \
cp debian/scripts/wine-preloader.static debian/tmp/$(BINDIR)/wine64-preloader.static
else
# copy 32 bit wine-preloader
test -f debian/tmp/$(BINDIR)/wine-preloader && \
mv debian/tmp/$(BINDIR)/wine-preloader debian/tmp/$(BINDIR)/wine-preloader.static || \
cp debian/scripts/wine-preloader.static debian/tmp/$(BINDIR)/wine-preloader.static
endif
# files to exclude from the architecture-dependent packages
rm -rf debian/tmp/usr/share/man
rm -f debian/tmp/usr/lib/*/wineserver
rm -f debian/tmp/usr/share/*/fonts/*.fon
rm -f debian/tmp/usr/share/*/fonts/*.ttf
rm -f debian/tmp/notepad*.man debian/tmp/winemine*.man
# do not try to strip archive files on arm, they currently cause dh_strip to fail
ifneq (,$(filter $(DEB_HOST_ARCH),armhf arm64))
override_dh_strip:
dh_strip --exclude \.a
endif
override_dh_makeshlibs:
# avoid unnecessary calls to ldconfig
dh_makeshlibs --no-scripts -- -V
override_dh_shlibdeps:
mkdir -p debian/tmp
./debian/scripts/config2elf debian/tmp/elf.recommends
./debian/scripts/config2elf debian/tmp/elf.depends "libfontconfig|libfreetype|libncurses"
dpkg-shlibdeps --warnings=1 -v -pdlopen \
-dDepends -edebian/tmp/elf.depends \
-dRecommends -edebian/tmp/elf.recommends \
-Tdebian/libwine$(VERSION).substvars 2>/dev/null
dh_shlibdeps -- -v -l/$(LIBDIR)/$(WINE_CPU)-unix
override_dh_bugfiles:
dh_bugfiles -A
override_dh_missing:
dh_missing -X elf.depends -X elf.recommends -X wine.desktop
override_dh_clean:
dh_clean -- $(INSTALLS)
override_dh_auto_clean:
ifeq (,$(filter $(DEB_HOST_ARCH),i386 amd64))
# remove zlib patch on non x86 architectures
QUILT_PATCHES=debian/patches quilt pop -af || true
QUILT_PATCHES=debian/patches quilt delete system/zlib.patch || true
endif
QUILT_PATCHES=debian/patches quilt push -af || true
dh_auto_clean
|