Skip to content

Commit

Permalink
an attempt to do what has to be done
Browse files Browse the repository at this point in the history
  • Loading branch information
20kdc committed Mar 8, 2023
1 parent ac3278b commit af8f9e7
Show file tree
Hide file tree
Showing 28 changed files with 173 additions and 126 deletions.
6 changes: 3 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ opt_pkgs=''
# gtk deps
cairo_req='cairo-pdf cairo-ps pangocairo'
#
gtk_req="gtk+-3.0 >= $GTK_VERSION_REQ gtk+-unix-print-3.0 librsvg-2.0 >= 2.32.0"
gtk_req="gtk+-3.0 >= $GTK_VERSION_REQ librsvg-2.0 >= 2.32.0"
dnl cairo-fc is needed but only available on cairo > 1.10
dnl http://bugzilla.abisource.com/show_bug.cgi?id=13265
PKG_CHECK_EXISTS(cairo >= 1.10, [gtk_req="$gtk_req cairo-fc"],[])
Expand Down Expand Up @@ -157,7 +157,7 @@ case ${host_os} in
;;
*mingw*)
PLATFORM="win"
TOOLKIT="win"
TOOLKIT="gtk"
;;
*)
PLATFORM="unix"
Expand Down Expand Up @@ -687,7 +687,7 @@ elif test "$TOOLKIT" = "qt"; then
else
SYSTEM_CFLAGS=$PNG_CFLAGS
SYSTEM_LIBS="$PNG_LIBS -ljpeg"
deps_pkgs="$deps_pkgs $gtk_pkgs x11"
deps_pkgs="$deps_pkgs $gtk_pkgs"
fi

PKG_CHECK_MODULES(DEPS,[$deps_pkgs])
Expand Down
49 changes: 49 additions & 0 deletions mxe/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
MXE is licensed under the MIT Licence. The makefiles and utilities under
`plugins/`, `src/`, and `tools/` all share this licence.

> Copyright (c) 2007-2016
>
> * Volker Diels-Grabsch
> * Mark Brand
> * Tony Theodore
> * Martin Gerhardy
> * Tiancheng "Timothy" Gu
> * Boris Nagaev
> * ... and many other [contributors][contributors]
>
> (contact via the [project mailing list][mailing-list] or
> [issue tracker][issue-tracker])
>
> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
> in the Software without restriction, including without limitation the rights
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> copies of the Software, and to permit persons to whom the Software is
> furnished to do so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included in all
> copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
> SOFTWARE.
MXE distributes code from the following projects in the `ext/` directory:

- [GNU config.guess][config.guess] [GPL3+ with Autoconf exception]
- [GNU Make Standard Library][gmsl] [BSD 3-clause]

The [packages][packages] downloaded by MXE (ending up in `pkg/`) each
have their own licence(s). Please see the individual source trees and/or
websites for further details.

[contributors]: https://github.com/mxe/mxe/graphs/contributors
[mailing-list]: https://lists.nongnu.org/mailman/listinfo/mingw-cross-env-list
[issue-tracker]: https://github.com/mxe/mxe/issues
[config.guess]: https://github.com/mxe/mxe/blob/master/ext/config.guess#L3-L27
[gmsl]: https://github.com/mxe/mxe/blob/master/ext/gmsl#L8-L40
[packages]: https://mxe.cc/#packages
8 changes: 8 additions & 0 deletions mxe/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
You WILL need additional work to make this go.

make MXE_PLUGIN_DIRS=plugins/apps/abiword abiword

notes:

* need to remove the manpages to get Enchant to build
* need to remove the -Werror flags to get libgoffice to build
14 changes: 14 additions & 0 deletions mxe/abiword.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This file is part of MXE. See LICENSE.md for licensing information.

# TOOLKIT target for windows must be forced to GTK

PKG := abiword
$(PKG)_DEPS := cc libgsf libxslt enchant wv goffice

define $(PKG)_BUILD
cd '$(BUILD_DIR)' && '/media/modus/External2/abiword/abiword/configure' \
$(MXE_CONFIGURE_OPTS) \
--infodir='$(BUILD_DIR)/sink'
$(MAKE) -C $(BUILD_DIR) -j '$(JOBS)'
$(MAKE) -C $(BUILD_DIR) -j 1 install $(MXE_DISABLE_DOCS)
endef
14 changes: 14 additions & 0 deletions mxe/enchant.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This file is part of MXE. See LICENSE.md for licensing information.

# need to remove the manpages to get this to work!

PKG := enchant
$(PKG)_DEPS := cc

define $(PKG)_BUILD
cd '$(BUILD_DIR)' && '/media/modus/External2/abiword/enchant/configure' \
$(MXE_CONFIGURE_OPTS) \
--infodir='$(BUILD_DIR)/sink'
$(MAKE) -C $(BUILD_DIR) -j '$(JOBS)'
$(MAKE) -C $(BUILD_DIR) -j 1 install $(MXE_DISABLE_DOCS)
endef
14 changes: 14 additions & 0 deletions mxe/goffice.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This file is part of MXE. See LICENSE.md for licensing information.

