Skip to content
This repository was archived by the owner on Oct 15, 2025. It is now read-only.

Commit 4151471

Browse files
committed
freeimage: unbundle patches
1 parent 120da49 commit 4151471

File tree

7 files changed

+189
-132
lines changed

7 files changed

+189
-132
lines changed

freeimage/3.17.0-linux.patch

Lines changed: 0 additions & 82 deletions
This file was deleted.

freeimage/debian-to-homebrew.patch

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
diff --git a/Makefile.fip b/Makefile.fip
2+
index 046a835..2dbcf10 100644
3+
--- a/Makefile.fip
4+
+++ b/Makefile.fip
5+
@@ -11,7 +11,7 @@ INSTALLDIR ?= $(DESTDIR)/usr/lib
6+
# Converts cr/lf to just lf
7+
DOS2UNIX = dos2unix
8+
9+
-LIBRARIES = -lstdc++ -ljxrglue $(shell pkg-config --libs libjpeg libopenjp2 libpng libraw libtiff-4 libwebpmux OpenEXR zlib) -lm
10+
+LIBRARIES = -lstdc++ -lfreeimage -ljxrglue $(shell pkg-config --libs libjpeg libopenjp2 libpng libraw libtiff-4 libwebp libwebpmux OpenEXR zlib) -lm
11+
12+
MODULES = $(SRCS:.c=.o)
13+
MODULES := $(MODULES:.cpp=.o)
14+
diff --git a/Makefile.gnu b/Makefile.gnu
15+
index d4a0adf..a16ac8d 100644
16+
--- a/Makefile.gnu
17+
+++ b/Makefile.gnu
18+
@@ -23,12 +23,12 @@ override CFLAGS += -DOPJ_STATIC
19+
override CFLAGS += -DNO_LCMS
20+
# LibJXR
21+
override CFLAGS += -DDISABLE_PERF_MEASUREMENT -D__ANSI__
22+
-override CFLAGS += $(INCLUDE) -I/usr/include/jxrlib $(shell pkg-config --cflags libjpeg libopenjp2 libpng libraw libtiff-4 libwebpmux OpenEXR zlib)
23+
+override CFLAGS += $(INCLUDE) -I@@HOMEBREW_PREFIX@@/opt/jxrlib/include/jxrlib $(shell pkg-config --cflags libjpeg libopenjp2 libpng libraw libtiff-4 libwebp libwebpmux OpenEXR zlib)
24+
CXXFLAGS ?= -O3 -fPIC
25+
override CXXFLAGS += -fexceptions -fvisibility=hidden -Wno-ctor-dtor-privacy
26+
# LibJXR
27+
override CXXFLAGS += -D__ANSI__
28+
-override CXXFLAGS += $(INCLUDE) -I/usr/include/jxrlib $(shell pkg-config --cflags libjpeg libopenjp2 libpng libraw libtiff-4 libwebpmux OpenEXR zlib)
29+
+override CXXFLAGS += $(INCLUDE) -I@@HOMEBREW_PREFIX@@/opt/jxrlib/include/jxrlib $(shell pkg-config --cflags libjpeg libopenjp2 libpng libraw libtiff-4 libwebp libwebpmux OpenEXR zlib)
30+
31+
TARGET = freeimage
32+
STATICLIB = lib$(TARGET).a

