Commit Graph

50 Commits

Author SHA1 Message Date
Jacob Boerema ef817dc452 plug-ins: fix Windows build in UCRT environment
The UCRT environment is a successor to the MINGW environment on Windows
with a more modern C runtime library.
Building under UCRT we get this error:
../../gimp/plug-ins/file-raw/file-darktable.c:420:7: error:
 function '__p__environ' is initialized like a variable"

To fix this we use the relevant part of patch 6 from:
https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-gimp
2022-05-17 17:23:06 -04:00
Jehan 52928e04a5 Issue #7327: Cannot build GIMP3 on MSYS2 using Meson.
This is untested on my side, because the bug only happens on native
builds with meson (our CI has cross-builds with meson and native builds
with autotools and I only do cross-builds locally) but I think/hope it
will work.

Basically we were using .full_path() because these rc files were also
used as input of some configure_file() calls which doesn't like custom
target objects as input (it wants strings or file objects). Yet a bug
in meson didn't like the colon used in native Windows full paths ('C:'
and such) when used in windows.compile_resources(). This has been fixed
by Luca Bacci in: https://github.com/mesonbuild/meson/pull/9368
Yet we just cannot depend on very early meson (or worse dev meson code).

On the other hand, if the input is a custom_tgt object, it uses the
object ID which we give as first parameter of custom_target() so we know
it's appropriately named without colons (such as 'gimp_plugins_rc').
Thus we should not bump into this issue again.

For the few usage in configure_file(), I just add a .full_path() only
when needed at call time.

Last but not least, I replace the bogus `meson --version` call by a
`python3 -c 'exit()'` as advised by Eli Schwartz:
2afa019c70 (note_1284951)

The reason is that it is apparently possible (or will be when some
reimplementation of meson will be done) that the `meson` executable
itself does not exist. On the other hand, `python3` should always be
there, as a mandatory dependency of the build tool.