# need to remove the -Werror flags to get this to work

PKG := goffice
$(PKG)_DEPS := cc libgsf librsvg

define $(PKG)_BUILD
cd '$(BUILD_DIR)' && PKG_CONFIG=/media/modus/External2/mxe/usr/bin/i686-w64-mingw32.static-pkg-config '/media/modus/External2/abiword/goffice-0.10.55/configure' \
$(MXE_CONFIGURE_OPTS) \
--infodir='$(BUILD_DIR)/sink'
$(MAKE) -C $(BUILD_DIR) -j '$(JOBS)'
$(MAKE) -C $(BUILD_DIR) -j 1 install $(MXE_DISABLE_DOCS)
endef
12 changes: 12 additions & 0 deletions mxe/wv.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file is part of MXE. See LICENSE.md for licensing information.

PKG := wv
$(PKG)_DEPS := cc libgsf

define $(PKG)_BUILD
cd '$(BUILD_DIR)' && PKG_CONFIG=/media/modus/External2/mxe/usr/bin/i686-w64-mingw32.static-pkg-config '/media/modus/External2/abiword/wv/configure' \
$(MXE_CONFIGURE_OPTS) \
--infodir='$(BUILD_DIR)/sink'
$(MAKE) -C $(BUILD_DIR) -j '$(JOBS)'
$(MAKE) -C $(BUILD_DIR) -j 1 install $(MXE_DISABLE_DOCS)
endef
1 change: 1 addition & 0 deletions src/af/ev/win/ev_Win32Menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include <windows.h>
#include "ut_types.h"
#include "ut_vector.h"
#include "xap_Types.h"
#include "ev_Menu.h"
#include "ut_color.h"
Expand Down
2 changes: 1 addition & 1 deletion src/af/ev/win/ev_Win32Toolbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ bool EV_Win32Toolbar::synthesize(void)
bool bText = false;
std::string value;
m_pWin32App->getPrefsValue(XAP_PREF_KEY_ToolbarAppearance, value);
UT_return_val_if_fail(!value.empty());
UT_return_val_if_fail(!value.empty(),false);

