diff options
author | marino <marino@pkgsrc.org> | 2012-08-27 13:27:33 +0000 |
---|---|---|
committer | marino <marino@pkgsrc.org> | 2012-08-27 13:27:33 +0000 |
commit | 083db2b5366b93776616f7abc5e9a1035d4808b8 (patch) | |
tree | ee35f5ca0a3d66120e39c72667db1747370ee7b5 /emulators/openmsx | |
parent | de35a878a7ace01e20ded64b8ea994ec1c0faac3 (diff) | |
download | pkgsrc-083db2b5366b93776616f7abc5e9a1035d4808b8.tar.gz |
emulators/openmsx: Fix build for NetBSD
There were two problems building openMSX on NetBSD:
1) The was a name conflict with the funcion bswap16. This only appeared
on one file, so the function was prefixed with msx_ to solve it.
2) freetype-config is not located on $PREFIX on NetBSD with native X11.
Normally the wrappers abstract this but openmsx was making assumptions
and using absolute paths. The solution was to set the distroRoot
value to "None" which tells the configure process to not use a path
and those finds freetype-configure through the search path.
I compiled it, installed it, and executed openMSX with these patches.
Diffstat (limited to 'emulators/openmsx')
-rw-r--r-- | emulators/openmsx/distinfo | 4 | ||||
-rw-r--r-- | emulators/openmsx/patches/patch-build_libraries.py | 26 | ||||
-rw-r--r-- | emulators/openmsx/patches/patch-src_video_AviWriter.cc | 25 |
3 files changed, 54 insertions, 1 deletions
diff --git a/emulators/openmsx/distinfo b/emulators/openmsx/distinfo index 8951f406f31..d4f391b4170 100644 --- a/emulators/openmsx/distinfo +++ b/emulators/openmsx/distinfo @@ -1,8 +1,10 @@ -$NetBSD: distinfo,v 1.10 2012/08/26 09:07:21 marino Exp $ +$NetBSD: distinfo,v 1.11 2012/08/27 13:27:33 marino Exp $ SHA1 (openmsx-0.9.0.tar.gz) = a8e396d5feb60bd7df8fbef0b5e6d41e5b0e5826 RMD160 (openmsx-0.9.0.tar.gz) = 9b7f01ba3dcedf5ebba920983938a25db561c26d Size (openmsx-0.9.0.tar.gz) = 2963005 bytes SHA1 (patch-build_detectsys.py) = 9d88783a8c00a074e5dc149fce2dbeb20d12cb9e +SHA1 (patch-build_libraries.py) = 2981999e58e12986fd8b45df656cc898094ffe9b SHA1 (patch-build_probe.py) = c083d5950dae95f12d4c0b5c7d1a2cac89ad786e SHA1 (patch-build_version.py) = 2b3e53a0499befb8c18760e80fdbc279cc6aefc8 +SHA1 (patch-src_video_AviWriter.cc) = 5ea878e954ac4a6532c3618ed949c9de986ded33 diff --git a/emulators/openmsx/patches/patch-build_libraries.py b/emulators/openmsx/patches/patch-build_libraries.py new file mode 100644 index 00000000000..b9f740a79ee --- /dev/null +++ b/emulators/openmsx/patches/patch-build_libraries.py @@ -0,0 +1,26 @@ +$NetBSD: patch-build_libraries.py,v 1.1 2012/08/27 13:27:33 marino Exp $ + +The library check script is making assumptions about program locations. +The secret is define distroRoot as "None" so that no absolute path is +prepended on the binary. + +freetype-config is tricky because on NetBSD with native X11, it will +not be found at $PREFIX, but rather a X11 path. The wrappers handle +this so use distroRoot=None to let configure search for freetype-config +and find it in the wrapper directories. + +--- build/libraries.py.orig 2012-08-12 12:29:37.000000000 +0000 ++++ build/libraries.py +@@ -168,10 +168,8 @@ class FreeType(Library): + + @classmethod + def getConfigScript(cls, platform, linkStatic, distroRoot): +- if platform in ('netbsd', 'openbsd'): +- if distroRoot == '/usr/local': +- # FreeType is located in the X11 tree, not the ports tree. +- distroRoot = '/usr/X11R6' ++ # let pkgsrc wrappers handle this ++ distroRoot = None + return super(FreeType, cls).getConfigScript( + platform, linkStatic, distroRoot + ) diff --git a/emulators/openmsx/patches/patch-src_video_AviWriter.cc b/emulators/openmsx/patches/patch-src_video_AviWriter.cc new file mode 100644 index 00000000000..23f10fbf10f --- /dev/null +++ b/emulators/openmsx/patches/patch-src_video_AviWriter.cc @@ -0,0 +1,25 @@ +$NetBSD: patch-src_video_AviWriter.cc,v 1.1 2012/08/27 13:27:33 marino Exp $ + +NetBSD already has bswap16 defined, so rename this function to avoid +name conflict. + +--- src/video/AviWriter.cc.orig 2012-08-12 12:29:37.000000000 +0000 ++++ src/video/AviWriter.cc +@@ -259,7 +259,7 @@ void AviWriter::addAviChunk(const char* + writeLE4(&index[idxsize + 12], size); + } + +-static inline unsigned short bswap16(unsigned short val) ++static inline unsigned short msx_bswap16(unsigned short val) + { + return ((val & 0xFF00) >> 8) | ((val & 0x00FF) << 8); + } +@@ -277,7 +277,7 @@ void AviWriter::addFrame(FrameSource* fr + if (OPENMSX_BIGENDIAN) { + VLA(short, buf, samples); + for (unsigned i = 0; i < samples; ++i) { +- buf[i] = bswap16(sampleData[i]); ++ buf[i] = msx_bswap16(sampleData[i]); + } + addAviChunk("01wb", samples * sizeof(short), buf, 0); + } else { |