freeimage/head-linux.patch

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
diff --git a/Makefile.fip b/Makefile.fip
2+
index 660a0265..b3583393 100644
3+
--- a/Makefile.fip
4+
+++ b/Makefile.fip
5+
@@ -76,10 +76,10 @@ $(SHAREDLIB): $(MODULES)
6+
7+
install:
8+
install -d $(INCDIR) $(INSTALLDIR)
9+
- install -m 644 -o root -g root $(HEADER) $(INCDIR)
10+
- install -m 644 -o root -g root $(HEADERFIP) $(INCDIR)
11+
- install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)
12+
- install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
13+
+ install -m 644 $(HEADER) $(INCDIR)
14+
+ install -m 644 $(HEADERFIP) $(INCDIR)
15+
+ install -m 644 $(STATICLIB) $(INSTALLDIR)
16+
+ install -m 755 $(SHAREDLIB) $(INSTALLDIR)
17+
ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME)
18+
ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME)
19+
20+
diff --git a/Makefile.gnu b/Makefile.gnu
21+
index a4f26013..4ae993af 100644
22+
--- a/Makefile.gnu
23+
+++ b/Makefile.gnu
24+
@@ -75,9 +75,9 @@ $(SHAREDLIB): $(MODULES)
25+
26+
install:
27+
install -d $(INCDIR) $(INSTALLDIR)
28+
- install -m 644 -o root -g root $(HEADER) $(INCDIR)
29+
- install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)
30+
- install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
31+
+ install -m 644 $(HEADER) $(INCDIR)
32+
+ install -m 644 $(STATICLIB) $(INSTALLDIR)
33+
+ install -m 755 $(SHAREDLIB) $(INSTALLDIR)
34+
ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME)
35+
ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME)
36+
# ldconfig
Lines changed: 21 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,8 @@
11
diff --git a/Makefile.fip b/Makefile.fip
2-
old mode 100755
3-
new mode 100644
4-
index b59c419..6e177fc
2+
index 660a0265..30199ae9 100644
53
--- a/Makefile.fip
64
+++ b/Makefile.fip
7-
@@ -5,8 +5,9 @@ include fipMakefile.srcs
8-
9-
# General configuration variables:
10-
DESTDIR ?= /
11-
-INCDIR ?= $(DESTDIR)/usr/include
12-
-INSTALLDIR ?= $(DESTDIR)/usr/lib
13-
+PREFIX ?= /usr/local
14-
+INCDIR ?= $(DESTDIR)$(PREFIX)/include
15-
+INSTALLDIR ?= $(DESTDIR)$(PREFIX)/lib
16-
17-
# Converts cr/lf to just lf
18-
DOS2UNIX = dos2unix
19-
@@ -35,9 +36,9 @@ endif
5+
@@ -39,9 +39,9 @@ endif
206

217
TARGET = freeimageplus
228
STATICLIB = lib$(TARGET).a
@@ -29,21 +15,21 @@ index b59c419..6e177fc
2915
HEADER = Source/FreeImage.h
3016
HEADERFIP = Wrapper/FreeImagePlus/FreeImagePlus.h
3117

32-
@@ -49,7 +50,7 @@ all: dist
18+
@@ -53,7 +53,7 @@ all: dist
3319
dist: FreeImage
34-
mkdir -p Dist
35-
cp *.a Dist/
20+
mkdir -p Dist
21+
cp *.a Dist/
3622
- cp *.so Dist/
3723
+ cp *.dylib Dist/
38-
cp Source/FreeImage.h Dist/
39-
cp Wrapper/FreeImagePlus/FreeImagePlus.h Dist/
40-
41-
@@ -68,14 +69,15 @@ $(STATICLIB): $(MODULES)
24+
cp Source/FreeImage.h Dist/
25+
cp Wrapper/FreeImagePlus/FreeImagePlus.h Dist/
26+
27+
@@ -72,14 +72,14 @@ $(STATICLIB): $(MODULES)
4228
$(AR) r $@ $(MODULES)
4329

4430
$(SHAREDLIB): $(MODULES)
4531
- $(CC) -s -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES)
46-
+ $(CXX) -dynamiclib -install_name $(LIBNAME) -current_version $(VER_MAJOR).$(VER_MINOR) -compatibility_version $(VER_MAJOR) $(LDFLAGS) -o $@ $(MODULES)
32+
+ $(CC) -dynamiclib -install_name $(VERLIBNAME) -current_version $(VER_MAJOR).$(VER_MINOR) -compatibility_version $(VER_MAJOR) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES)
4733

