Skip to contentSkip to conversation

libfreeimage: new package

PATCH Superseded Rémi Rérolle 2 participants 3 messages Apr 10, 2015 – Apr 13, 2015

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 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

---
 package/Config.in                               |  1 +
 package/libfreeimage/0001-no-root-install.patch | 16 +++++++++++
 package/libfreeimage/Config.in                  |  7 +++++
 package/libfreeimage/libfreeimage.mk            | 37 +++++++++++++++++++++++++
 4 files changed, 61 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 262a7fb..2d3cd46 100644
@@ -701,6 +701,7 @@ menu "Graphics"
 	source "package/libdmtx/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 +16 -0
new file mode 100644
index 0000000..5c3ee71
@@ -0,0 +1,16 @@
+diff -ruN a/FreeImage/Makefile.gnu b/FreeImage/Makefile.gnu
+--- a/FreeImage/Makefile.gnu	2015-04-09 16:34:02.315316841 +0200
++++ b/FreeImage/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 +7 -0
new file mode 100644
index 0000000..82ad4e2
@@ -0,0 +1,7 @@
+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.
+
package/libfreeimage/libfreeimage.mk new file +37 -0
new file mode 100644
index 0000000..dfaa1a5
@@ -0,0 +1,37 @@
+################################################################################
+#
+# libfreeimage
+#
+################################################################################
+
+LIBFREEIMAGE_VERSION = 3.17.0
+LIBFREEIMAGE_SITE = http://downloads.sourceforge.net/freeimage
+LIBFREEIMAGE_SOURCE = FreeImage$(subst .,,$(LIBFREEIMAGE_VERSION)).zip
+LIBFREEIMAGE_LICENSE = GPLv2+
+LIBFREEIMAGE_LICENSE_FILES = license-gplv2.txt
+LIBFREEIMAGE_INSTALL_STAGING = YES
+
+define LIBFREEIMAGE_EXTRACT_CMDS
+	$(UNZIP) -d $(BUILD_DIR)/libfreeimage-$(LIBFREEIMAGE_VERSION) \
+		$(DL_DIR)/$(LIBFREEIMAGE_SOURCE)
+endef
+
+
+define LIBFREEIMAGE_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/FreeImage \
+		-j$(PARALLEL_JOBS) \
+		CC="$(TARGET_CC)" \
+		CXX="$(TARGET_CXX)"
+endef
+
+define LIBFREEIMAGE_INSTALL_STAGING_CMDS
+	$(MAKE) -C $(@D)/FreeImage DESTDIR=$(STAGING_DIR) install
+endef
+
+define LIBFREEIMAGE_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/lib/ \
+		$(STAGING_DIR)/usr/lib/libfreeimage*.so*
+endef
+
+$(eval $(generic-package))
+
Signature · 1 line
2.1.0
#1 lore raw

PATCH 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

Thanks for this patch! It's almost good, there are only a few minor things to fix. See below.

package/libfreeimage/0001-no-root-install.patch

Quoted 5 lines
package/libfreeimage/0001-no-root-install.patch new file +0 -0
new file mode 100644
index 0000000..5c3ee71

All patches need a description and Signed-off-by line. See
http://buildroot.org/downloads/manual/manual.html#_format_and_licensing_of_the_package_patches.

Also, can you submit this patch upstream?

package/libfreeimage/Config.in line 6

Quoted 12 lines
package/libfreeimage/Config.in new file +6 -0
new file mode 100644
index 0000000..82ad4e2
@@ -0,0 +1,7 @@
+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.

Indentation for the help text is one tab + two spaces. And also, after an empty new line, add the upstream URL of the project. In addition, the lines are too long, make sure to wrap at 72 columns.

See
http://buildroot.org/downloads/manual/manual.html#_literal_config_in_literal_file
for details.

Quoted 7 lines
package/libfreeimage/libfreeimage.mk new file +1 -0
new file mode 100644
index 0000000..dfaa1a5
@@ -0,0 +1,37 @@
+################################################################################

package/libfreeimage/libfreeimage.mk line 11

Quoted 10 lines
package/libfreeimage/libfreeimage.mk new file +10 -0
+#
+# libfreeimage
+#
+################################################################################
+
+LIBFREEIMAGE_VERSION = 3.17.0
+LIBFREEIMAGE_SITE = http://downloads.sourceforge.net/freeimage
+LIBFREEIMAGE_SOURCE = FreeImage$(subst .,,$(LIBFREEIMAGE_VERSION)).zip
+LIBFREEIMAGE_LICENSE = GPLv2+
+LIBFREEIMAGE_LICENSE_FILES = license-gplv2.txt

