From 826577cfda929cf1025acf4f25ff07acdbb0576a Mon Sep 17 00:00:00 2001 From: Claude Heiland-Allen Date: Tue, 5 Dec 2023 11:15:38 +0000 Subject: [PATCH 01/12] remove executable bit from non-executable files --- Data/examples/triptychaos_examples.flame | 0 Data/tatasz_pack_04.gradient | 0 Data/tatasz_pack_05.gradient | 0 Data/tatasz_pack_06.gradient | 0 Data/tatasz_pack_07.gradient | 0 Source/EmberCL/EmberCLPch.h | 0 Source/EmberCL/IterOpenCLKernelCreator.cpp | 0 Source/EmberCL/RendererCL.cpp | 0 Source/EmberCL/RendererCL.h | 0 Source/Fractorium/GLWidget.cpp | 0 Source/Fractorium/Icons/grid.png | Bin Source/Fractorium/Icons/pic.png | Bin Source/Fractorium/Icons/reset_scale.png | Bin 13 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 Data/examples/triptychaos_examples.flame mode change 100755 => 100644 Data/tatasz_pack_04.gradient mode change 100755 => 100644 Data/tatasz_pack_05.gradient mode change 100755 => 100644 Data/tatasz_pack_06.gradient mode change 100755 => 100644 Data/tatasz_pack_07.gradient mode change 100755 => 100644 Source/EmberCL/EmberCLPch.h mode change 100755 => 100644 Source/EmberCL/IterOpenCLKernelCreator.cpp mode change 100755 => 100644 Source/EmberCL/RendererCL.cpp mode change 100755 => 100644 Source/EmberCL/RendererCL.h mode change 100755 => 100644 Source/Fractorium/GLWidget.cpp mode change 100755 => 100644 Source/Fractorium/Icons/grid.png mode change 100755 => 100644 Source/Fractorium/Icons/pic.png mode change 100755 => 100644 Source/Fractorium/Icons/reset_scale.png diff --git a/Data/examples/triptychaos_examples.flame b/Data/examples/triptychaos_examples.flame old mode 100755 new mode 100644 diff --git a/Data/tatasz_pack_04.gradient b/Data/tatasz_pack_04.gradient old mode 100755 new mode 100644 diff --git a/Data/tatasz_pack_05.gradient b/Data/tatasz_pack_05.gradient old mode 100755 new mode 100644 diff --git a/Data/tatasz_pack_06.gradient b/Data/tatasz_pack_06.gradient old mode 100755 new mode 100644 diff --git a/Data/tatasz_pack_07.gradient b/Data/tatasz_pack_07.gradient old mode 100755 new mode 100644 diff --git a/Source/EmberCL/EmberCLPch.h b/Source/EmberCL/EmberCLPch.h old mode 100755 new mode 100644 diff --git a/Source/EmberCL/IterOpenCLKernelCreator.cpp b/Source/EmberCL/IterOpenCLKernelCreator.cpp old mode 100755 new mode 100644 diff --git a/Source/EmberCL/RendererCL.cpp b/Source/EmberCL/RendererCL.cpp old mode 100755 new mode 100644 diff --git a/Source/EmberCL/RendererCL.h b/Source/EmberCL/RendererCL.h old mode 100755 new mode 100644 diff --git a/Source/Fractorium/GLWidget.cpp b/Source/Fractorium/GLWidget.cpp old mode 100755 new mode 100644 diff --git a/Source/Fractorium/Icons/grid.png b/Source/Fractorium/Icons/grid.png old mode 100755 new mode 100644 diff --git a/Source/Fractorium/Icons/pic.png b/Source/Fractorium/Icons/pic.png old mode 100755 new mode 100644 diff --git a/Source/Fractorium/Icons/reset_scale.png b/Source/Fractorium/Icons/reset_scale.png old mode 100755 new mode 100644 From 6ef145e76e6a1de4d218e9cb5a0f03aa0211dcaa Mon Sep 17 00:00:00 2001 From: Claude Heiland-Allen Date: Tue, 5 Dec 2023 11:16:12 +0000 Subject: [PATCH 02/12] bump debian compat version (allows parallel builds) --- debian/compat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/compat b/debian/compat index 3b0923b..d434014 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -9 +10 From a7b4cc70d6cc638704039c203e92fcd9abee8eda Mon Sep 17 00:00:00 2001 From: Claude Heiland-Allen Date: Tue, 5 Dec 2023 11:18:40 +0000 Subject: [PATCH 03/12] export raw histogram data --- Source/Ember/Renderer.cpp | 19 ++++++++++++++ Source/Ember/RendererBase.cpp | 34 ++++++++++++++++++++++++++ Source/Ember/RendererBase.h | 6 +++++ Source/EmberAnimate/EmberAnimate.cpp | 4 ++- Source/EmberCL/RendererCL.cpp | 32 ++++++++++++++++++++++-- Source/EmberCommon/EmberCommon.h | 16 +++++++++++- Source/EmberCommon/EmberOptions.h | 8 ++++++ Source/EmberGenome/EmberGenome.cpp | 2 ++ Source/EmberRender/EmberRender.cpp | 4 ++- Source/Fractorium/FractoriumRender.cpp | 3 ++- 10 files changed, 122 insertions(+), 6 deletions(-) diff --git a/Source/Ember/Renderer.cpp b/Source/Ember/Renderer.cpp index a95f0eb..455df8b 100644 --- a/Source/Ember/Renderer.cpp +++ b/Source/Ember/Renderer.cpp @@ -1137,6 +1137,25 @@ eRenderStatus Renderer::AccumulatorToFinalImage(vector& pixels, return eRenderStatus::RENDER_ERROR; } + if (RawHistogram()) + { + auto p = pixels.data() + finalOffset; + auto q = m_AccumulatorBuckets.data(); + auto bytes = sizeof(*p) * FinalRasW(); + parallel_for(size_t(0), FinalRasH(), size_t(1), [&](size_t j) + { + auto pixelsRowStart = (m_YAxisUp ? ((FinalRasH() - j) - 1) : j) * FinalRasW();//Pull out of inner loop for optimization. + auto rowStart = j * m_SuperRasW; + memcpy(p + pixelsRowStart, q + rowStart, bytes); + } +#if defined(_WIN32) || defined(__APPLE__) + , tbb::static_partitioner() +#endif + ); + LeaveFinalAccum(); + return m_Abort ? eRenderStatus::RENDER_ABORT : eRenderStatus::RENDER_OK; + } + //Timing t(4); const size_t filterWidth = m_SpatialFilter->FinalFilterWidth(); bucketT g, linRange, vibrancy; diff --git a/Source/Ember/RendererBase.cpp b/Source/Ember/RendererBase.cpp index 3509d7b..6ef94fe 100644 --- a/Source/Ember/RendererBase.cpp +++ b/Source/Ember/RendererBase.cpp @@ -374,6 +374,40 @@ void RendererBase::ReclaimOnResize(bool reclaimOnResize) ChangeVal([&] { m_ReclaimOnResize = reclaimOnResize; }, eProcessAction::FULL_RENDER); } +/// +/// Get whether to output raw histogram values instead of gamma corrected +/// colours. +/// Default: false. +/// +/// True if raw, else false. +bool RendererBase::RawHistogram() const { return m_RawHistogram; } + +/// +/// Set whether to output raw histogram values instead of gamma corrected +/// colours. +/// +/// True if raw, else false. +void RendererBase::RawHistogram(bool rawHistogram) +{ + ChangeVal([&] { m_RawHistogram = rawHistogram; }, eProcessAction::ACCUM_ONLY); +} + +/// +/// Get whether to output raw histogram values before density filtering. +/// Default: false. +/// +/// True if raw, else false. +bool RendererBase::RawHistogramPreDensity() const { return m_RawHistogramPreDensity; } + +/// +/// Set whether to output raw histogram values before density filtering. +/// +/// True if pre density, else false. +void RendererBase::RawHistogramPreDensity(bool rawHistogramPreDensity) +{ + ChangeVal([&] { m_RawHistogramPreDensity = rawHistogramPreDensity; }, eProcessAction::ACCUM_ONLY); +} + /// /// Set the callback object. /// diff --git a/Source/Ember/RendererBase.h b/Source/Ember/RendererBase.h index 542498e..32e213c 100644 --- a/Source/Ember/RendererBase.h +++ b/Source/Ember/RendererBase.h @@ -156,6 +156,10 @@ public: void InsertPalette(bool insertPalette); bool ReclaimOnResize() const; void ReclaimOnResize(bool reclaimOnResize); + bool RawHistogram() const; + void RawHistogram(bool rawHistogram); + bool RawHistogramPreDensity() const; + void RawHistogramPreDensity(bool rawHistogramPreDensity); void Callback(RenderCallback* callback); void ThreadCount(size_t threads, const char* seedString = nullptr); size_t BytesPerChannel() const; @@ -207,6 +211,8 @@ protected: bool m_InFinalAccum = false; bool m_InsertPalette = false; bool m_ReclaimOnResize = false; + bool m_RawHistogram = false; + bool m_RawHistogramPreDensity = false; bool m_CurvesSet = false; volatile bool m_Abort = false; volatile bool m_Pause = false; diff --git a/Source/EmberAnimate/EmberAnimate.cpp b/Source/EmberAnimate/EmberAnimate.cpp index 39a190f..036b33c 100644 --- a/Source/EmberAnimate/EmberAnimate.cpp +++ b/Source/EmberAnimate/EmberAnimate.cpp @@ -332,6 +332,8 @@ bool EmberAnimate(int argc, _TCHAR* argv[], EmberOptions& opt) r->EarlyClip(opt.EarlyClip()); r->YAxisUp(opt.YAxisUp()); r->LockAccum(opt.LockAccum()); + r->RawHistogram(opt.RawHistogram()); + r->RawHistogramPreDensity(opt.RawHistogramPreDensity()); r->PixelAspectRatio(T(opt.AspectRatio())); r->Priority(eThreadPriority(Clamp(intmax_t(opt.Priority()), intmax_t(eThreadPriority::LOWEST), intmax_t(eThreadPriority::HIGHEST)))); } @@ -471,7 +473,7 @@ bool EmberAnimate(int argc, _TCHAR* argv[], EmberOptions& opt) vector g(size); vector b(size); vector a(size); - Rgba32ToRgba32Exr(finalImagep, r.data(), g.data(), b.data(), a.data(), w, h, opt.Transparency()); + Rgba32ToRgba32Exr(finalImagep, r.data(), g.data(), b.data(), a.data(), w, h, opt.Transparency(), ! opt.RawHistogram()); const auto writeSuccess = WriteExr32(fn.c_str(), r.data(), g.data(), diff --git a/Source/EmberCL/RendererCL.cpp b/Source/EmberCL/RendererCL.cpp index 8f31d8d..615db39 100644 --- a/Source/EmberCL/RendererCL.cpp +++ b/Source/EmberCL/RendererCL.cpp @@ -433,8 +433,36 @@ template bool RendererCL::ReadFinal(v4F* pixels) { if (pixels && !m_Devices.empty()) - return m_Devices[0]->m_Wrapper.ReadImage(m_FinalImageName, FinalRasW(), FinalRasH(), 0, m_Devices[0]->m_Wrapper.Shared(), pixels); - + { + if (RawHistogram()) + { + if (RawHistogramPreDensity() ? ReadHist(0) : ReadAccum()) + { + auto p = pixels; + auto q = RawHistogramPreDensity() ? HistBuckets() : AccumulatorBuckets(); + auto bytes = sizeof(*p) * FinalRasW(); + parallel_for(size_t(0), FinalRasH(), size_t(1), [&](size_t j) + { + auto pixelsRowStart = (m_YAxisUp ? ((FinalRasH() - j) - 1) : j) * FinalRasW();//Pull out of inner loop for optimization. + auto rowStart = j * SuperRasW(); + memcpy(p + pixelsRowStart, q + rowStart, bytes); + } + #if defined(_WIN32) || defined(__APPLE__) + , tbb::static_partitioner() + #endif + ); + return true; + } + else + { + return false; + } + } + else + { + return m_Devices[0]->m_Wrapper.ReadImage(m_FinalImageName, FinalRasW(), FinalRasH(), 0, m_Devices[0]->m_Wrapper.Shared(), pixels); + } + } return false; } diff --git a/Source/EmberCommon/EmberCommon.h b/Source/EmberCommon/EmberCommon.h index 2fbc892..0da7db2 100644 --- a/Source/EmberCommon/EmberCommon.h +++ b/Source/EmberCommon/EmberCommon.h @@ -310,10 +310,13 @@ static void Rgba32ToRgbaExr(const v4F* rgba, Rgba* ilmfRgba, size_t width, size_ /// The width of the image in pixels /// The height of the image in pixels /// True to use alpha transparency, false to assign the max alpha value to make each pixel fully visible -static void Rgba32ToRgba32Exr(const v4F* rgba, float* r, float* g, float* b, float* a, size_t width, size_t height, bool doAlpha) +/// True to clamp output to 0..1, false to use full high dynamic range +static void Rgba32ToRgba32Exr(const v4F* rgba, float* r, float* g, float* b, float* a, size_t width, size_t height, bool doAlpha, bool doClamp) { if (rgba != nullptr && r != nullptr && g != nullptr && b != nullptr && a != nullptr) { + if (doClamp) + { for (size_t i = 0; i < (width * height); i++) { r[i] = Clamp(Sqr(rgba[i].r), 0.0f, 1.0f); @@ -321,6 +324,17 @@ static void Rgba32ToRgba32Exr(const v4F* rgba, float* r, float* g, float* b, flo b[i] = Clamp(Sqr(rgba[i].b), 0.0f, 1.0f); a[i] = doAlpha ? Clamp(rgba[i].a * 1.0f, 0.0f, 1.0f) : 1.0f; } + } + else + { + for (size_t i = 0; i < (width * height); i++) + { + r[i] = rgba[i].r; + g[i] = rgba[i].g; + b[i] = rgba[i].b; + a[i] = rgba[i].a; + } + } } } diff --git a/Source/EmberCommon/EmberOptions.h b/Source/EmberCommon/EmberOptions.h index 9bc0a5e..da9828d 100644 --- a/Source/EmberCommon/EmberOptions.h +++ b/Source/EmberCommon/EmberOptions.h @@ -70,6 +70,8 @@ enum class eOptionIDs : et OPT_DUMP_KERNEL, OPT_FLAM3_COMPAT, OPT_IGNORE_EXISTING, + OPT_RAW_HISTOGRAM, + OPT_RAW_HISTOGRAM_PRE_DENSITY, //Value args. OPT_NTHREADS,//Int value args. @@ -378,6 +380,8 @@ public: INITBOOLOPTION(DumpKernel, Eob(eOptionUse::OPT_USE_RENDER, eOptionIDs::OPT_DUMP_KERNEL, _T("--dump_kernel"), false, SO_NONE, " --dump_kernel Print the iteration kernel string when using OpenCL (ignored for CPU) [default: false].\n")); INITBOOLOPTION(Flam3Compat, Eob(eOptionUse::OPT_USE_ALL, eOptionIDs::OPT_FLAM3_COMPAT, _T("--flam3_compat"), false, SO_NONE, " --flam3_compat The behavior of the cos, cosh, cot, coth, csc, csch, sec, sech, sin, sinh, tan and tanh variations are different in flam3/Apophysis versus Chaotica. True for flam3/Apophysis behavior, false for Chaotica behavior [default: true].\n")); INITBOOLOPTION(IgnoreExisting, Eob(eOptionUse::OPT_USE_ANIMATE, eOptionIDs::OPT_IGNORE_EXISTING, _T("--ignore-existing"), false, SO_NONE, " --ignore-existing Skip animating a frame if the output images for all of the specified file output types already exist in the output folder [default: false].\n")); + INITBOOLOPTION(RawHistogram, Eob(eOptionUse::OPT_USE_ALL, eOptionIDs::OPT_RAW_HISTOGRAM, _T("--raw_histogram"), false, SO_NONE, " --raw_histogram Output raw histogram values (after density filter, before gamma correction). For best results, use EXR 32-bit float and set supersampling to 1x. [default: false].\n")); + INITBOOLOPTION(RawHistogramPreDensity, Eob(eOptionUse::OPT_USE_ALL, eOptionIDs::OPT_RAW_HISTOGRAM_PRE_DENSITY, _T("--raw_histogram_pre_density"), false, SO_NONE, " --raw_histogram_pre_density Output raw histogram values before density filter instead of afterwards. Requires --raw_histogram. [default: false].\n")); //Int. INITINTOPTION(Symmetry, Eoi(eOptionUse::OPT_USE_GENOME, eOptionIDs::OPT_SYMMETRY, _T("--symmetry"), 0, SO_REQ_SEP, " --symmetry= Set symmetry of result [default: 0].\n")); INITINTOPTION(SheepGen, Eoi(eOptionUse::OPT_USE_GENOME, eOptionIDs::OPT_SHEEP_GEN, _T("--sheep_gen"), -1, SO_REQ_SEP, " --sheep_gen= Sheep generation of this flame [default: -1].\n")); @@ -541,6 +545,8 @@ public: PARSEBOOLOPTION(eOptionIDs::OPT_DUMP_KERNEL, DumpKernel); PARSEBOOLOPTION(eOptionIDs::OPT_FLAM3_COMPAT, Flam3Compat); PARSEBOOLOPTION(eOptionIDs::OPT_IGNORE_EXISTING, IgnoreExisting); + PARSEBOOLOPTION(eOptionIDs::OPT_RAW_HISTOGRAM, RawHistogram); + PARSEBOOLOPTION(eOptionIDs::OPT_RAW_HISTOGRAM_PRE_DENSITY, RawHistogramPreDensity); PARSEOPTION(eOptionIDs::OPT_SYMMETRY, Symmetry);//Int args PARSEOPTION(eOptionIDs::OPT_SHEEP_GEN, SheepGen); PARSEOPTION(eOptionIDs::OPT_SHEEP_ID, SheepId); @@ -833,6 +839,8 @@ public: Eob DumpKernel; Eob Flam3Compat; Eob IgnoreExisting; + Eob RawHistogram; + Eob RawHistogramPreDensity; Eoi Symmetry;//Value int. Eoi SheepGen; diff --git a/Source/EmberGenome/EmberGenome.cpp b/Source/EmberGenome/EmberGenome.cpp index c10d065..6e51fc9 100644 --- a/Source/EmberGenome/EmberGenome.cpp +++ b/Source/EmberGenome/EmberGenome.cpp @@ -603,6 +603,8 @@ bool EmberGenome(int argc, _TCHAR* argv[], EmberOptions& opt) renderer->EarlyClip(opt.EarlyClip()); renderer->YAxisUp(opt.YAxisUp()); renderer->LockAccum(opt.LockAccum()); + renderer->RawHistogram(opt.RawHistogram()); + renderer->RawHistogramPreDensity(opt.RawHistogramPreDensity()); renderer->PixelAspectRatio(T(opt.AspectRatio())); if (opt.Repeat() == 0) diff --git a/Source/EmberRender/EmberRender.cpp b/Source/EmberRender/EmberRender.cpp index 19b9742..21f6cf4 100644 --- a/Source/EmberRender/EmberRender.cpp +++ b/Source/EmberRender/EmberRender.cpp @@ -153,6 +153,8 @@ bool EmberRender(int argc, _TCHAR* argv[], EmberOptions& opt) renderer->EarlyClip(opt.EarlyClip()); renderer->YAxisUp(opt.YAxisUp()); renderer->LockAccum(opt.LockAccum()); + renderer->RawHistogram(opt.RawHistogram()); + renderer->RawHistogramPreDensity(opt.RawHistogramPreDensity()); renderer->InsertPalette(opt.InsertPalette()); renderer->PixelAspectRatio(T(opt.AspectRatio())); renderer->Priority(eThreadPriority(Clamp(intmax_t(opt.Priority()), intmax_t(eThreadPriority::LOWEST), intmax_t(eThreadPriority::HIGHEST)))); @@ -447,7 +449,7 @@ bool EmberRender(int argc, _TCHAR* argv[], EmberOptions& opt) vector g(size); vector b(size); vector a(size); - Rgba32ToRgba32Exr(finalImagep, r.data(), g.data(), b.data(), a.data(), finalEmber.m_FinalRasW, finalEmber.m_FinalRasH, opt.Transparency()); + Rgba32ToRgba32Exr(finalImagep, r.data(), g.data(), b.data(), a.data(), finalEmber.m_FinalRasW, finalEmber.m_FinalRasH, opt.Transparency(), ! opt.RawHistogram()); const auto writeSuccess = WriteExr32(filename.c_str(), r.data(), g.data(), diff --git a/Source/Fractorium/FractoriumRender.cpp b/Source/Fractorium/FractoriumRender.cpp index e03afdf..23421a3 100644 --- a/Source/Fractorium/FractoriumRender.cpp +++ b/Source/Fractorium/FractoriumRender.cpp @@ -183,7 +183,8 @@ bool FractoriumEmberControllerBase::SaveCurrentRender(const QString& filename, c vector g(size); vector b(size); vector a(size); - Rgba32ToRgba32Exr(data, r.data(), g.data(), b.data(), a.data(), width, height, transparency); + bool raw_histogram = false; + Rgba32ToRgba32Exr(data, r.data(), g.data(), b.data(), a.data(), width, height, transparency, ! raw_histogram); ret = WriteExr32(s.c_str(), r.data(), g.data(), b.data(), a.data(), width, height, true, comments, id, url, nick); } } From 2d42c8c4a8af63e160d90a77b0f6313d98c4b6c7 Mon Sep 17 00:00:00 2001 From: Claude Heiland-Allen Date: Tue, 5 Dec 2023 11:26:21 +0000 Subject: [PATCH 04/12] dos2unix package-linux.sh --- package-linux.sh | 368 +++++++++++++++++++++++------------------------ 1 file changed, 184 insertions(+), 184 deletions(-) diff --git a/package-linux.sh b/package-linux.sh index e21d1b2..84a0f83 100755 --- a/package-linux.sh +++ b/package-linux.sh @@ -1,184 +1,184 @@ -#!/bin/bash - -USAGE="`basename $0` -Run this script from the project root. - -Without options, the default is to build a signed source package for uploading -to a Launchpad PPA. - -Options: - --h --help - ---binary-only ---source-only ---source-and-binary ---signed ---unsigned" - -PROJECT=fractorium - -changelogVersion=$(cat ./debian/changelog | head -n 1 | sed 's/^'$PROJECT' (\([^-]\+\)-.*/\1/') -emberVersion=$(grep '#define EMBER_VERSION' ./Source/Ember/EmberDefines.h | sed 's/^.*EMBER_VERSION "\([^"]\+\)".*/\1/') - -a=$(echo -n "$changelogVersion" | sed 's/[a-z]//g') -b=$(echo -n "$emberVersion" | sed 's/[a-z]//g') - -if [[ "$a" != "$b" ]]; then - echo "Error: Different version numbers were found. Please update the correct file, -the version numbers should agree up to the digits in: - -$changelogVersion -$emberVersion - -./debian/changelog : $a -./Source/Ember/EmberDefines.h : $b" - exit 2 -fi - -VERSION=$changelogVersion -PROJECT_ROOT=$PWD -PPA_DIR="$HOME/PPA/$PROJECT-$VERSION" -TAR_NAME="$PROJECT-$VERSION.tar.gz" - -if [ ! -d '.git' -o ! -f 'main.pro' ]; then - echo "Run `basename $0` from the project root." - exit 2 -fi - -# Set defaults. -OPT_BUILD_BINARY=0 -OPT_BUILD_SOURCE=1 -OPT_SIGNED=1 - -while [ $# -gt 0 ]; do - case "$1" in - --binary-only) OPT_BUILD_SOURCE=0 - OPT_BUILD_BINARY=1 - ;; - --source-only) OPT_BUILD_SOURCE=1 - OPT_BUILD_BINARY=0 - ;; - --source-and-binary) OPT_BUILD_SOURCE=1 - OPT_BUILD_BINARY=1 - ;; - --signed) OPT_SIGNED=1 - ;; - --unsigned) OPT_SIGNED=0 - ;; - -h|--help) echo "$USAGE" - exit 0;; - esac - shift -done - -tarversion=$(tar --version | head -1 | sed -e 's/tar (GNU tar) \+\([0-9\.]\+\)$/\1/; s/[^0-9]//g; s/\(.\{3\}\).*/\1/;') - -if [[ "$tarversion" -lt "128" ]]; then - echo "Tar >= 1.28 is required. Download the .deb from https://launchpad.net/ubuntu/+source/tar/ and install manually." - exit 2 -fi - -if [ ! -d "$PPA_DIR" ]; then - mkdir -p "$PPA_DIR" -else - echo -n "PPA work folder already exists: $PPA_DIR -Move this folder aside or remove it. -" - exit 2 -fi - -# tar 1.28 required for --exclude-vcs-ignores - -# NOTE: ./Data/flam3-palettes.xml has to be explicitly included. The *.xml rule -# would exclude it, and tar doesn't handle "!" rules. - -tar --exclude='package-linux.sh' \ - --exclude='debian' \ - --exclude='Bin' \ - --exclude-vcs \ - --exclude-vcs-ignores \ - --exclude-backups \ - -czf "$PPA_DIR/$TAR_NAME" \ - ./Data/flam3-palettes.xml \ - ./Data/boxtail_pack_02.gradient \ - ./Data/boxtail_pack_03_triangle.gradient \ - ./Data/boxtail_pack_04_mineshack.gradient \ - ./Data/fardareismai_pack_01_variety_number_128.gradient \ - ./Data/fardareismai_pack_02_b_sides.gradient \ - ./Data/fardareismai_pack_03_old_and_new.gradient \ - ./Data/fardareismai_pack_04_hoard.gradient \ - ./Data/fractaldesire_pack_01.gradient \ - ./Data/rce_ordinary_pack_01_colornation.gradient \ - ./Data/tatasz_pack_01.gradient \ - ./Data/tatasz_pack_02_colder.gradient \ - ./Data/tatasz_pack_02_dark.gradient \ - ./Data/tatasz_pack_02_warmer.gradient \ - ./Data/tatasz_pack_03.gradient \ - ./Data/tatasz_pack_04.gradient \ - ./Data/tatasz_pack_05.gradient \ - ./Data/tatasz_pack_06.gradient \ - ./Data/tatasz_pack_07.gradient \ - ./Data/Amphibole_Supergroup.ugr \ - ./Data/Apatite_Supergroup.ugr \ - ./Data/Feldspar_Group.ugr \ - ./Data/Mica_Group.ugr \ - ./Data/Quartz_Varieties.ugr \ - ./Data/dark_linux.qss \ - ./Data/lightdark.qss \ - ./Data/uranium.qss \ - ./Data/examples/b33rheart_examples.flame \ - ./Data/examples/b33rheart_sierpinski.flame \ - ./Data/examples/c-91_examples.flame \ - ./Data/examples/pillemaster_hexagonal_tilings.flame \ - ./Data/examples/plangkye_examples.flame \ - ./Data/examples/tatasz_examples.flame \ - ./Data/examples/tatasz_substitution.flame \ - ./Data/examples/triptychaos_examples.flame \ - ./Data/examples/tyrantwave_base_forms.flame \ - . - -[ $? -ne 0 ] && echo "Tar command failed." && exit 2 - -cd "$PPA_DIR" -bzr dh_make $PROJECT $VERSION $TAR_NAME - -[ $? -ne 0 ] && echo "bzr dh_make command failed." && exit 2 - -rm "$PPA_DIR/fractorium/debian" -r -cp -R "$PROJECT_ROOT/debian" "$PPA_DIR/fractorium" - -cd "$PPA_DIR/fractorium" &&\ - bzr add . &&\ - bzr commit -m "Debian package $VERSION" - -[ $? -ne 0 ] && echo "bzr command failed." && exit 2 - -# Build a source package. - -# Launchpad only needs a signed source package. It will build its own binary on -# the servers. - -if [ $OPT_BUILD_SOURCE -eq 1 ]; then - if [ $OPT_SIGNED -eq 1 ]; then - bzr builddeb -- -S - else - bzr builddeb -- -S -us -uc - fi -fi - -[ $? -ne 0 ] && echo "bzr builddeb for source package failed." && exit 2 - -# Build an binary package. - -if [ $OPT_BUILD_BINARY -eq 1 ]; then - if [ $OPT_SIGNED -eq 1 ]; then - bzr builddeb -- -b - else - bzr builddeb -- -b -us -uc - fi -fi - -[ $? -ne 0 ] && echo "bzr builddeb for source package failed." && exit 2 - - +#!/bin/bash + +USAGE="`basename $0` +Run this script from the project root. + +Without options, the default is to build a signed source package for uploading +to a Launchpad PPA. + +Options: + +-h --help + +--binary-only +--source-only +--source-and-binary +--signed +--unsigned" + +PROJECT=fractorium + +changelogVersion=$(cat ./debian/changelog | head -n 1 | sed 's/^'$PROJECT' (\([^-]\+\)-.*/\1/') +emberVersion=$(grep '#define EMBER_VERSION' ./Source/Ember/EmberDefines.h | sed 's/^.*EMBER_VERSION "\([^"]\+\)".*/\1/') + +a=$(echo -n "$changelogVersion" | sed 's/[a-z]//g') +b=$(echo -n "$emberVersion" | sed 's/[a-z]//g') + +if [[ "$a" != "$b" ]]; then + echo "Error: Different version numbers were found. Please update the correct file, +the version numbers should agree up to the digits in: + +$changelogVersion +$emberVersion + +./debian/changelog : $a +./Source/Ember/EmberDefines.h : $b" + exit 2 +fi + +VERSION=$changelogVersion +PROJECT_ROOT=$PWD +PPA_DIR="$HOME/PPA/$PROJECT-$VERSION" +TAR_NAME="$PROJECT-$VERSION.tar.gz" + +if [ ! -d '.git' -o ! -f 'main.pro' ]; then + echo "Run `basename $0` from the project root." + exit 2 +fi + +# Set defaults. +OPT_BUILD_BINARY=0 +OPT_BUILD_SOURCE=1 +OPT_SIGNED=1 + +while [ $# -gt 0 ]; do + case "$1" in + --binary-only) OPT_BUILD_SOURCE=0 + OPT_BUILD_BINARY=1 + ;; + --source-only) OPT_BUILD_SOURCE=1 + OPT_BUILD_BINARY=0 + ;; + --source-and-binary) OPT_BUILD_SOURCE=1 + OPT_BUILD_BINARY=1 + ;; + --signed) OPT_SIGNED=1 + ;; + --unsigned) OPT_SIGNED=0 + ;; + -h|--help) echo "$USAGE" + exit 0;; + esac + shift +done + +tarversion=$(tar --version | head -1 | sed -e 's/tar (GNU tar) \+\([0-9\.]\+\)$/\1/; s/[^0-9]//g; s/\(.\{3\}\).*/\1/;') + +if [[ "$tarversion" -lt "128" ]]; then + echo "Tar >= 1.28 is required. Download the .deb from https://launchpad.net/ubuntu/+source/tar/ and install manually." + exit 2 +fi + +if [ ! -d "$PPA_DIR" ]; then + mkdir -p "$PPA_DIR" +else + echo -n "PPA work folder already exists: $PPA_DIR +Move this folder aside or remove it. +" + exit 2 +fi + +# tar 1.28 required for --exclude-vcs-ignores + +# NOTE: ./Data/flam3-palettes.xml has to be explicitly included. The *.xml rule +# would exclude it, and tar doesn't handle "!" rules. + +tar --exclude='package-linux.sh' \ + --exclude='debian' \ + --exclude='Bin' \ + --exclude-vcs \ + --exclude-vcs-ignores \ + --exclude-backups \ + -czf "$PPA_DIR/$TAR_NAME" \ + ./Data/flam3-palettes.xml \ + ./Data/boxtail_pack_02.gradient \ + ./Data/boxtail_pack_03_triangle.gradient \ + ./Data/boxtail_pack_04_mineshack.gradient \ + ./Data/fardareismai_pack_01_variety_number_128.gradient \ + ./Data/fardareismai_pack_02_b_sides.gradient \ + ./Data/fardareismai_pack_03_old_and_new.gradient \ + ./Data/fardareismai_pack_04_hoard.gradient \ + ./Data/fractaldesire_pack_01.gradient \ + ./Data/rce_ordinary_pack_01_colornation.gradient \ + ./Data/tatasz_pack_01.gradient \ + ./Data/tatasz_pack_02_colder.gradient \ + ./Data/tatasz_pack_02_dark.gradient \ + ./Data/tatasz_pack_02_warmer.gradient \ + ./Data/tatasz_pack_03.gradient \ + ./Data/tatasz_pack_04.gradient \ + ./Data/tatasz_pack_05.gradient \ + ./Data/tatasz_pack_06.gradient \ + ./Data/tatasz_pack_07.gradient \ + ./Data/Amphibole_Supergroup.ugr \ + ./Data/Apatite_Supergroup.ugr \ + ./Data/Feldspar_Group.ugr \ + ./Data/Mica_Group.ugr \ + ./Data/Quartz_Varieties.ugr \ + ./Data/dark_linux.qss \ + ./Data/lightdark.qss \ + ./Data/uranium.qss \ + ./Data/examples/b33rheart_examples.flame \ + ./Data/examples/b33rheart_sierpinski.flame \ + ./Data/examples/c-91_examples.flame \ + ./Data/examples/pillemaster_hexagonal_tilings.flame \ + ./Data/examples/plangkye_examples.flame \ + ./Data/examples/tatasz_examples.flame \ + ./Data/examples/tatasz_substitution.flame \ + ./Data/examples/triptychaos_examples.flame \ + ./Data/examples/tyrantwave_base_forms.flame \ + . + +[ $? -ne 0 ] && echo "Tar command failed." && exit 2 + +cd "$PPA_DIR" +bzr dh_make $PROJECT $VERSION $TAR_NAME + +[ $? -ne 0 ] && echo "bzr dh_make command failed." && exit 2 + +rm "$PPA_DIR/fractorium/debian" -r +cp -R "$PROJECT_ROOT/debian" "$PPA_DIR/fractorium" + +cd "$PPA_DIR/fractorium" &&\ + bzr add . &&\ + bzr commit -m "Debian package $VERSION" + +[ $? -ne 0 ] && echo "bzr command failed." && exit 2 + +# Build a source package. + +# Launchpad only needs a signed source package. It will build its own binary on +# the servers. + +if [ $OPT_BUILD_SOURCE -eq 1 ]; then + if [ $OPT_SIGNED -eq 1 ]; then + bzr builddeb -- -S + else + bzr builddeb -- -S -us -uc + fi +fi + +[ $? -ne 0 ] && echo "bzr builddeb for source package failed." && exit 2 + +# Build an binary package. + +if [ $OPT_BUILD_BINARY -eq 1 ]; then + if [ $OPT_SIGNED -eq 1 ]; then + bzr builddeb -- -b + else + bzr builddeb -- -b -us -uc + fi +fi + +[ $? -ne 0 ] && echo "bzr builddeb for source package failed." && exit 2 + + From cace6fc9a278823d4ffbd19d47e512aa0d97392b Mon Sep 17 00:00:00 2001 From: Claude Heiland-Allen Date: Tue, 5 Dec 2023 11:27:35 +0000 Subject: [PATCH 05/12] debian changelog --- debian/changelog | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/debian/changelog b/debian/changelog index 23dba65..523f4e5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +fractorium (23.23.8.101-0ubuntu1~pre0) UNRELEASED; urgency=medium + + * Non-maintainer upload. + * Differences from upstream: + * remove executable bit from non-executable files + * bump debian compat version (allows parallel builds) + * export raw histogram data + * line endings in package-linux.sh + + -- Claude Heiland-Allen Tue, 05 Dec 2023 11:22:23 +0000 + fractorium (22.21.4.2-0ubuntu1) bionic; urgency=low * release 22.21.4.2 From f4490a6ed3f876761e9d1175bf513d0cc6f8b139 Mon Sep 17 00:00:00 2001 From: Claude Heiland-Allen Date: Tue, 5 Dec 2023 13:32:31 +0000 Subject: [PATCH 06/12] update dependencies to OpenEXR 3.1 --- Builds/QtCreator/defaults.pri | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Builds/QtCreator/defaults.pri b/Builds/QtCreator/defaults.pri index 8a9af96..d5b853e 100644 --- a/Builds/QtCreator/defaults.pri +++ b/Builds/QtCreator/defaults.pri @@ -101,12 +101,13 @@ win32 { !win32 { LIBS += -ljpeg LIBS += -lpng - LIBS += -lpthread - LIBS += -lIlmImf - LIBS += -lHalf - LIBS += -lImath - LIBS += -lIex LIBS += -lxml2 + LIBS += -lz + LIBS += -lpthread + LIBS += -lIex-3_1 + LIBS += -lIlmThread-3_1 + LIBS += -lImath-3_1 + LIBS += -lOpenEXR-3_1 } macx { From 0cdfc207b5104be44b5f95c20e01a3a3b920fda1 Mon Sep 17 00:00:00 2001 From: Claude Heiland-Allen Date: Tue, 5 Dec 2023 13:32:56 +0000 Subject: [PATCH 07/12] add alternative for _strnicmp on non-Windows --- Source/Ember/Utils.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Ember/Utils.h b/Source/Ember/Utils.h index 0ce97aa..7d81721 100644 --- a/Source/Ember/Utils.h +++ b/Source/Ember/Utils.h @@ -2,6 +2,10 @@ #include "Isaac.h" +#ifndef _WIN32 +#define _strnicmp strncasecmp +#endif + /// /// Global utility classes and functions that don't really fit anywhere else, but are /// too small to justify being in their own file. From 0df7c864c4e23994a31c5c5fb9d7d005244921ff Mon Sep 17 00:00:00 2001 From: Claude Heiland-Allen Date: Tue, 5 Dec 2023 13:34:03 +0000 Subject: [PATCH 08/12] remove unused mime type from desktop file (fixes lintian warning) --- Data/Fractorium.desktop | 1 - 1 file changed, 1 deletion(-) diff --git a/Data/Fractorium.desktop b/Data/Fractorium.desktop index e8b2678..86c7219 100644 --- a/Data/Fractorium.desktop +++ b/Data/Fractorium.desktop @@ -9,4 +9,3 @@ TryExec=fractorium Icon=/usr/share/fractorium/Fractorium.png Terminal=false Categories=Graphics; -MimeType= \ No newline at end of file From 691d86861ec54dc6b8fb716064e1be9a038f3e91 Mon Sep 17 00:00:00 2001 From: Claude Heiland-Allen Date: Tue, 5 Dec 2023 13:34:54 +0000 Subject: [PATCH 09/12] fix lintian warning about description starting with article --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 44352f8..802325f 100644 --- a/debian/control +++ b/debian/control @@ -11,7 +11,7 @@ Vcs-Browser: https://bitbucket.org/mfeemster/fractorium Package: fractorium Architecture: amd64 Depends: ${shlibs:Depends}, ${misc:Depends} -Description: A fractal flame editor with GPU support +Description: fractal flame editor with GPU support Fractorium . A fractal flame editor with GPU support. From 5aef5b8273286749dc9d1ea20bfe8393808e00e3 Mon Sep 17 00:00:00 2001 From: Claude Heiland-Allen Date: Tue, 5 Dec 2023 13:56:01 +0000 Subject: [PATCH 10/12] dos2unix debian/rules --- debian/rules | 64 ++++++++++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/debian/rules b/debian/rules index 025e5ee..ce15cce 100755 --- a/debian/rules +++ b/debian/rules @@ -1,32 +1,32 @@ -#!/usr/bin/make -f -# See debhelper(7) (uncomment to enable) -# output every command that modifies files on the build system. -#DH_VERBOSE = 1 - -# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/* -DPKG_EXPORT_BUILDFLAGS = 1 -include /usr/share/dpkg/default.mk - -# see FEATURE AREAS in dpkg-buildflags(1) -#export DEB_BUILD_MAINT_OPTIONS = hardening=+all - -# see ENVIRONMENT in dpkg-buildflags(1) -# package maintainers to append CFLAGS -#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic -# package maintainers to append LDFLAGS -#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed - - -# main packaging script based on dh7 syntax -%: - dh $@ - -# debmake generated override targets -# This is example for Cmake (See http://bugs.debian.org/641051 ) -#override_dh_auto_configure: -# dh_auto_configure -- \ -# -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) - - - - +#!/usr/bin/make -f +# See debhelper(7) (uncomment to enable) +# output every command that modifies files on the build system. +#DH_VERBOSE = 1 + +# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/* +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/default.mk + +# see FEATURE AREAS in dpkg-buildflags(1) +#export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +# see ENVIRONMENT in dpkg-buildflags(1) +# package maintainers to append CFLAGS +#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +# package maintainers to append LDFLAGS +#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed + + +# main packaging script based on dh7 syntax +%: + dh $@ + +# debmake generated override targets +# This is example for Cmake (See http://bugs.debian.org/641051 ) +#override_dh_auto_configure: +# dh_auto_configure -- \ +# -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) + + + + From a13b7ad31dda3edc27bf33d8cdea1eb2151be90f Mon Sep 17 00:00:00 2001 From: Claude Heiland-Allen Date: Tue, 5 Dec 2023 13:56:49 +0000 Subject: [PATCH 11/12] update debian build-depends for Qt 6 --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 802325f..6835ba7 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: fractorium Section: graphics Priority: optional Maintainer: Matt Feemster -Build-Depends: debhelper (>= 9), g++ (>= 5.4), libc6-dev, libgl1-mesa-dev, libgl-dev, libglm-dev, libjpeg-dev, libpng-dev, libqt5opengl5-dev, libxml2-dev, ocl-icd-libopencl1, ocl-icd-opencl-dev, opencl-headers, qt5-default, qt5-qmake, qtbase5-dev, libopenexr-dev +Build-Depends: debhelper (>= 9), g++ (>= 5.4), libc6-dev, libgl1-mesa-dev, libgl-dev, libglm-dev, libjpeg-dev, libpng-dev, qt6-base-dev, libxml2-dev, ocl-icd-opencl-dev, opencl-headers, qmake6, libopenexr-dev Standards-Version: 3.9.5 Homepage: http://fractorium.com/ Vcs-Git: https://bitbucket.org/mfeemster/fractorium From ea5cf59892a7324c3dbc3a7c4bc9e36aa95410f0 Mon Sep 17 00:00:00 2001 From: Claude Heiland-Allen Date: Tue, 5 Dec 2023 14:00:07 +0000 Subject: [PATCH 12/12] debian changelog --- debian/changelog | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 523f4e5..bb929f6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,12 +2,18 @@ fractorium (23.23.8.101-0ubuntu1~pre0) UNRELEASED; urgency=medium * Non-maintainer upload. * Differences from upstream: + * update debian build-depends for Qt 6 + * dos2unix debian/rules + * fix lintian warning about description starting with article + * remove unused mime type from desktop file (fixes lintian warning) + * add alternative for _strnicmp on non-Windows + * update dependencies to OpenEXR 3.1 * remove executable bit from non-executable files * bump debian compat version (allows parallel builds) * export raw histogram data * line endings in package-linux.sh - -- Claude Heiland-Allen Tue, 05 Dec 2023 11:22:23 +0000 + -- Claude Heiland-Allen Tue, 05 Dec 2023 14:00:00 +0000 fractorium (22.21.4.2-0ubuntu1) bionic; urgency=low