4834
install:
4935
install -d $(INCDIR) $(INSTALLDIR)
@@ -55,29 +41,14 @@ index b59c419..6e177fc
5541
+ install -m 644 $(HEADERFIP) $(INCDIR)
5642
+ install -m 644 $(STATICLIB) $(INSTALLDIR)
5743
+ install -m 755 $(SHAREDLIB) $(INSTALLDIR)
58-
+ ln -s $(SHAREDLIB) $(INSTALLDIR)/$(LIBNAME)
59-
ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME)
60-
ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME)
61-
44+
ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME)
45+
ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME)
46+
6247
diff --git a/Makefile.gnu b/Makefile.gnu
63-
old mode 100755
64-
new mode 100644
65-
index 92f6358..264b70f
48+
index a4f26013..dd7b7b84 100644
6649
--- a/Makefile.gnu
6750
+++ b/Makefile.gnu
68-
@@ -5,8 +5,9 @@ include Makefile.srcs
69-
70-
# General configuration variables:
71-
DESTDIR ?= /
72-
-INCDIR ?= $(DESTDIR)/usr/include
73-
-INSTALLDIR ?= $(DESTDIR)/usr/lib
74-
+PREFIX ?= /usr/local
75-
+INCDIR ?= $(DESTDIR)$(PREFIX)/include
76-
+INSTALLDIR ?= $(DESTDIR)$(PREFIX)/lib
77-
78-
# Converts cr/lf to just lf
79-
DOS2UNIX = dos2unix
80-
@@ -35,9 +36,9 @@ endif
51+
@@ -39,9 +39,9 @@ endif
8152

8253
TARGET = freeimage
8354
STATICLIB = lib$(TARGET).a
@@ -90,21 +61,21 @@ index 92f6358..264b70f
9061
HEADER = Source/FreeImage.h
9162

9263

93-
@@ -49,7 +50,7 @@ all: dist
64+
@@ -53,7 +53,7 @@ all: dist
9465
dist: FreeImage
95-
mkdir -p Dist
96-
cp *.a Dist/
66+
mkdir -p Dist
67+
cp *.a Dist/
9768
- cp *.so Dist/
9869
+ cp *.dylib Dist/
99-
cp Source/FreeImage.h Dist/
70+
cp Source/FreeImage.h Dist/
10071

10172
dos2unix:
102-
@@ -67,13 +68,13 @@ $(STATICLIB): $(MODULES)
73+
@@ -71,13 +71,13 @@ $(STATICLIB): $(MODULES)
10374
$(AR) r $@ $(MODULES)
10475

10576
$(SHAREDLIB): $(MODULES)
10677
- $(CC) -s -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES)
107-
+ $(CXX) -dynamiclib -install_name $(LIBNAME) -current_version $(VER_MAJOR).$(VER_MINOR) -compatibility_version $(VER_MAJOR) $(LDFLAGS) -o $@ $(MODULES)
78+
+ $(CC) -dynamiclib -install_name $(VERLIBNAME) -current_version $(VER_MAJOR).$(VER_MINOR) -compatibility_version $(VER_MAJOR) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES)
10879

10980
install:
11081
install -d $(INCDIR) $(INSTALLDIR)

