Skip to content

Instantly share code, notes, and snippets.

@oblitum oblitum/DESCRIPTION.md
Last active Jun 8, 2017

Embed
What would you like to do?
Patched fluid-designer AUR package

This is a patch for https://aur.archlinux.org/packages/fluid-designer 2.74-1 AUR package to get a successful build.

Fixes

PKGBUILD:

  • Removed dependencies on old gcc5, llvm35 and python34. It's now depending (and building) on corresponding up-to-date packages.
  • Added conflict with Blender since this is a Blender variant.
  • Disabled CUDA. I don't have an NVIDIA card anyway, and cuda also depends on gcc5.
  • Fixed directory for running make install.
  • Added myself as contributor.

fluid-designer.patch:

  • Check for ffmpeg2.8 in proper locations.
  • min, max and clamp macros renamed to avoid conflicts with C++11 Standard Library functions.
  • _PyThreadState_UncheckedGet() being used instead of deprecated libpython API.
  • /doc/manpage/blender.1.py coudn't be executed through shebang because of its DOS file format and lack of executable flag.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1133e8a..3a8d57a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -888,13 +888,13 @@ if(UNIX AND NOT APPLE)
# lame, but until we have proper find module for ffmpeg
set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include)
- if(EXISTS "${FFMPEG}/include/ffmpeg/")
- list(APPEND FFMPEG_INCLUDE_DIRS "${FFMPEG}/include/ffmpeg")
+ if(EXISTS "${FFMPEG}/include/ffmpeg2.8/")
+ list(APPEND FFMPEG_INCLUDE_DIRS "${FFMPEG}/include/ffmpeg2.8")
endif()
# end lameness
mark_as_advanced(FFMPEG_LIBRARIES)
- set(FFMPEG_LIBPATH ${FFMPEG}/lib)
+ set(FFMPEG_LIBPATH ${FFMPEG}/lib/ffmpeg2.8)
endif()
if(WITH_FFTW3)
diff --git a/source/blender/imbuf/intern/dds/ColorBlock.cpp b/source/blender/imbuf/intern/dds/ColorBlock.cpp
index fc5f55c..e25a529 100644
--- a/source/blender/imbuf/intern/dds/ColorBlock.cpp
+++ b/source/blender/imbuf/intern/dds/ColorBlock.cpp
@@ -86,8 +86,8 @@ void ColorBlock::init(const Image *img, uint x, uint y)
void ColorBlock::init(uint w, uint h, const uint *data, uint x, uint y)
{
- const uint bw = min(w - x, 4U);
- const uint bh = min(h - y, 4U);
+ const uint bw = Min(w - x, 4U);
+ const uint bh = Min(h - y, 4U);
// Blocks that are smaller than 4x4 are handled by repeating the pixels.
// @@ Thats only correct when block size is 1, 2 or 4, but not with 3. :(
@@ -107,8 +107,8 @@ void ColorBlock::init(uint w, uint h, const uint *data, uint x, uint y)
void ColorBlock::init(uint w, uint h, const float *data, uint x, uint y)
{
- const uint bw = min(w - x, 4U);
- const uint bh = min(h - y, 4U);
+ const uint bw = Min(w - x, 4U);
+ const uint bh = Min(h - y, 4U);
// Blocks that are smaller than 4x4 are handled by repeating the pixels.
// @@ Thats only correct when block size is 1, 2 or 4, but not with 3. :(
@@ -124,10 +124,10 @@ void ColorBlock::init(uint w, uint h, const float *data, uint x, uint y)
const uint idx = ((y + by) * w + x + bx);
Color32 & c = color(e, i);
- c.r = uint8(255 * clamp(data[idx + 0 * srcPlane], 0.0f, 1.0f)); // @@ Is this the right way to quantize floats to bytes?
- c.g = uint8(255 * clamp(data[idx + 1 * srcPlane], 0.0f, 1.0f));
- c.b = uint8(255 * clamp(data[idx + 2 * srcPlane], 0.0f, 1.0f));
- c.a = uint8(255 * clamp(data[idx + 3 * srcPlane], 0.0f, 1.0f));
+ c.r = uint8(255 * Clamp(data[idx + 0 * srcPlane], 0.0f, 1.0f)); // @@ Is this the right way to quantize floats to bytes?
+ c.g = uint8(255 * Clamp(data[idx + 1 * srcPlane], 0.0f, 1.0f));
+ c.b = uint8(255 * Clamp(data[idx + 2 * srcPlane], 0.0f, 1.0f));
+ c.a = uint8(255 * Clamp(data[idx + 3 * srcPlane], 0.0f, 1.0f));
}
}
}
diff --git a/source/blender/imbuf/intern/dds/Common.h b/source/blender/imbuf/intern/dds/Common.h
index c9b2f8c..ce58709 100644
--- a/source/blender/imbuf/intern/dds/Common.h
+++ b/source/blender/imbuf/intern/dds/Common.h
@@ -28,14 +28,14 @@
#ifndef __COMMON_H__
#define __COMMON_H__
-#ifndef min
-#define min(a,b) ((a) <= (b) ? (a) : (b))
+#ifndef Min
+#define Min(a,b) ((a) <= (b) ? (a) : (b))
#endif
-#ifndef max
-#define max(a,b) ((a) >= (b) ? (a) : (b))
+#ifndef Max
+#define Max(a,b) ((a) >= (b) ? (a) : (b))
#endif
-#ifndef clamp
-#define clamp(x,a,b) min(max((x), (a)), (b))
+#ifndef Clamp
+#define Clamp(x,a,b) Min(Max((x), (a)), (b))
#endif
template<typename T>
diff --git a/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
index a7730fe..a9c02f4 100644
--- a/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
+++ b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
@@ -1102,8 +1102,8 @@ void DirectDrawSurface::mipmap(Image *img, uint face, uint mipmap)
// Compute width and height.
for (uint m = 0; m < mipmap; m++)
{
- w = max(1U, w / 2);
- h = max(1U, h / 2);
+ w = Max(1U, w / 2);
+ h = Max(1U, h / 2);
}
img->allocate(w, h);
@@ -1223,9 +1223,9 @@ void DirectDrawSurface::readBlockImage(Image *img)
readBlock(&block);
// Write color block.
- for (uint y = 0; y < min(4U, h-4*by); y++)
+ for (uint y = 0; y < Min(4U, h-4*by); y++)
{
- for (uint x = 0; x < min(4U, w-4*bx); x++)
+ for (uint x = 0; x < Min(4U, w-4*bx); x++)
{
img->pixel(4*bx+x, 4*by+y) = block.color(x, y);
}
@@ -1240,7 +1240,7 @@ static Color32 buildNormal(uint8 x, uint8 y)
float ny = 2 * (y / 255.0f) - 1;
float nz = 0.0f;
if (1 - nx*nx - ny*ny > 0) nz = sqrt(1 - nx*nx - ny*ny);
- uint8 z = clamp(int(255.0f * (nz + 1) / 2.0f), 0, 255);
+ uint8 z = Clamp(int(255.0f * (nz + 1) / 2.0f), 0, 255);
return Color32(x, y, z);
}
@@ -1379,9 +1379,9 @@ uint DirectDrawSurface::mipmapSize(uint mipmap) const
for (uint m = 0; m < mipmap; m++)
{
- w = max(1U, w / 2);
- h = max(1U, h / 2);
- d = max(1U, d / 2);
+ w = Max(1U, w / 2);
+ h = Max(1U, h / 2);
+ d = Max(1U, d / 2);
}
if (header.pf.flags & DDPF_FOURCC)
diff --git a/source/blender/imbuf/intern/dds/FlipDXT.cpp b/source/blender/imbuf/intern/dds/FlipDXT.cpp
index ced8efb..f280387 100644
--- a/source/blender/imbuf/intern/dds/FlipDXT.cpp
+++ b/source/blender/imbuf/intern/dds/FlipDXT.cpp
@@ -246,8 +246,8 @@ int FlipDXTCImage(unsigned int width, unsigned int height, unsigned int levels,
// mip levels are contiguous.
data += block_bytes * blocks;
- mip_width = max(1U, mip_width >> 1);
- mip_height = max(1U, mip_height >> 1);
+ mip_width = Max(1U, mip_width >> 1);
+ mip_height = Max(1U, mip_height >> 1);
}
return 1;
diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c
index a3ea65f..b693dfb 100644
--- a/source/blender/python/generic/py_capi_utils.c
+++ b/source/blender/python/generic/py_capi_utils.c
@@ -629,7 +629,7 @@ void PyC_SetHomePath(const char *py_path_bundle)
bool PyC_IsInterpreterActive(void)
{
- return (((PyThreadState *)_Py_atomic_load_relaxed(&_PyThreadState_Current)) != NULL);
+ return _PyThreadState_UncheckedGet() != NULL;
}
/* Would be nice if python had this built in
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 08d25f9..5f77d6a 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -399,7 +399,7 @@ if(UNIX AND NOT APPLE)
if(WITH_DOC_MANPAGE)
add_custom_target(
blender_man_page ALL
- COMMAND ${CMAKE_SOURCE_DIR}/doc/manpage/blender.1.py
+ COMMAND python3 ${CMAKE_SOURCE_DIR}/doc/manpage/blender.1.py
${EXECUTABLE_OUTPUT_PATH}/blender
${CMAKE_CURRENT_BINARY_DIR}/blender.1)
add_dependencies(blender_man_page blender)
# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: Francisco Lopes <francisco@oblita.com>
# Contributor: John Sowiak <john@archlinux.org>
# Contributor: tobias <tobias@archlinux.org>
pkgname=fluid-designer
pkgver=2.74
pkgrel=2
pkgdesc="A home designer based on Blender"
arch=('i686' 'x86_64')
license=('GPL')
url="http://www.microvellum.com/products/fluid-designer/"
depends=('libpng' 'libtiff' 'openexr' 'desktop-file-utils' 'python-requests'
'shared-mime-info' 'hicolor-icon-theme' 'xdg-utils' 'glew' 'openjpeg'
'freetype2' 'openal' 'ffmpeg2.8' 'fftw' 'boost-libs' 'opencollada'
'openimageio' 'libsndfile' 'jack' 'opencolorio' 'python'
'jemalloc' 'libspnav' 'ptex' 'opensubdiv' 'openvdb' 'log4cplus')
makedepends=('cmake' 'boost' 'mesa' 'git' 'llvm' 'gcc')
conflicts=('blender')
options=(!strip)
install=fluid-designer.install
source=('http://download.microvellum.com/Fluid_Designer_Source_2015_R2.zip' 'fluid-designer.patch')
md5sums=('ac39fe3aad198e4d061c58c3a8c9764a' '63a44ecaff7c156ab6150f09ecc5b203')
prepare() {
cd "Fluid_Designer_Source"
patch -p1 < ../fluid-designer.patch
}
build() {
cd "Fluid_Designer_Source"
[[ -d build ]] && rm -r build
mkdir build && cd build
export CC=gcc
export CXX=g++
cmake -C../build_files/cmake/config/blender_full.cmake .. \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DWITH_INSTALL_PORTABLE=OFF \
-DWITH_PYTHON_INSTALL=OFF \
-DOPENIMAGEIO_ROOT_DIR=/usr \
-DWITH_LLVM=ON \
-DWITH_SYSTEM_OPENJPEG=ON \
-DWITH_GL_PROFILE_CORE=OFF \
-DWITH_GL_PROFILE_ES20=OFF \
-DLLVM_VERSION=3.8 \
-DLLVM_STATIC=ON \
-DWITH_CYCLES_CUDA_BINARIES=OFF \
-DWITH_CYCLES_OSL=OFF \
-DWITH_CYCLES_PTEX=OFF \
-DWITH_OPENSUBDIV=ON \
-DPYTHON_VERSION=3.5 \
-DPYTHON_LIBPATH=/usr/lib \
-DPYTHON_LIBRARY=python3.5m \
-DPYTHON_INCLUDE_DIRS=/usr/include/python3.5m
make # -j5 needs 48 GB of RAM while -j9 needs 64 GB
}
package() {
cd "Fluid_Designer_Source/build"
make DESTDIR="${pkgdir}" install
python -m compileall "${pkgdir}/usr/share/blender"
python -O -m compileall "${pkgdir}/usr/share/blender"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.