if (g_ascii_strcasecmp(value.c_str(), "icon") == 0)
{
Expand Down
2 changes: 2 additions & 0 deletions src/af/ev/win/ev_Win32Toolbar.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

#include "ut_types.h"
#include "ut_vector.h"
#include "ut_misc.h"
#include "ut_assert.h"
#include "xap_Types.h"
#include "ev_Toolbar.h"
#include "xav_Listener.h"
Expand Down
2 changes: 1 addition & 1 deletion src/af/gr/win/gr_Win32Graphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ class ABI_EXPORT GR_Win32Graphics : public GR_Graphics
virtual void clearArea(UT_sint32, UT_sint32, UT_sint32, UT_sint32);

virtual void drawImage(GR_Image* pImg, UT_sint32 xDest, UT_sint32 yDest);
virtual GR_Image* createNewImage(const char* pszName, const UT_ContsByteBufPtr & pBB, const std::string& mimetype,
virtual GR_Image* createNewImage(const char* pszName, const UT_ConstByteBufPtr & pBB, const std::string& mimetype,
UT_sint32 iDisplayWidth, UT_sint32 iDisplayHeight, GR_Image::GRType iType = GR_Image::GRT_Raster);

virtual bool queryProperties(GR_Graphics::Properties gp) const;
Expand Down
6 changes: 3 additions & 3 deletions src/af/gr/win/gr_Win32Image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ bool GR_Win32Image::hasAlpha(void) const
return false;
}

bool GR_Win32Image::convertFromBuffer(const UT_ByteBuf* pBB, const std::string& mimetype, UT_sint32 iDisplayWidth, UT_sint32 iDisplayHeight)
bool GR_Win32Image::convertFromBuffer(const UT_ConstByteBufPtr & pBB, const std::string& mimetype, UT_sint32 iDisplayWidth, UT_sint32 iDisplayHeight)
{
if (mimetype == "image/png")
return _convertFromPNG(pBB, iDisplayWidth, iDisplayHeight);
Expand Down Expand Up @@ -127,7 +127,7 @@ static void _png_error(png_structp png_ptr, png_const_charp message)

#endif

bool GR_Win32Image::convertToBuffer(UT_ByteBuf** ppBB) const
bool GR_Win32Image::convertToBuffer(UT_ConstByteBufPtr & ppBB) const
{
/*
The purpose of this routine is to convert our DIB (m_pDIB)
Expand Down Expand Up @@ -648,7 +648,7 @@ bool GR_Win32Image::_convertFromPNG(const UT_ByteBuf* pBB, UT_sint32 iDisplayWid
return true;
}

bool GR_Win32Image::_convertFromJPEG(const UT_ByteBuf* pBB, UT_sint32 iDisplayWidth, UT_sint32 iDisplayHeight)
bool GR_Win32Image::_convertFromJPEG(const UT_ConstByteBufPtr & pBB, UT_sint32 iDisplayWidth, UT_sint32 iDisplayHeight)
{
UT_sint32 iImageWidth;
UT_sint32 iImageHeight;
Expand Down
8 changes: 4 additions & 4 deletions src/af/gr/win/gr_Win32Image.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class ABI_EXPORT GR_Win32Image : public GR_RasterImage
GR_Win32Image(const char* szName);
virtual ~GR_Win32Image();

virtual bool convertToBuffer(UT_ByteBuf** ppBB) const;
virtual bool convertFromBuffer(const UT_ByteBuf* pBB, const std::string& mimetype, UT_sint32 iDisplayWidth, UT_sint32 iDisplayHeight);
virtual bool convertToBuffer(UT_ConstByteBufPtr & ppBB) const;
virtual bool convertFromBuffer(const UT_ConstByteBufPtr & pBB, const std::string& mimetype, UT_sint32 iDisplayWidth, UT_sint32 iDisplayHeight);

void setDIB(BITMAPINFO *pDIB) { m_pDIB = pDIB; if (m_pDIB) setDisplaySize(m_pDIB->bmiHeader.biWidth,m_pDIB->bmiHeader.biHeight); }
inline BITMAPINFO* getDIB(void) const { return m_pDIB; }
Expand All @@ -46,8 +46,8 @@ class ABI_EXPORT GR_Win32Image : public GR_RasterImage
BITMAPINFO* m_pDIB;

private:
bool _convertFromPNG(const UT_ByteBuf* pBB, UT_sint32 iDisplayWidth, UT_sint32 iDisplayHeight);
bool _convertFromJPEG(const UT_ByteBuf* pBB, UT_sint32 iDisplayWidth, UT_sint32 iDisplayHeight);
bool _convertFromPNG(const UT_ConstByteBufPtr & pBB, UT_sint32 iDisplayWidth, UT_sint32 iDisplayHeight);
bool _convertFromJPEG(const UT_ConstByteBufPtr & pBB, UT_sint32 iDisplayWidth, UT_sint32 iDisplayHeight);
};

#endif /* GR_WIN32IMAGE_H */
4 changes: 0 additions & 4 deletions src/af/util/unix/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ AM_CPPFLAGS = \

libunix_la_SOURCES = \
ut_debugmsg.cpp \
ut_files.cpp \
ut_files.h \
ut_mutexImpl.h \
ut_path.cpp \
ut_sleep.h \
Expand All @@ -16,8 +14,6 @@ libunix_la_SOURCES = \
ut_unixIdle.cpp \
ut_unixIdle.h \
ut_unixMisc.cpp \
ut_unixColor.cpp \
ut_unixColor.h \
ut_unixTimer.cpp \
ut_unixTimer.h

1 change: 0 additions & 1 deletion src/af/util/win/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ libwin_la_SOURCES = \
ut_Win32Misc.cpp \
ut_Win32OS.cpp \
ut_Win32OS.h \
ut_Win32String.cpp \
ut_Win32Timer.cpp \
ut_Win32Timer.h \
ut_Win32Uuid.cpp \
Expand Down
89 changes: 0 additions & 89 deletions src/af/util/win/ut_Win32String.cpp

This file was deleted.

4 changes: 4 additions & 0 deletions src/af/util/win/ut_debugmsg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@

#include "ut_debugmsg.h"

void UT_Debug_Init()
{
}

// TODO This is Win32-specific, and should not be.

void _UT_OutputMessage(const char *s, ...)
Expand Down
4 changes: 4 additions & 0 deletions src/af/util/xp/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ libxp_la_SOURCES = \
ut_endian.h \
ut_exception.h \
ut_export.h \
ut_files.cpp \
ut_files.h \
ut_go_file.cpp \
ut_go_file.h \
ut_growbuf.cpp \
Expand Down Expand Up @@ -95,6 +97,8 @@ libxp_la_SOURCES = \
ut_unicode.h \
ut_units.cpp \
ut_units.h \
ut_unixColor.cpp \
ut_unixColor.h \
ut_uuid.cpp \
ut_uuid.h \
ut_vector.h \
Expand Down
6 changes: 6 additions & 0 deletions src/af/util/unix/ut_files.cpp → src/af/util/xp/ut_files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,13 @@ bool UT_createDirectoryIfNecessary(const char * szDir, bool publicdir)

bool success = true;
mode_t old_mask = umask (0);
#ifdef _WIN32
// glib almost certainly has a better way to do this
// but let's put out the fires first, no?
if (mkdir (szDir))
#else
if (mkdir (szDir, publicdir ? 0775 : 0700))
#endif
{
UT_DEBUGMSG(("Could not create Directory [%s].\n", szDir));
success = false;
Expand Down
File renamed without changes.
Loading

0 comments on commit af8f9e7

Please sign in to comment.