]> git.pld-linux.org Git - packages/crossmingw32-gdk-pixbuf2.git/blob - crossmingw32-gdk-pixbuf2.spec
45d2877426e0140d1274fe6e0db1e422a7a9797e
[packages/crossmingw32-gdk-pixbuf2.git] / crossmingw32-gdk-pixbuf2.spec
1 #
2 # Conditional build:
3 %bcond_without  gdiplus # use libjpeg and libtiff instead of system GDIPLUS
4 #
5 Summary:        An image loading and scaling library - cross MinGW32 version
6 Summary(pl.UTF-8):      Biblioteka ładująca i skalująca obrazki - wersja skrośna MinGW32
7 Name:           crossmingw32-gdk-pixbuf2
8 Version:        2.42.4
9 Release:        1
10 License:        LGPL v2+
11 Group:          Development/Libraries
12 Source0:        https://download.gnome.org/sources/gdk-pixbuf/2.42/gdk-pixbuf-%{version}.tar.xz
13 # Source0-md5:  628e4767d1636a06dea5b0fa4838f723
14 URL:            https://developer.gnome.org/gdk-pixbuf/
15 BuildRequires:  crossmingw32-gcc
16 BuildRequires:  crossmingw32-glib2 >= 2.56.0
17 BuildRequires:  crossmingw32-libpng >= 1.0
18 BuildRequires:  gettext-tools >= 0.19
19 # glib-genmarshal, glib-mkenums
20 BuildRequires:  glib2-devel >= 1:2.56.0
21 BuildRequires:  meson >= 0.55.3
22 BuildRequires:  ninja >= 1.5
23 BuildRequires:  pkgconfig >= 1:0.15
24 BuildRequires:  rpmbuild(macros) >= 1.736
25 BuildRequires:  sed >= 4.0
26 BuildRequires:  tar >= 1:1.22
27 BuildRequires:  xz
28 %if %{without gdiplus}
29 BuildRequires:  crossmingw32-libjpeg
30 BuildRequires:  crossmingw32-libtiff
31 %endif
32 Requires:       crossmingw32-glib2 >= 2.56.0
33 Conflicts:      crossmingw32-gtk+2 < 2.22.0
34 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35
36 %define         abiver  2.10.0
37
38 %define         no_install_post_strip   1
39
40 %define         target                  i386-mingw32
41 %define         target_platform         i386-pc-mingw32
42
43 %define         _sysprefix              /usr
44 %define         _prefix                 %{_sysprefix}/%{target}
45 %define         _libdir                 %{_prefix}/lib
46 %define         _pkgconfigdir           %{_prefix}/lib/pkgconfig
47 %define         _dlldir                 /usr/share/wine/windows/system
48 %define         __pkgconfig_provides    %{nil}
49 %define         __pkgconfig_requires    %{nil}
50 # for meson 0.50+, keep __cc/__cxx as host compiler and pass %{target}-* in meson-cross.txt
51
52 %ifnarch %{ix86}
53 # arch-specific flags (like alpha's -mieee) are not valid for i386 gcc
54 %define         optflags        -O2
55 %endif
56 # -z options are invalid for mingw linker, most of -f options are Linux-specific
57 %define         filterout_ld    -Wl,-z,.*
58 %define         filterout_c     -f[-a-z0-9=]*
59
60 %description
61 gdk-pixbuf is an image loading and scaling library that can be
62 extended by loadable modules for new image formats.
63
64 This package contains the cross version for Win32.
65
66 %description -l pl.UTF-8
67 gdk-pixbuf to biblioteka ładująca i skalująca obrazki, której
68 funkcjonalność może być rozszerzana o obsługę nowych formatów poprzez
69 ładowane moduły.
70
71 Ten pakiet zawiera wersję skrośną dla Win32.
72
73 %package static
74 Summary:        Static gdk-pixbuf library (cross MinGW32 version)
75 Summary(pl.UTF-8):      Statyczna biblioteka gdk-pixbuf (wersja skrośna MinGW32)
76 Group:          Development/Libraries
77 Requires:       %{name} = %{version}-%{release}
78
79 %description static
80 Static gdk-pixbuf library (cross MinGW32 version).
81
82 %description static -l pl.UTF-8
83 Statyczna biblioteka gdk-pixbuf (wersja skrośna MinGW32).
84
85 %package dll
86 Summary:        DLL gdk-pixbuf libraries for Windows
87 Summary(pl.UTF-8):      Biblioteki DLL gdk-pixbuf dla Windows
88 Group:          Applications/Emulators
89 Requires:       crossmingw32-glib2-dll >= 2.56.0
90 Requires:       wine
91 Conflicts:      crossmingw32-gtk+2-dll < 2.22.0
92
93 %description dll
94 DLL gdk-pixbuf libraries for Windows.
95
96 %description dll -l pl.UTF-8
97 Biblioteki DLL gdk-pixbuf dla Windows.
98
99 %prep
100 %setup -q -n gdk-pixbuf-%{version}
101
102 # disable loaders.cache generation
103 %{__sed} -i -e "/^loaders_cache/,/^loaders_dep/ d" gdk-pixbuf/meson.build
104 # disable tests and thumbnailer (unwanted, generates files using built library/binary)
105 %{__sed} -i -e "/^subdir('tests')/d" meson.build
106 %{__sed} -i -e "/^subdir('thumbnailer')/d" meson.build
107 # disable unused gi-docgen subproject
108 %{__sed} -i -e '/fallback:.*gi-docgen/d' docs/meson.build
109
110 cat > meson-cross.txt <<'EOF'
111 [host_machine]
112 system = 'windows'
113 cpu_family = 'x86'
114 cpu = 'i386'
115 endian='little'
116 [binaries]
117 c = '%{target}-gcc'
118 ar = '%{target}-ar'
119 windres = '%{target}-windres'
120 pkgconfig = 'pkg-config'
121 [properties]
122 ; force gnu99 to disable __STRICT_ANSI__ and unblock fdopen() in mingw32
123 c_args = ['%(echo %{rpmcflags} | sed -e "s/ \+/ /g;s/ /', '/g")', '-std=gnu99']
124 EOF
125
126 %build
127 export PKG_CONFIG_LIBDIR=%{_prefix}/lib/pkgconfig
128 %meson build \
129         --cross-file meson-cross.txt \
130         -Ddocs=false \
131         -Dinstalled_tests=false \
132         -Dintrospection=disabled \
133         -Dman=false \
134         %{?with_gdiplus:-Dnative_windows_loaders=true}
135
136 %ninja_build -C build
137
138 %install
139 rm -rf $RPM_BUILD_ROOT
140
141 %ninja_install -j1 -C build
142
143 install -d $RPM_BUILD_ROOT%{_dlldir}
144 %{__mv} $RPM_BUILD_ROOT%{_prefix}/bin/*.dll $RPM_BUILD_ROOT%{_dlldir}
145
146 %if 0%{!?debug:1}
147 %{target}-strip --strip-unneeded -R.comment -R.note $RPM_BUILD_ROOT%{_dlldir}/*.dll \
148         $RPM_BUILD_ROOT%{_libdir}/gdk-pixbuf-2.0/%{abiver}/loaders/*.dll
149 %{target}-strip -g -R.comment -R.note $RPM_BUILD_ROOT%{_libdir}/*.a
150 %endif
151
152 # shut up check-files
153 %{__rm} $RPM_BUILD_ROOT%{_bindir}/*.exe
154 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/locale
155 %{__rm} -r $RPM_BUILD_ROOT%{_libdir}/gdk-pixbuf-2.0/%{abiver}/loaders/*.dll.a
156
157 %clean
158 rm -rf $RPM_BUILD_ROOT
159
160 %files
161 %defattr(644,root,root,755)
162 %{_libdir}/libgdk_pixbuf-2.0.dll.a
163 %{_includedir}/gdk-pixbuf-2.0
164 %{_pkgconfigdir}/gdk-pixbuf-2.0.pc
165
166 %files static
167 %defattr(644,root,root,755)
168 %{_libdir}/libgdk_pixbuf-2.0.a
169
170 %files dll
171 %defattr(644,root,root,755)
172 %{_dlldir}/libgdk_pixbuf-2.0-*.dll
173 %dir %{_libdir}/gdk-pixbuf-2.0
174 %dir %{_libdir}/gdk-pixbuf-2.0/%{abiver}
175 %dir %{_libdir}/gdk-pixbuf-2.0/%{abiver}/loaders
176 %{_libdir}/gdk-pixbuf-2.0/%{abiver}/loaders/libpixbufloader-*.dll
This page took 0.087076 seconds and 2 git commands to generate.