Skip to contentSkip to conversation

libfreeimage: new package

PATCH New Rémi Rérolle 2 participants 3 messages Apr 13, 2015 – May 3, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 libfreeimage: new package

FreeImage is an Open Source library project for developers who would like to support popular graphics image formats like PNG, BMP, JPEG, TIFF and others as needed by today's multimedia applications.

See: http://freeimage.sourceforge.net

---
v2:
- Add description and Signed-off-by statement to the upstream patch
- Fix description formatting in Config.in, add link to upstream site
- Fix licensing and cleanup Makefile, no more subdir, simpler rules

---
 package/Config.in                               |  1 +
 package/libfreeimage/0001-no-root-install.patch | 20 +++++++++++++++
 package/libfreeimage/Config.in                  |  9 +++++++
 package/libfreeimage/libfreeimage.mk            | 33 +++++++++++++++++++++++++
 4 files changed, 63 insertions(+)
 create mode 100644 package/libfreeimage/0001-no-root-install.patch
 create mode 100644 package/libfreeimage/Config.in
 create mode 100644 package/libfreeimage/libfreeimage.mk
package/Config.in +1 -0
index de8e856..acfc5b8 100644
@@ -741,6 +741,7 @@ menu "Graphics"
 	source "package/libdri2/Config.in"
 	source "package/libdrm/Config.in"
 	source "package/libexif/Config.in"
+	source "package/libfreeimage/Config.in"
 	source "package/libgail/Config.in"
 	source "package/libgeotiff/Config.in"
 	source "package/libglade/Config.in"
package/libfreeimage/0001-no-root-install.patch new file +20 -0
new file mode 100644
index 0000000..54756d8
@@ -0,0 +1,20 @@
+Makefile.gnu: allow non-root install by not enforcing root ownserhip
+
+Signed-off-by: R?mi R?rolle <[email protected]>
+
+diff -ruN a/Makefile.gnu b/Makefile.gnu
+--- a/Makefile.gnu	2015-04-09 16:34:02.315316841 +0200
++++ b/Makefile.gnu	2015-04-09 16:34:28.875483201 +0200
+@@ -71,9 +71,9 @@
+ 
+ install:
+ 	install -d $(INCDIR) $(INSTALLDIR)
+-	install -m 644 -o root -g root $(HEADER) $(INCDIR)
+-	install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)
+-	install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
++	install -m 644 $(HEADER) $(INCDIR)
++	install -m 644 $(STATICLIB) $(INSTALLDIR)
++	install -m 755 $(SHAREDLIB) $(INSTALLDIR)
+ 	ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME)
+ 	ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME)	
+ #	ldconfig
package/libfreeimage/Config.in new file +9 -0
new file mode 100644
index 0000000..148e5ae
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_LIBFREEIMAGE
+	bool "libfreeimage"
+	help
+	  FreeImage is an Open Source library project for developers who
+	  would like to support popular graphics image formats like PNG,
+	  BMP, JPEG, TIFF and others as needed by today's multimedia
+	  applications.
+
+	  http://freeimage.sourceforge.net
package/libfreeimage/libfreeimage.mk new file +33 -0
new file mode 100644
index 0000000..2849e94
@@ -0,0 +1,33 @@
+################################################################################
+#
+# libfreeimage
+#
+################################################################################
+
+LIBFREEIMAGE_VERSION = 3.17.0
+LIBFREEIMAGE_SITE = http://downloads.sourceforge.net/freeimage
+LIBFREEIMAGE_SOURCE = FreeImage$(subst .,,$(LIBFREEIMAGE_VERSION)).zip
+LIBFREEIMAGE_LICENSE = GPLv2 or GPLv3 or FreeImage Public License
+LIBFREEIMAGE_LICENSE_FILES = license-gplv2.txt license-gplv3.txt license-fi.txt
+LIBFREEIMAGE_INSTALL_STAGING = YES
+
+define LIBFREEIMAGE_EXTRACT_CMDS
+	$(UNZIP) $(DL_DIR)/$(LIBFREEIMAGE_SOURCE) -d $(@D)
+	mv $(@D)/FreeImage/* $(@D)
+	rmdir $(@D)/FreeImage
+endef
+
+define LIBFREEIMAGE_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)
+endef
+
+define LIBFREEIMAGE_INSTALL_STAGING_CMDS
+	$(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) install
+endef
+
+define LIBFREEIMAGE_INSTALL_TARGET_CMDS
+	$(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install
+endef
+
+$(eval $(generic-package))
+
Signature · 1 line
2.1.0
#1 lore raw

PATCH v2 1/1 libfreeimage: new package

Dear R?mi R?rolle,

Quoted 7 lines · R?mi R?rolle

FreeImage is an Open Source library project for developers who would like to support popular graphics image formats like PNG, BMP, JPEG, TIFF and others as needed by today's multimedia applications.

See: http://freeimage.sourceforge.net

Applied, after doing some small additional changes:

[Thomas:
- add hash file
- add dependency on !BR2_STATIC_LIBS, since the build system of libfreeimage always tries to build a shared library.]

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH v2 1/1 libfreeimage: new package

In reply to Rémi Rérolle

Dear R?mi R?rolle,

Quoted 7 lines · R?mi R?rolle

FreeImage is an Open Source library project for developers who would like to support popular graphics image formats like PNG, BMP, JPEG, TIFF and others as needed by today's multimedia applications.

See: http://freeimage.sourceforge.net

Could you help us with some rather several build issues on libfreeimage? I fixed a number of them, but on Blackfin there are some really weird things being uncovered.

I fixed
http://autobuild.buildroot.org/results/fe7/fe72243a84a91b68ef3138847294674b36f16c58/build-end.log
with http://patchwork.ozlabs.org/patch/467381/.

I fixed
http://autobuild.buildroot.org/results/054/054d8496f1555274c8525c8c7381aaada27f9e70/build-end.log
which seems to be a compiler issue by simply disabling libfreeimage on the ARC architecture, see http://patchwork.ozlabs.org/patch/467380/.
Don't try to fix that one, it's really a compiler problem.

However, the Blackfin case is much more interesting. As explained in
http://patchwork.ozlabs.org/patch/467380/, I tried to fix the build issue visible at
http://autobuild.buildroot.org/results/f3b/f3bd6be448cffed3caae7850233168e6d0f6a5bd/build-end.log.
I fixed the first build issue, then another one, and finally had another build issue that clearly indicates that the libfreeimage source code seems to be a piece of crap, using 40 bits constants in 32 bits variables. Can you have a look at this? For now we're going to disable the package on Blackfin, but I believe it's also buggy on other architectures.

Here is a simple Buildroot configuration file to reproduce the problem:

BR2_bfin=y
BR2_COMPILER_PARANOID_UNSAFE_PATH=y
BR2_INIT_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_LIBFREEIMAGE=y
# BR2_TARGET_ROOTFS_TAR is not set

Thanks for your help,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com