In order to use an appropriate `python3`, I made the
pythonmod.find_installation() check required in our build (which should
not be a problem since it's a meson requirement as well), even when the
-Dpython option is false (this one depends on other requirements too
anyway, such as version and pygobject). This way I can call this meson
variable of discovered python in my bogus call, instead of calling a
(potentially different) python from PATH environment.
2021-10-12 17:06:18 +02:00
Jehan e61adec232 plug-ins: more g_file_get_path() changed to g_file_peek_path().
Also some g_unlink() changed into g_file_delete().

And a g_file_get_path() followed by g_path_get_basename() changed into
g_file_get_basename() only.
2021-10-01 22:59:53 +02:00
William Ferguson 636eb02edc plug-ins: update darktable lua script to API change in darktable master
The Lua API is undergoing changes in darktable master. I've fixed the lua-scripts repository as I've made
changes, but I forgot about the collateral damage.

Attached is a fixed version of file-darktable-export-on-exit.lua which should be good for darktable 3.6 and
beyond.

Fixes #6421
2021-02-15 17:11:32 +00:00
Jehan 7465b0782a plug-ins: more debugging data in file-darktable.
darktable GUI is "mangled" when opened from GIMP for a reporter. There
was already some debug info outputted (when running with DARKTABLE_DEBUG
environment variable). Adding the environment list (and some separation
titles to make it easier to distinguish what is what). Hopefully it will
help debugging.
See #6195 and https://github.com/darktable-org/darktable/issues/7402
2021-01-18 14:37:02 +01:00
Niels De Graef ae34e778fc meson: Use libgimp(ui)_dep in plug-ins meson files
This gives a big cleanup in the meson.build files of the plug-ins.

It's also quite a bit more maintainable, since anything that changes in
libgimp's dependencies, linkage, ... doesn't have to be copy-pasted into
each plug-in.
2020-05-11 07:01:37 +02:00
Jehan 3a0af1f50a Issue #4618: support Canon CR3.
And by "supporting CR3", I mean sending the file over to raw developer
software which are supposed to support it! At the very least RawTherapee
support CR3 (since recent version 5.8 apparently), not sure about
darktable (but if not yet, I assume it won't be long either).
2020-03-14 23:56:45 +01:00
Michael Natterer 6468fa06c7 pdb, plug-ins: change gimp_temp_name() to gimp_temp_file() 2019-09-11 22:32:44 +02:00
Michael Natterer 6bca8c4f89 pdb, app, libgimp, plug-ins: replace most PDB filenames/URIs by GFile
and in an attack of madness, changes almost all file plug-in
code to use GFile instead of filenames, which means passing
the GFile down to the bottom and get its filename at the very
end where it's actually needed.
2019-09-11 21:48:34 +02:00
Félix Piédallu 65eff6f150 Meson port. 2019-09-11 16:42:04 +02:00
Michael Natterer f3fb3d1a57 Remove the second "raw-filename"/"raw-uri" parameter from file procedures
It's an ancient concept from ancient times when we didn't have URIs
and only filenames (not to speak of GFile), and actually even from
before the ancient time before that ancient time when we first had
ones and zeros, and only had zeros.
2019-09-11 00:21:03 +02:00
Michael Natterer 4da47e2596 plug-ins: it's "darktable" not "placeholder"...
seems i did a bit too much search/replace when porting file-raw.
2019-09-07 19:59:48 +02:00
Michael Natterer 8a78203aed Properly prefix the values of enum GimpPDBProcType
to be GIMP_PDB_PROC_TYPE_PLUGIN, _EXTENSION etc.
2019-08-30 12:52:28 +02:00
Jehan c95e9334d1 plug-ins: port file-raw plug-ins to GimpImage/GimpDrawable. 2019-08-22 15:54:36 +02:00
Jehan e0d50aa121 plug-ins: keep building all plug-ins with old API.
Build existing plug-ins with -DGIMP_DEPRECATED_REPLACE_NEW_API.
We will port the plug-ins one at a time to the new GimpImage API.
2019-08-22 15:54:36 +02:00
Michael Natterer 4cb4b3ef3a plug-ins: port all plug-ins to the new macros 2019-08-20 01:03:38 +02:00
Michael Natterer 1253faaab3 plug-ins: change all ported thumbnail loaders to GimpThumbnailProcedure 2019-08-19 14:04:00 +02:00
Michael Natterer d62e75a41f Move GimpParamSpecString from libgimp back to app
It's just too weird to be public. Remove its properties from the wire
protocol and from pluginrc. Instead, have all GParamSpecs' flags on
the wire and in pluginrc, so we can use stuff like
GIMP_PARAM_NO_VALIDATE.

Port the remaining few places to GIMP_PROC_ARG_STRING().

I'm sure something is broken now wrt UTF-8 validation,
will add tighter checks in the next commit.
2019-08-19 12:54:52 +02:00
Michael Natterer 9cabc8c8d0 libgimp, plug-ins: use the new macros everwhere
Except for gimp_param_spec_string() which is on its way back to the
core.
2019-08-19 10:02:07 +02:00
Michael Natterer 0bfc4cf7b2 plug-ins: port all file-raw plug-ins to GimpPlugIn 2019-08-14 01:34:11 +02:00
gaaned92 9e82ace409 Issue #2716 - Windows: Rawtherapee plugin cannot be installed
On Windows, prevent RawTherapee from opening a console window
2019-01-03 14:10:27 +01:00
Simon Mueller 6a5023a38a Issue #2179: Get rid of the win32_use_hkcu flag.
Simply always check HKCU first. If that lookup did not yield any result,
fall back to HKLM.
2018-09-19 15:01:46 +02:00
Simon Mueller 829ca6583d Issue #2179: Make file_rawtherapee use the registry value that is...
... provided by RawTherapee's installer (version 5.5+).

See https://github.com/Beep6581/RawTherapee/issues/4783.
This patch required a small change to file_raw_get_executable_path
because the RawTherapee installer is supposed to work without admin
privileges and therefore can't write to HKLM.

Reviewer's note (Jehan): RawTherapee's installer does not add the
registry entry yet. We assume the upstream bug report will end up doing
so (someone has to make the first step!). :-)
2018-09-10 14:16:02 +02:00
Jehan 0832bbd771 plug-ins: replace s/printf/g_printf/
When cross-compiling, I got various linking errors for printf() calls:
> undefined reference to `libintl_printf'

I am unsure why, since this is not recent code, and it used to build
fine with mingw64 compilers (last I cross-built, which is many months
ago). Anyway g_printf() works fine, all necessary libs are already
linked, and it is supposed to be a synonym. So let's just go the easy
way and use g_printf() only.

(cherry picked from commit c49afa4f84)
2018-08-12 22:53:24 +02:00
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Jehan 870ca6334d plug-ins: install plug-ins in subfolder.
I am going to forbid plug-ins from being installed directly in the root
of the plug-ins/ directory. They will have to be installed in a
subdirectory named the same as the entry point binary.
This may seem useless for our core plug-ins which are nearly all
self-contained in single binaries, but this is actually a necessary
restriction to eliminate totally the DLL hell issue on Windows. Moving
core plug-ins in subfolders is only a necessary consequence for it.
2018-05-20 21:06:35 +02:00
Michael Natterer 3b950f6177 plug-ins: some cleaup in file-raw, mostly formatting 2018-01-05 15:31:57 +01:00
Tobias Ellinghaus 313d8c2876
file-darktable: Add more debug prints 2018-01-05 14:21:59 +01:00
Jehan 3d5732e23e plug-ins: some minor coding style fix.
Just some missing spaces between function name and parenthese which I
came across.
2017-12-20 15:12:10 +01:00
Jehan 36daa6dba8 plug-ins: s/Windows.h/windows.h/.
I just cross-compiled for Windows after a long time. The header file is
all lowercase on a cross-compilation MinGW-w64 environment. I'm not sure
what is the case on Windows, but since this platform is case-insensitive
for file names, I believe this won't break anything on native builds.
2017-12-09 18:52:51 +01:00
Jehan 1e78d3d249 plug-ins: make Darktable version checking more generic.
I realize that on Fedora 27, the output of `darktable --version` is:
"this is darktable darktable-2.2.5-4.fc27"
This is different from the expected output in our plug-in ("this is
darktable 2.2.5"). I assume this version string can be customized and
distribution packagers will use the capability. So a regular expression,
in a slightly more flexible fashion would be better. I still assume that
the version string with start with "this is darktable", but then I
accept any non-number string until I reach a common major.minor.patch
version-looking string.
2017-11-26 03:56:55 +01:00
Tobias Ellinghaus c10c640451
plug-ins: Hide darktable debug output
Only show debugging messages from the darktable raw loader when the
environment variable DARKTABLE_DEBUG is set.
2017-11-20 12:48:47 +01:00
Michael Natterer f47df72dc6 plug-ins: link file-raw aginst libgimpcolor and libgimpconfig explicitly
otherwise, implicit transitive linking will pull in the installed
libs, not the ones from the source tree, and the build can fail when
any of the libs' APIs changes.

Also remove some useless #includes.
2017-10-09 18:33:02 +02:00
Jehan 54b4d1e0a2 Bug 787326 - MacOS's CFSTR() does not work with const variables.
This is untested, written from gathering information on the web. MacOS
people, please try and compile GIMP!
2017-09-09 14:39:05 +02:00
Tobias Ellinghaus b86b19235e
darktable: Fix typo in last commit 2017-09-04 14:08:31 +02:00
Tobias Ellinghaus 82dd06720d
darktable: Add more shell escaping for Windows
Apparently Lua chokes when it sees c:\darktable\... as a path to a script,
thinking the '\d' was an escape sequence. Thus we have to add an extra
layer of escaping. Houdini like. Who came up with the brilliant idea to
use '\' as a separator anyway? So much pain just to be different?
2017-09-04 12:56:34 +02:00
Tobias Ellinghaus 855f2f1cbe
plug-ins: Fix finding raw loaders on Win/OSX
Without including gdk.h the #defines to determine the system are not
available, resulting in no platform specific code being compiled in.
2017-09-04 11:59:33 +02:00
Tobias Ellinghaus 87dbc05cbd
darktable: add info message to dt when started
Tell users that they just have to close darktable to export the image
and don't need to do anything.
2017-08-12 21:55:54 +02:00
Michael Natterer 42f0db190f plug-ins: rename file-raw/file-formats.h to file-raw/file-raw-formats.h 2017-07-30 18:35:20 +02:00
Jehan 5ea831b99d plug-ins: add minimum version information for RawTherapee and Darktable.
Otherwise people will install older versions and won't understand why
the plug-ins won't work. It's just a little annoying that these version
strings have to be hardcoded this way. We could add macros in a header,
but that would be only half a solution. Ideally we'd rather have some
discovery logics at some point.
2017-07-29 01:41:13 +02:00
Alberto Griggio 87bbba5cea plug-ins: fix the RawTherapee version test. 2017-07-29 01:26:01 +02:00
Jehan b3eb876069 plug-ins: add some MacOS support to find RawTherapee.
Hopefully it works, since that's untested (I have no MacOS access). This
is mostly code from file-darktable.c, made generic and factorized into
file-raw-utils.[ch]. At least it still builds and work fine on Linux.
I used the CFBundleIdentifier from `tools/osx/Info.plist.in` in
RawTherapee code. I didn't add a Win32 registry key base though, since I
couldn't find any relevant data for this in RawTherapee code.
2017-07-29 01:26:01 +02:00
Jehan 7f85244bcc plug-ins: some alignment cleaning. 2017-07-29 01:26:01 +02:00
Michael Natterer 713995e27d Bug 784261 - Have some nice error message for formats known to work...
...with known plugins

Add new plug-in file-raw-placeholder.c that registers itself for
loading all RAW formats from file-raw/file-formats.h, but does nothing
except returning an error message pointing to darktable and
RawTherapee.

When no real RAW loader is installed, this plug-in is selected
automatically as RAW loader, otherwise the first installed RAW loader
is used. Selecting another in prefs still works as before.
2017-07-24 22:19:53 +02:00
Michael Natterer b6f5bd2f25 plug-ins: update .gitignore in file-raw/ 2017-07-24 20:59:28 +02:00
Michael Natterer 87438c885a plug-ins: merge file-rawtherapee/ into file-raw/
and use the same file-formats.h
2017-07-24 20:58:25 +02:00
Michael Natterer 0369ac9b9f plug-ins: remove all TIFF extensions and magics from file-raw/file-formats.h 2017-07-24 20:44:22 +02:00
Michael Natterer 59558f8778 plug-ins: replace file-raw/file-formats.h's "darktable" strings by "%s"
and assemble the actual strings dynamically, substituting "draktable".
2017-07-24 20:41:41 +02:00
Michael Natterer fea66e027c plug-ins: prefix file-darktable's .lua files with "file-darktable-"
and change their install directory to "file-raw".
2017-07-24 20:32:02 +02:00
Michael Natterer a653a477d1 plug-ins: rename file-darktable/ to file-raw/
It will soon host all raw loader plug-ins.
2017-07-24 20:26:18 +02:00