This is not quite correct. The license, as said on the web site is:

"FreeImage is licensed under the GNU General Public License, version 2.0 (GPLv2) or version 3.0 (GPLv3), and the FreeImage Public License (FIPL)"

So:

LIBFREEIMAGE_LICENSE = GPLv2 or GPLv3 or FreeImage Public License LIBFREEIMAGE_LICENSE_FILES = license-gplv2.txt license-gplv3.txt license-fi.txt

package/libfreeimage/libfreeimage.mk line 16

Quoted 5 lines
package/libfreeimage/libfreeimage.mk new file +5 -0
+LIBFREEIMAGE_INSTALL_STAGING = YES
+
+define LIBFREEIMAGE_EXTRACT_CMDS
+	$(UNZIP) -d $(BUILD_DIR)/libfreeimage-$(LIBFREEIMAGE_VERSION) \
+		$(DL_DIR)/$(LIBFREEIMAGE_SOURCE)

then maybe a:

	mv $(@D)/FreeImage/* $(@D)

which will allow to use -C $(@D) instead of -C $(@D)/FreeImage below.

package/libfreeimage/libfreeimage.mk line 22

Quoted 6 lines
package/libfreeimage/libfreeimage.mk new file +6 -0
+endef
+
+
+define LIBFREEIMAGE_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/FreeImage \
+		-j$(PARALLEL_JOBS) \

-j$(PARALLEL_JOBS) not needed, already taken care of by $(MAKE).

package/libfreeimage/libfreeimage.mk line 24

Quoted 2 lines
package/libfreeimage/libfreeimage.mk new file +2 -0
+		CC="$(TARGET_CC)" \
+		CXX="$(TARGET_CXX)"

Could you try to use $(TARGET_CONFIGURE_OPTS) instead? I.e:

	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
		$(TARGET_CONFIGURE_OPTS)

package/libfreeimage/libfreeimage.mk line 33

Quoted 7 lines
package/libfreeimage/libfreeimage.mk new file +7 -0
+define LIBFREEIMAGE_INSTALL_STAGING_CMDS
+	$(MAKE) -C $(@D)/FreeImage DESTDIR=$(STAGING_DIR) install
+endef
+
+define LIBFREEIMAGE_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/lib/ \
+		$(STAGING_DIR)/usr/lib/libfreeimage*.so*

Why don't you use DESTDIR=$(TARGET_DIR) install here?

If you're worried about headers, static library or documentation being installed, don't worry: Buildroot cleans up such things from the rootfs at the very end of the build.

Could you resubmit an updated version that takes into account those comments?

Thanks a lot!

Thomas Petazzoni

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

PATCH 1/1 libfreeimage: new package

Hi Thomas,

2015-04-10 22:16 GMT+02:00 Thomas Petazzoni
<[email protected]>:

Quoted 15 lines

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

Thanks for this patch! It's almost good, there are only a few minor things to fix. See below.

Quoted 8 lines

package/libfreeimage/0001-no-root-install.patch

Quoted 5 lines
package/libfreeimage/0001-no-root-install.patch new file +0 -0
new file mode 100644
index 0000000..5c3ee71

All patches need a description and Signed-off-by line. See
http://buildroot.org/downloads/manual/manual.html#_format_and_licensing_of_the_package_patches.

OK, I overlooked that, will do in v2.

Quoted 3 lines

Also, can you submit this patch upstream?

Done, see: https://sourceforge.net/p/freeimage/bugs/257/

Quoted 19 lines
Quoted 8 lines
package/libfreeimage/Config.in new file +0 -0
new file mode 100644
index 0000000..82ad4e2

package/libfreeimage/Config.in line 6

Quoted 6 lines
package/libfreeimage/Config.in new file +6 -0
@@ -0,0 +1,7 @@
+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.

Indentation for the help text is one tab + two spaces. And also, after an empty new line, add the upstream URL of the project. In addition, the lines are too long, make sure to wrap at 72 columns.

Quoted 3 lines

See
http://buildroot.org/downloads/manual/manual.html#_literal_config_in_literal_file
for details.

OK

Quoted 21 lines
Quoted 8 lines
package/libfreeimage/libfreeimage.mk new file +1 -0
new file mode 100644
index 0000000..dfaa1a5
@@ -0,0 +1,37 @@
+################################################################################

package/libfreeimage/libfreeimage.mk line 11

Quoted 10 lines
package/libfreeimage/libfreeimage.mk new file +10 -0
+#
+# libfreeimage
+#
+################################################################################
+
+LIBFREEIMAGE_VERSION = 3.17.0
+LIBFREEIMAGE_SITE = http://downloads.sourceforge.net/freeimage
+LIBFREEIMAGE_SOURCE = FreeImage$(subst .,,$(LIBFREEIMAGE_VERSION)).zip
+LIBFREEIMAGE_LICENSE = GPLv2+
+LIBFREEIMAGE_LICENSE_FILES = license-gplv2.txt

This is not quite correct. The license, as said on the web site is:

Quoted 8 lines

"FreeImage is licensed under the GNU General Public License, version 2.0 (GPLv2) or version 3.0 (GPLv3), and the FreeImage Public License (FIPL)"

So:

LIBFREEIMAGE_LICENSE = GPLv2 or GPLv3 or FreeImage Public License LIBFREEIMAGE_LICENSE_FILES = license-gplv2.txt license-gplv3.txt license-fi.txt

OK, thanks, I was a bit confused about how to specify multiple licenses.

Quoted 10 lines

package/libfreeimage/libfreeimage.mk line 16

Quoted 7 lines
package/libfreeimage/libfreeimage.mk new file +5 -0
+LIBFREEIMAGE_INSTALL_STAGING = YES
+
+define LIBFREEIMAGE_EXTRACT_CMDS
+     $(UNZIP) -d $(BUILD_DIR)/libfreeimage-$(LIBFREEIMAGE_VERSION) \
+             $(DL_DIR)/$(LIBFREEIMAGE_SOURCE)

then maybe a:

Quoted 3 lines
        mv $(@D)/FreeImage/* $(@D)

which will allow to use -C $(@D) instead of -C $(@D)/FreeImage below.

Indeed, I'll simply add a rmdir $(@D)/FreeImage so that the remaining dir won't get
in the way.

Quoted 11 lines

package/libfreeimage/libfreeimage.mk line 22

Quoted 8 lines
package/libfreeimage/libfreeimage.mk new file +6 -0
+endef
+
+
+define LIBFREEIMAGE_BUILD_CMDS
+     $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/FreeImage \
+             -j$(PARALLEL_JOBS) \

-j$(PARALLEL_JOBS) not needed, already taken care of by $(MAKE).

Quoted 7 lines

package/libfreeimage/libfreeimage.mk line 24

Quoted 2 lines
package/libfreeimage/libfreeimage.mk new file +2 -0
+             CC="$(TARGET_CC)" \
+             CXX="$(TARGET_CXX)"

Could you try to use $(TARGET_CONFIGURE_OPTS) instead? I.e:

        $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
                $(TARGET_CONFIGURE_OPTS)

OK, only I need to put $(TARGET_CONFIGURE_OPTS) before the call to make, otherwise this seems to break the CFLAGS mechanism (local includes are somehow discarded).

Quoted 11 lines

package/libfreeimage/libfreeimage.mk line 33

Quoted 8 lines
package/libfreeimage/libfreeimage.mk new file +7 -0
+define LIBFREEIMAGE_INSTALL_STAGING_CMDS
+     $(MAKE) -C $(@D)/FreeImage DESTDIR=$(STAGING_DIR) install
+endef
+
+define LIBFREEIMAGE_INSTALL_TARGET_CMDS
+     $(INSTALL) -m 755 -t $(TARGET_DIR)/usr/lib/ \
+             $(STAGING_DIR)/usr/lib/libfreeimage*.so*

Why don't you use DESTDIR=$(TARGET_DIR) install here?

Quoted 3 lines

If you're worried about headers, static library or documentation being installed, don't worry: Buildroot cleans up such things from the rootfs at the very end of the build.

Indeed, that was my concern, so if Buildroot takes care about it, all is good!

Quoted 4 lines

Could you resubmit an updated version that takes into account those comments?

Will do in a minute.

Quoted 3 lines

Thanks a lot!

Thanks for your review !

Quoted 6 lines

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