[packages/mtpaint] - build fixes
qboosh
qboosh at pld-linux.org
Tue Oct 7 20:11:25 CEST 2025
commit 45091a5a01d522f61b6a600e9ab431814fd284a2
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Tue Oct 7 20:14:36 2025 +0200
- build fixes
mtpaint-flags.patch | 107 +++++++++++++++++++++++++++------------------------
mtpaint-gcc.patch | 13 +++++++
mtpaint-libpng.patch | 20 ----------
mtpaint.spec | 9 ++++-
4 files changed, 77 insertions(+), 72 deletions(-)
---
diff --git a/mtpaint.spec b/mtpaint.spec
index 7d03747..d6ab077 100644
--- a/mtpaint.spec
+++ b/mtpaint.spec
@@ -8,6 +8,8 @@ Group: X11/Applications/Graphics
Source0: https://downloads.sourceforge.net/mtpaint/%{name}-%{version}.tar.bz2
# Source0-md5: bd50c57259e22a96989b9c923743d1d0
Source1: %{name}.desktop
+Patch0: %{name}-gcc.patch
+Patch1: %{name}-flags.patch
URL: https://mtpaint.sourceforge.net/
BuildRequires: gettext-tools
BuildRequires: giflib-devel
@@ -36,16 +38,19 @@ Prosty program graficzny oparty na bibliotece GTK+.
%prep
%setup -q
+%patch -P0 -p1
+%patch -P1 -p1
%build
+CC="%{__cc}" \
./configure debug gtk3 thread GIF man pod intl jpeg jp2v2 lcms2 tiff \
--mandir=%{_mandir} \
--prefix=%{_prefix}
-cat >> _conf.txt <<EOF
+cat >> _conf.txt <<'EOF'
LDFLAG += %{rpmldflags}
CFLAG += %{rpmcflags}
-CC = %{__cc} -Wall -Wno-pointer-sign
+#CC = %{__cc} -Wall -Wno-pointer-sign -Wno-pointer-to-int-cast
EOF
%{__make}
diff --git a/mtpaint-flags.patch b/mtpaint-flags.patch
index 3b6e423..668d7c2 100644
--- a/mtpaint-flags.patch
+++ b/mtpaint-flags.patch
@@ -1,52 +1,59 @@
-diff -ur mtpaint-3.31.orig/configure mtpaint-3.31/configure
---- mtpaint-3.31.orig/configure 2009-04-15 20:46:26.000000000 +0200
-+++ mtpaint-3.31/configure 2009-10-12 23:46:03.784369172 +0200
-@@ -482,7 +482,7 @@
- AS_NEEDED="-Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
+--- mtpaint-3.50/configure.orig 2025-10-07 20:02:50.525411967 +0200
++++ mtpaint-3.50/configure 2025-10-07 20:02:53.965432132 +0200
+@@ -492,10 +492,6 @@ then
+ # !!! Questionable, now; need retesting, and proper cross-configuring too
+ # With Clang, target pentium4; no incompatible HW expected in the wild,
+ # and anything lesser results in much slower code
+- case $ARCH in
+- i?86) HAVE_CLANG && MARCH=${MARCH:--march=pentium4}
+- MARCH=${MARCH:--march=i386};;
+- esac
+ CFLAGS="-O2 $MARCH"
+ # Add optimizations which are proven to really make mtPaint code faster
+ if HAVE_CLANG
+@@ -506,8 +502,6 @@ then
+ else # GCC 3.x
+ CFLAGS="$CFLAGS -fweb"
fi
+- # Do not add unneeded dependencies
+- AS_NEEDED="-Wl,--as-needed"
+ # Disable GTK+ debug code
+ DEFS="$DEFS -DGTK_NO_CHECK_CASTS -DG_DISABLE_CAST_CHECKS"
+ elif [ "$OPTS" = DEBUG ]
+@@ -523,7 +517,6 @@ else # $OPTS = CFLAGS
+ MARCH=
+ # And leave CFLAGS alone
+ fi
+-[ "$OPTS" != DEBUG ] && LDFLAGS="-s $LDFLAGS" # Strip debug info
+ # Set Windows-specific flags
+ if [ "$OS" != "${OS#MinGW/}" ]
+ then
+@@ -834,7 +827,8 @@ MT_PREFIX="$MT_PREFIX"
+ MT_DATAROOT="$MT_DATAROOT"
+ MT_LANG_DEST="$MT_LOCDIR"
+ MT_MAN_DEST="$MT_MANDIR"
+-LDFLAG = $AS_NEEDED $LIBS $LDFLAGS
++LDFLAG = $AS_NEEDED $LDFLAGS
++LIB = $LIBS
+ CFLAG = $DEFS $INCLUDES $CPPFLAGS $CFLAGS
+ subdirs = $MAKE_DIRS
+ BIN_INSTALL="$MT_BINDIR"
+--- mtpaint-3.50/src/Makefile.orig 2020-03-04 03:44:05.000000000 +0100
++++ mtpaint-3.50/src/Makefile 2025-10-07 19:59:11.350793850 +0200
+@@ -3,6 +3,7 @@ include ../_conf.txt
+ # Generate identical object files if possible
+ CFLAGS = $(CFLAG) $(SET_RANDSEED)
+ LDFLAGS = $(LDFLAG)
++LIBS = $(LIB)
+
+ BIN = mtpaint$(EXEEXT)
+
+@@ -12,7 +13,7 @@ OBJS = main.o mainwindow.o inifile.o png
+ cpick.o thread.o vcode.o
+
+ $(BIN): $(OBJS)
+- $(CC) $(OBJS) -o $(BIN) $(LDFLAGS)
++ $(CC) $(CFLAG) $(LDFLAGS) $(OBJS) -o $(BIN) $(LIBS)
+
+ $(OBJS): *.h graphics/*
-- L_EX=$AS_NEEDED
-+ #L_EX=$AS_NEEDED
- I_EX=$HAVE_FUNCS
- if [ "$NGIF" != "NO" ]
- then
-@@ -552,7 +552,7 @@
-
- if [ "$DEBUG" = NO ]
- then
-- GTK_LIB="$GTK_LIB -s"
-+ GTK_LIB="$GTK_LIB"
- else
- I_EX="$I_EX -ggdb"
- fi
-@@ -595,7 +595,7 @@
-
- I_EX="$I_EX -DVERSION=\"\\\"$MT_VERSION\"\\\""
- GTK_INCLUDE="$GTK_INCLUDE $I_EX"
-- echo "LDFLAG = $L_EX $GTK_LIB" >> $GTK_FILE
-+ echo "LIB = $L_EX $GTK_LIB" >> $GTK_FILE
-
- if [ "$CFLAG" ]
- then
-diff -ur mtpaint-3.31.orig/src/Makefile mtpaint-3.31/src/Makefile
---- mtpaint-3.31.orig/src/Makefile 2008-11-08 18:31:59.000000000 +0100
-+++ mtpaint-3.31/src/Makefile 2009-10-12 23:40:38.721067506 +0200
-@@ -1,7 +1,8 @@
- include ../_conf.txt
-
- CFLAGS = $(CFLAG)
--LDFLAGS = $(LDFLAG) $(GLIB_LIB)
-+LDFLAGS = $(LDFLAG)
-+LIBS = $(LIB) $(GLIB_LIB)
-
- BIN = mtpaint
-
-@@ -10,7 +11,7 @@
- toolbar.o channels.o csel.o shifter.o spawn.o font.o fpick.o icons.o cpick.o
-
- $(BIN): main.o $(OBJS)
-- $(CC) main.o $(OBJS) -o $(BIN) $(LDFLAGS)
-+ $(CC) $(CFLAGS) $(LDFLAGS) main.o $(OBJS) -o $(BIN) $(LIBS)
-
- .c.o:
- $(CC) $(CFLAGS) -c -o $*.o $*.c
diff --git a/mtpaint-gcc.patch b/mtpaint-gcc.patch
new file mode 100644
index 0000000..b4eb847
--- /dev/null
+++ b/mtpaint-gcc.patch
@@ -0,0 +1,13 @@
+--- mtpaint-3.50/configure.orig 2020-12-31 16:02:20.000000000 +0100
++++ mtpaint-3.50/configure 2025-10-07 17:42:21.078823837 +0200
+@@ -376,8 +376,8 @@ IS_LIB()
+ }
+ CAN_DO()
+ {
+- echo "main() { $1; }" > _conf.c
+- $MT_TESTCOMP _conf.c -o _conf.tmp > /dev/null 2>&1
++ echo "int main() { $1; }" > _conf.c
++ $MT_TESTCOMP -Wno-implicit-function-declaration _conf.c -o _conf.tmp >> config.log 2>&1
+ }
+ HAVE_FUNC()
+ {
diff --git a/mtpaint-libpng.patch b/mtpaint-libpng.patch
deleted file mode 100644
index 3cdaf3e..0000000
--- a/mtpaint-libpng.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- mtpaint-3.31/src/png.c.orig 2010-02-22 22:41:06.935087701 +0100
-+++ mtpaint-3.31/src/png.c 2010-02-22 22:41:55.195067047 +0100
-@@ -539,7 +539,7 @@
- if (settings->bpp == 3)
- {
- png_set_strip_16(png_ptr);
-- png_set_gray_1_2_4_to_8(png_ptr);
-+ png_set_expand_gray_1_2_4_to_8(png_ptr);
- png_set_palette_to_rgb(png_ptr);
- png_set_gray_to_rgb(png_ptr);
-
-@@ -644,7 +644,7 @@
- png_set_strip_alpha(png_ptr);
- png_set_packing(png_ptr);
- if ((color_type == PNG_COLOR_TYPE_GRAY) && (bit_depth < 8))
-- png_set_gray_1_2_4_to_8(png_ptr);
-+ png_set_expand_gray_1_2_4_to_8(png_ptr);
- for (i = 0; i < height; i++)
- {
- row_pointers[i] = settings->img[CHN_IMAGE] + i * width;
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/mtpaint.git/commitdiff/45091a5a01d522f61b6a600e9ab431814fd284a2
More information about the pld-cvs-commit
mailing list