freeimage/imath-int64.patch

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
diff --git a/Source/FreeImage/PluginEXR.cpp b/Source/FreeImage/PluginEXR.cpp
2+
index 4ec31cb..f55c2a3 100644
3+
--- a/Source/FreeImage/PluginEXR.cpp
4+
+++ b/Source/FreeImage/PluginEXR.cpp
5+
@@ -67,11 +67,11 @@ public:
6+
return ((unsigned)n != _io->read_proc(c, 1, n, _handle));
7+
}
8+
9+
- virtual Imath::Int64 tellg() {
10+
+ virtual uint64_t tellg() {
11+
return _io->tell_proc(_handle);
12+
}
13+
14+
- virtual void seekg(Imath::Int64 pos) {
15+
+ virtual void seekg(uint64_t pos) {
16+
_io->seek_proc(_handle, (unsigned)pos, SEEK_SET);
17+
}
18+
19+
@@ -101,11 +101,11 @@ public:
20+
}
21+
}
22+
23+
- virtual Imath::Int64 tellp() {
24+
+ virtual uint64_t tellp() {
25+
return _io->tell_proc(_handle);
26+
}
27+
28+
- virtual void seekp(Imath::Int64 pos) {
29+
+ virtual void seekp(uint64_t pos) {
30+
_io->seek_proc(_handle, (unsigned)pos, SEEK_SET);
31+
}
32+
};

freeimage/libtiff-warning.patch

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
diff --git a/Source/Metadata/XTIFF.cpp b/Source/Metadata/XTIFF.cpp
2+
index 35ab4ec..3b0ae10 100644
3+
--- a/Source/Metadata/XTIFF.cpp
4+
+++ b/Source/Metadata/XTIFF.cpp
5+
@@ -604,9 +604,11 @@ tiff_read_exif_tags(TIFF *tif, TagLib::MDMODEL md_model, FIBITMAP *dib) {
6+
// ### uses private data, but there is no other way
7+
// -> Fedora: Best we can do without private headers is to hard-code a list of known EXIF tags and read those
8+
if(md_model == TagLib::EXIF_MAIN) {
9+
+ TIFFErrorHandler handler = TIFFSetWarningHandler(NULL);
10+
for (int i = 0; i < nExifTags; ++i) {
11+
tiff_read_exif_tag(tif, exif_tag_ids[i], dib, md_model);
12+
}
13+
+ TIFFSetWarningHandler(handler);
14+
15+
}
16+

freeimage/macos.patch

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
diff --git a/Makefile.fip b/Makefile.fip
2+
index 046a835..566c4fe 100644
3+
--- a/Makefile.fip
4+
+++ b/Makefile.fip
5+
@@ -24,9 +24,9 @@ override CXXFLAGS += $(INCLUDE) -IDist
6+
7+
TARGET = freeimageplus
8+
STATICLIB = lib$(TARGET).a
9+
-SHAREDLIB = lib$(TARGET)-$(VER_MAJOR).$(VER_MINOR).so
10+
-LIBNAME = lib$(TARGET).so
11+
-VERLIBNAME = $(LIBNAME).$(VER_MAJOR)
12+
+SHAREDLIB = lib$(TARGET).$(VER_MAJOR).$(VER_MINOR).dylib
13+
+LIBNAME = lib$(TARGET).dylib
14+
+VERLIBNAME = lib$(TARGET).$(VER_MAJOR).dylib
15+
HEADER = Source/FreeImage.h
16+
HEADERFIP = Wrapper/FreeImagePlus/FreeImagePlus.h
17+
18+
@@ -58,7 +58,7 @@ $(STATICLIB): $(MODULES)
19+
$(AR) r $@ $(MODULES)
20+
21+
$(SHAREDLIB): $(MODULES)
22+
- $(CC) -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES)
23+
+ $(CC) -dynamiclib -install_name $(VERLIBNAME) -current_version $(VER_MAJOR).$(VER_MINOR) -compatibility_version $(VER_MAJOR) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES)
24+
25+
install:
26+
install -d $(INCDIR) $(INSTALLDIR)
27+
diff --git a/Makefile.gnu b/Makefile.gnu
28+
index d4a0adf..589cd8a 100644
29+
--- a/Makefile.gnu
30+
+++ b/Makefile.gnu
31+
@@ -32,9 +32,9 @@ override CXXFLAGS += $(INCLUDE) -I/usr/include/jxrlib $(shell pkg-config --cflag
32+
33+
TARGET = freeimage
34+
STATICLIB = lib$(TARGET).a
35+
-SHAREDLIB = lib$(TARGET)-$(VER_MAJOR).$(VER_MINOR).so
36+
-LIBNAME = lib$(TARGET).so
37+
-VERLIBNAME = $(LIBNAME).$(VER_MAJOR)
38+
+SHAREDLIB = lib$(TARGET).$(VER_MAJOR).$(VER_MINOR).dylib
39+
+LIBNAME = lib$(TARGET).dylib
40+
+VERLIBNAME = lib$(TARGET).$(VER_MAJOR).dylib
41+
HEADER = Source/FreeImage.h
42+
43+
44+
@@ -66,7 +66,7 @@ $(STATICLIB): $(MODULES)
45+
$(AR) r $@ $(MODULES)
46+
47+
$(SHAREDLIB): $(MODULES)
48+
- $(CC) -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES)
49+
+ $(CC) -dynamiclib -install_name $(VERLIBNAME) -current_version $(VER_MAJOR).$(VER_MINOR) -compatibility_version $(VER_MAJOR) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES)
50+
51+
install:
52+
install -d $(INCDIR) $(INSTALLDIR)

0 commit comments

Comments
 (0)