mingw32-SDL_image and mingw32-SDL_mixer
by Jason Woofenden
Hi all,
I'm pretty new to this packaging and cross-compiling, but I put
together a couple packages anyway:
http://jasonwoof.com/downloads/mingw32-SDL_image-1.2.6-1.fc11.src.rpm
http://jasonwoof.com/downloads/mingw32-SDL_mixer-1.2.8-1.fc11.src.rpm
They seem to work quite well for me, but I don't really know what I'm
doing, so I'd appreciate more knowledgeable folk looking over my spec
files.
Here's what I did and where everything came from: (all in F11)
1) I set up my .rpmmacros so it would store sources in separate
directories by package name-version by adding this line:
%_sourcedir %{_topdir}/SOURCES/%{name}-%{version}
I was worried that multiple source rpms would have files in them with
the same name (which turned out to be the case) and I wanted to make
sure I could tell what packages what files came from.
2) I used yumdownloader to download source rpms for SDL SDL_mixer
SDL_image and SDL and installed them in my local rpmbuild tree
3) I duplicated SOURCES/SDL_image-1.2.6/ to SOURCES/mingw32-SDL_image-1.2.6/
4) I copied SPECS/mingw32-SDL-1.2.13.spec to SPECS/mingw32-SDL_image-1.2.6.spec
5) I edited that new spec file, mostly by looking at existing
SDL_image-1.2.6.spec and pulling useful parts from it. tweaking as
neccesary.
And basically did the same for SDL_mixer.
Some notes:
I didn't modify anything in the SOURCES folder (just copied whole
folders as described above).
I used all the patches that were used for the native versions.
I commented out lines to install (and build in one case) little
executable programs from both packages that I didn't understand the
point of.
I've cross-compiled my game (vor) which uses both of these libraries,
and it works great under wine. (Gets at least 40% better framerate
under wine than it does when compiled for linux.) Though I have not
tested them on Windows.
I have a fedoraproject.org account (so I can edit the wiki and such)
but don't have any connections or access or anything to get these into
the fedora distrobution. If/when they are ready, I'd love someone to
take care of this, or help me do it. Right now I don't even know what
the process is.
Looking forward to hearing your thoughts/feedback.
Take care, - Jason
14 years, 4 months
rpms/mingw32-dlfcn/devel dlfcn-fix-cplusplus-linkage.patch, NONE, 1.1 mingw32-dlfcn.spec, 1.4, 1.5
by Erik van Pienbroek
Author: epienbro
Update of /cvs/pkgs/rpms/mingw32-dlfcn/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv3530/devel
Modified Files:
mingw32-dlfcn.spec
Added Files:
dlfcn-fix-cplusplus-linkage.patch
Log Message:
* Fri Oct 30 2009 Erik van Pienbroek <epienbro(a)fedoraproject.org> - 0-0.7.r11
- Use %global instead of %define
- Automatically generate debuginfo subpackage (F-12+)
- Fixed %defattr line
- Added -static subpackage
- Fixed linker error with C++ applications
dlfcn-fix-cplusplus-linkage.patch:
dlfcn.h | 8 ++++++++
1 file changed, 8 insertions(+)
--- NEW FILE dlfcn-fix-cplusplus-linkage.patch ---
--- dlfcn.h.orig 2009-10-30 15:36:35.357902913 +0100
+++ dlfcn.h 2009-10-30 15:39:51.126664184 +0100
@@ -37,9 +37,17 @@
#define RTLD_DEFAULT 0
#define RTLD_NEXT 0
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void *dlopen ( const char *file, int mode );
int dlclose( void *handle );
void *dlsym ( void *handle, const char *name );
char *dlerror( void );
+#ifdef __cplusplus
+}
+#endif
+
#endif /* DLFCN_H */
Index: mingw32-dlfcn.spec
===================================================================
RCS file: /cvs/pkgs/rpms/mingw32-dlfcn/devel/mingw32-dlfcn.spec,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- mingw32-dlfcn.spec 25 Jul 2009 12:16:02 -0000 1.4
+++ mingw32-dlfcn.spec 30 Oct 2009 14:44:03 -0000 1.5
@@ -1,16 +1,17 @@
-%define __strip %{_mingw32_strip}
-%define __objdump %{_mingw32_objdump}
-%define _use_internal_dependency_generator 0
-%define __find_requires %{_mingw32_findrequires}
-%define __find_provides %{_mingw32_findprovides}
+%global __strip %{_mingw32_strip}
+%global __objdump %{_mingw32_objdump}
+%global _use_internal_dependency_generator 0
+%global __find_requires %{_mingw32_findrequires}
+%global __find_provides %{_mingw32_findprovides}
+%define __debug_install_post %{_mingw32_debug_install_post}
-%define realname dlfcn-win32
+%global realname dlfcn-win32
-%define alphatag r11
+%global alphatag r11
Name: mingw32-dlfcn
Version: 0
-Release: 0.6.%{alphatag}%{?dist}
+Release: 0.7.%{alphatag}%{?dist}
Summary: Implements a wrapper for dlfcn (dlopen dlclose dlsym dlerror)
License: LGPLv2+
@@ -21,12 +22,13 @@ BuildRoot: %{_tmppath}/%{name}-%{ver
BuildArch: noarch
-BuildRequires: mingw32-filesystem >= 49
+BuildRequires: mingw32-filesystem >= 52
BuildRequires: mingw32-gcc
BuildRequires: mingw32-binutils
#BuildRequires: dos2unix
Patch1: dlfcn_configure.patch
+Patch2: dlfcn-fix-cplusplus-linkage.patch
%description
@@ -34,6 +36,18 @@ This library implements a wrapper for dl
around the dynamic link library functions found in the Windows API.
+%package static
+Summary: Static version of the MinGW Windows dlfcn library
+Requires: %{name} = %{version}-%{release}
+Group: Development/Libraries
+
+%description static
+Static version of the MinGW Windows dlfcn library.
+
+
+%{_mingw32_debug_package}
+
+
%prep
%setup -q -n %{realname}-%{alphatag}
@@ -42,6 +56,7 @@ around the dynamic link library function
%{__sed} -i 's/\r//' COPYING
%patch1 -p1
+%patch2 -p0
%build
@@ -49,7 +64,7 @@ around the dynamic link library function
--incdir=%{_mingw32_includedir} \
--cc=i686-pc-mingw32-gcc \
--enable-shared=yes \
- --enable-static=no \
+ --enable-static=yes \
--enable-strip=i686-pc-mingw32-strip
make %{?_smp_mflags}
@@ -64,14 +79,25 @@ rm -rf $RPM_BUILD_ROOT
%files
-%defattr(-,root,root)
+%defattr(-,root,root,-)
%doc README COPYING
%{_mingw32_bindir}/libdl.dll
%{_mingw32_libdir}/libdl.dll.a
%{_mingw32_includedir}/dlfcn.h
+%files static
+%defattr(-,root,root,-)
+%{_mingw32_libdir}/libdl.a
+
%changelog
+* Fri Oct 30 2009 Erik van Pienbroek <epienbro(a)fedoraproject.org> - 0-0.7.r11
+- Use %%global instead of %%define
+- Automatically generate debuginfo subpackage
+- Fixed %%defattr line
+- Added -static subpackage
+- Fixed linker error with C++ applications
+
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> - 0-0.6.r11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
14 years, 5 months
rpms/mingw32-dlfcn/F-12 dlfcn-fix-cplusplus-linkage.patch, NONE, 1.1 mingw32-dlfcn.spec, 1.4, 1.5
by Erik van Pienbroek
Author: epienbro
Update of /cvs/pkgs/rpms/mingw32-dlfcn/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv3530/F-12
Modified Files:
mingw32-dlfcn.spec
Added Files:
dlfcn-fix-cplusplus-linkage.patch
Log Message:
* Fri Oct 30 2009 Erik van Pienbroek <epienbro(a)fedoraproject.org> - 0-0.7.r11
- Use %global instead of %define
- Automatically generate debuginfo subpackage (F-12+)
- Fixed %defattr line
- Added -static subpackage
- Fixed linker error with C++ applications
dlfcn-fix-cplusplus-linkage.patch:
dlfcn.h | 8 ++++++++
1 file changed, 8 insertions(+)
--- NEW FILE dlfcn-fix-cplusplus-linkage.patch ---
--- dlfcn.h.orig 2009-10-30 15:36:35.357902913 +0100
+++ dlfcn.h 2009-10-30 15:39:51.126664184 +0100
@@ -37,9 +37,17 @@
#define RTLD_DEFAULT 0
#define RTLD_NEXT 0
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void *dlopen ( const char *file, int mode );
int dlclose( void *handle );
void *dlsym ( void *handle, const char *name );
char *dlerror( void );
+#ifdef __cplusplus
+}
+#endif
+
#endif /* DLFCN_H */
Index: mingw32-dlfcn.spec
===================================================================
RCS file: /cvs/pkgs/rpms/mingw32-dlfcn/F-12/mingw32-dlfcn.spec,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- mingw32-dlfcn.spec 25 Jul 2009 12:16:02 -0000 1.4
+++ mingw32-dlfcn.spec 30 Oct 2009 14:44:03 -0000 1.5
@@ -1,16 +1,17 @@
-%define __strip %{_mingw32_strip}
-%define __objdump %{_mingw32_objdump}
-%define _use_internal_dependency_generator 0
-%define __find_requires %{_mingw32_findrequires}
-%define __find_provides %{_mingw32_findprovides}
+%global __strip %{_mingw32_strip}
+%global __objdump %{_mingw32_objdump}
+%global _use_internal_dependency_generator 0
+%global __find_requires %{_mingw32_findrequires}
+%global __find_provides %{_mingw32_findprovides}
+%define __debug_install_post %{_mingw32_debug_install_post}
-%define realname dlfcn-win32
+%global realname dlfcn-win32
-%define alphatag r11
+%global alphatag r11
Name: mingw32-dlfcn
Version: 0
-Release: 0.6.%{alphatag}%{?dist}
+Release: 0.7.%{alphatag}%{?dist}
Summary: Implements a wrapper for dlfcn (dlopen dlclose dlsym dlerror)
License: LGPLv2+
@@ -21,12 +22,13 @@ BuildRoot: %{_tmppath}/%{name}-%{ver
BuildArch: noarch
-BuildRequires: mingw32-filesystem >= 49
+BuildRequires: mingw32-filesystem >= 52
BuildRequires: mingw32-gcc
BuildRequires: mingw32-binutils
#BuildRequires: dos2unix
Patch1: dlfcn_configure.patch
+Patch2: dlfcn-fix-cplusplus-linkage.patch
%description
@@ -34,6 +36,18 @@ This library implements a wrapper for dl
around the dynamic link library functions found in the Windows API.
+%package static
+Summary: Static version of the MinGW Windows dlfcn library
+Requires: %{name} = %{version}-%{release}
+Group: Development/Libraries
+
+%description static
+Static version of the MinGW Windows dlfcn library.
+
+
+%{_mingw32_debug_package}
+
+
%prep
%setup -q -n %{realname}-%{alphatag}
@@ -42,6 +56,7 @@ around the dynamic link library function
%{__sed} -i 's/\r//' COPYING
%patch1 -p1
+%patch2 -p0
%build
@@ -49,7 +64,7 @@ around the dynamic link library function
--incdir=%{_mingw32_includedir} \
--cc=i686-pc-mingw32-gcc \
--enable-shared=yes \
- --enable-static=no \
+ --enable-static=yes \
--enable-strip=i686-pc-mingw32-strip
make %{?_smp_mflags}
@@ -64,14 +79,25 @@ rm -rf $RPM_BUILD_ROOT
%files
-%defattr(-,root,root)
+%defattr(-,root,root,-)
%doc README COPYING
%{_mingw32_bindir}/libdl.dll
%{_mingw32_libdir}/libdl.dll.a
%{_mingw32_includedir}/dlfcn.h
+%files static
+%defattr(-,root,root,-)
+%{_mingw32_libdir}/libdl.a
+
%changelog
+* Fri Oct 30 2009 Erik van Pienbroek <epienbro(a)fedoraproject.org> - 0-0.7.r11
+- Use %%global instead of %%define
+- Automatically generate debuginfo subpackage
+- Fixed %%defattr line
+- Added -static subpackage
+- Fixed linker error with C++ applications
+
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> - 0-0.6.r11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
14 years, 5 months
rpms/mingw32-dlfcn/F-11 mingw32-dlfcn.spec,1.3,1.4
by Erik van Pienbroek
Author: epienbro
Update of /cvs/pkgs/rpms/mingw32-dlfcn/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv3530/F-11
Modified Files:
mingw32-dlfcn.spec
Log Message:
* Fri Oct 30 2009 Erik van Pienbroek <epienbro(a)fedoraproject.org> - 0-0.7.r11
- Use %global instead of %define
- Automatically generate debuginfo subpackage (F-12+)
- Fixed %defattr line
- Added -static subpackage
- Fixed linker error with C++ applications
Index: mingw32-dlfcn.spec
===================================================================
RCS file: /cvs/pkgs/rpms/mingw32-dlfcn/F-11/mingw32-dlfcn.spec,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- mingw32-dlfcn.spec 26 Feb 2009 01:02:03 -0000 1.3
+++ mingw32-dlfcn.spec 30 Oct 2009 14:44:02 -0000 1.4
@@ -1,16 +1,16 @@
-%define __strip %{_mingw32_strip}
-%define __objdump %{_mingw32_objdump}
-%define _use_internal_dependency_generator 0
-%define __find_requires %{_mingw32_findrequires}
-%define __find_provides %{_mingw32_findprovides}
+%global __strip %{_mingw32_strip}
+%global __objdump %{_mingw32_objdump}
+%global _use_internal_dependency_generator 0
+%global __find_requires %{_mingw32_findrequires}
+%global __find_provides %{_mingw32_findprovides}
-%define realname dlfcn-win32
+%global realname dlfcn-win32
-%define alphatag r11
+%global alphatag r11
Name: mingw32-dlfcn
Version: 0
-Release: 0.5.%{alphatag}%{?dist}
+Release: 0.7.%{alphatag}%{?dist}
Summary: Implements a wrapper for dlfcn (dlopen dlclose dlsym dlerror)
License: LGPLv2+
@@ -27,6 +27,7 @@ BuildRequires: mingw32-binutils
#BuildRequires: dos2unix
Patch1: dlfcn_configure.patch
+Patch2: dlfcn-fix-cplusplus-linkage.patch
%description
@@ -34,6 +35,15 @@ This library implements a wrapper for dl
around the dynamic link library functions found in the Windows API.
+%package static
+Summary: Static version of the MinGW Windows dlfcn library
+Requires: %{name} = %{version}-%{release}
+Group: Development/Libraries
+
+%description static
+Static version of the MinGW Windows dlfcn library.
+
+
%prep
%setup -q -n %{realname}-%{alphatag}
@@ -42,6 +52,7 @@ around the dynamic link library function
%{__sed} -i 's/\r//' COPYING
%patch1 -p1
+%patch2 -p0
%build
@@ -49,7 +60,7 @@ around the dynamic link library function
--incdir=%{_mingw32_includedir} \
--cc=i686-pc-mingw32-gcc \
--enable-shared=yes \
- --enable-static=no \
+ --enable-static=yes \
--enable-strip=i686-pc-mingw32-strip
make %{?_smp_mflags}
@@ -64,14 +75,27 @@ rm -rf $RPM_BUILD_ROOT
%files
-%defattr(-,root,root)
+%defattr(-,root,root,-)
%doc README COPYING
%{_mingw32_bindir}/libdl.dll
%{_mingw32_libdir}/libdl.dll.a
%{_mingw32_includedir}/dlfcn.h
+%files static
+%defattr(-,root,root,-)
+%{_mingw32_libdir}/libdl.a
+
%changelog
+* Fri Oct 30 2009 Erik van Pienbroek <epienbro(a)fedoraproject.org> - 0-0.7.r11
+- Use %%global instead of %%define
+- Fixed %%defattr line
+- Added -static subpackage
+- Fixed linker error with C++ applications
+
+* Sat Jul 25 2009 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> - 0-0.6.r11
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
+
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> - 0-0.5.r11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
14 years, 5 months