Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
easyblock = 'ConfigureMake'

name = 'FreeImage'
version = '3.18.0'

homepage = 'http://freeimage.sourceforge.net'
description = """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. FreeImage is easy to
use, fast, multithreading safe."""

toolchain = {'name': 'GCCcore', 'version': '13.2.0'}
toolchainopts = {'cstd': 'c++14'}

source_urls = [SOURCEFORGE_SOURCE]
sources = ['%(name)s3180.zip']
patches = [
'%(name)s-%(version)s-fix-makefile.patch',
'%(name)s-%(version)s-fix-makefile-riscv.patch',
'%(name)s-%(version)s-fix-makefile-gnu.patch',
]

checksums = [
'f41379682f9ada94ea7b34fe86bf9ee00935a3147be41b6569c9605a53e438fd', # FreeImage3180.zip
'3eaa1eb9562ccfd0cb95a37879bb7e3e8c745166596d75af529478181ef006a0', # %(name)s-%(version)s-fix-makefile.patch
'e845d53bfd829d771638b9952d3632010c7f19c88d761a786754453827bd7e9b', # %(name)s-%(version)s-fix-makefile-riscv.patch
'b636012988e1b88609fbd2c130e2b4e6fa8c488cb07578e0353baf8e5aa52413', # %(name)s-%(version)s-fix-makefile-gnu.patch
]

builddependencies = [('binutils', '2.40')]

dependencies = [('zlib', '1.2.13')]

skipsteps = ['configure']

buildopts = ['', '-f Makefile.fip']

installopts = [
"INCDIR=%(installdir)s/include INSTALLDIR=%(installdir)s/lib",
"-f Makefile.fip INCDIR=%(installdir)s/include INSTALLDIR=%(installdir)s/lib",
]

_incs = ['include/FreeImage%s.h' % x for x in ['', 'Plus']]
_libs = ['lib/libfreeimage%s.%s' % (x, y) for x in ['', 'plus'] for y in ['a', SHLIB_EXT]]

sanity_check_paths = {
'files': _incs + _libs,
'dirs': [],
}

moduleclass = 'vis'
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# -fPIC flag is also needed for RISC-V builds
--- Makefile.gnu.orig 2025-01-15 17:26:47.616603010 +0100
+++ Makefile.gnu 2025-01-15 17:28:09.158140964 +0100
@@ -33,6 +33,11 @@
CXXFLAGS += -fPIC
endif

+ifeq ($(shell sh -c 'uname -m 2>/dev/null || echo not'),riscv64)
+ CFLAGS += -fPIC
+ CXXFLAGS += -fPIC
+endif
+
TARGET = freeimage
STATICLIB = lib$(TARGET).a
SHAREDLIB = lib$(TARGET)-$(VER_MAJOR).$(VER_MINOR).so
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# -fPIC flag is also needed for RISC-V builds
--- Makefile.fip.orig 2025-01-16 12:58:29.624119756 +0100
+++ Makefile.fip 2025-01-16 13:00:01.016862229 +0100
@@ -33,6 +33,11 @@
CXXFLAGS += -fPIC
endif

+ifeq ($(shell sh -c 'uname -m 2>/dev/null || echo not'),riscv64)
+ CFLAGS += -fPIC
+ CXXFLAGS += -fPIC
+endif
+
TARGET = freeimageplus
STATICLIB = lib$(TARGET).a
SHAREDLIB = lib$(TARGET)-$(VER_MAJOR).$(VER_MINOR).so