Skip to content

Commit

Permalink
devil, fix installation paths, fix building with newer gcc versions (h…
Browse files Browse the repository at this point in the history
  • Loading branch information
Begasus authored and Julius C. Enriquez committed Apr 14, 2023
1 parent 43202ef commit 44e956d
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 35 deletions.
42 changes: 7 additions & 35 deletions media-libs/devil/devil-1.8.0.recipe
Expand Up @@ -12,7 +12,8 @@ LICENSE="GNU LGPL v2.1"
REVISION="4"
SOURCE_URI="http://sourceforge.net/projects/openil/files/DevIL/$portVersion/DevIL-$portVersion.tar.gz"
CHECKSUM_SHA256="0075973ee7dd89f0507873e2580ac78336452d29d34a07134b208f44e2feb709"
SOURCE_DIR="DevIL"
SOURCE_DIR="DevIL/DevIL"
PATCHES="devil-$portVersion.patchset"

ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
Expand Down Expand Up @@ -46,7 +47,6 @@ REQUIRES_devel="
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libgl$secondaryArchSuffix
devel:libilmimf$secondaryArchSuffix #openexr
devel:libjasper$secondaryArchSuffix
devel:libjpeg$secondaryArchSuffix
devel:liblcms2$secondaryArchSuffix
Expand All @@ -67,42 +67,15 @@ BUILD_PREREQUIRES="

BUILD()
{
cd DevIL
mkdir -p haiku-build
cd haiku-build

if [ $targetArchitecture = x86_gcc2 ]; then
cmake .. \
-DCMAKE_INSTALL_PREFIX:PATH=$libDir \
-DCMAKE_CXX_FLAGS="-fpermissive"
else
cmake .. \
-DCMAKE_INSTALL_PREFIX:PATH=$prefix \
cmake -Bbuild -S. -DCMAKE_BUILD_TYPE=Release \
$cmakeDirArgs \
-DCMAKE_CXX_FLAGS="-fpermissive"
fi

make $jobArgs
make -C build $jobArgs
}

INSTALL()
{
cd DevIL/haiku-build
make install

if [ $targetArchitecture = x86_gcc2 ]; then
mkdir -p $libDir
mv $libDir/lib/* $libDir
rmdir $libDir/lib
mkdir -p $includeDir
mv $libDir/include/* $includeDir
rmdir $libDir/include
fi

if [ $targetArchitecture = x86_64 ]; then
mkdir -p $includeDir
mv $prefix/include/* $includeDir
rmdir $prefix/include
fi
make -C build install

prepareInstalledDevelLibs libIL libILU libILUT
fixPkgconfig
Expand All @@ -113,6 +86,5 @@ INSTALL()

TEST()
{
cd DevIL/haiku-build
make check
make -C build check
}
81 changes: 81 additions & 0 deletions media-libs/devil/patches/devil-1.8.0.patchset
@@ -0,0 +1,81 @@
From 0d421d3ff0444817e24803a50cddb5f07d5dfcd3 Mon Sep 17 00:00:00 2001
From: Begasus <begasus@gmail.com>
Date: Mon, 3 Apr 2023 19:13:04 +0200
Subject: Fix installation paths


diff --git a/src-IL/CMakeLists.txt b/src-IL/CMakeLists.txt
index 02e4f03..7a6e62f 100644
--- a/src-IL/CMakeLists.txt
+++ b/src-IL/CMakeLists.txt
@@ -248,14 +248,14 @@ configure_file( pkgconfig/IL.pc.cmake.in

# Installation
install (TARGETS IL
- ARCHIVE DESTINATION lib
- LIBRARY DESTINATION lib
- RUNTIME DESTINATION bin
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
-install (FILES ../include/IL/il.h DESTINATION include/IL)
+install (FILES ../include/IL/il.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/IL)

install(FILES
${CMAKE_CURRENT_BINARY_DIR}/IL.pc
- DESTINATION lib/pkgconfig
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)

diff --git a/src-ILU/CMakeLists.txt b/src-ILU/CMakeLists.txt
index 17a3afe..3975b0e 100644
--- a/src-ILU/CMakeLists.txt
+++ b/src-ILU/CMakeLists.txt
@@ -74,14 +74,14 @@ endif(UNICODE)

# Installation
install (TARGETS ILU
- ARCHIVE DESTINATION lib
- LIBRARY DESTINATION lib
- RUNTIME DESTINATION bin
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
-install (FILES ../include/IL/ilu.h DESTINATION include/IL)
+install (FILES ../include/IL/ilu.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/IL)

install(FILES
${CMAKE_CURRENT_BINARY_DIR}/ILU.pc
- DESTINATION lib/pkgconfig
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)

diff --git a/src-ILUT/CMakeLists.txt b/src-ILUT/CMakeLists.txt
index 21470cb..94e5993 100644
--- a/src-ILUT/CMakeLists.txt
+++ b/src-ILUT/CMakeLists.txt
@@ -72,14 +72,14 @@ endif(UNICODE)

# Installation
install (TARGETS ILUT
- ARCHIVE DESTINATION lib
- LIBRARY DESTINATION lib
- RUNTIME DESTINATION bin
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
-install (FILES ../include/IL/ilut.h DESTINATION include/IL)
+install (FILES ../include/IL/ilut.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/IL)

install(FILES
${CMAKE_CURRENT_BINARY_DIR}/ILUT.pc
- DESTINATION lib/pkgconfig
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)

--
2.37.3

0 comments on commit 44e956d

Please sign in to comment.