Skip to content

Conversation

fccm2
Copy link
Contributor

@fccm2 fccm2 commented Apr 19, 2025

Provides 2 different conf-files, because the magick-core library version 6 is still the one that seems to be provided in Debian 12.

fccm2 added 2 commits April 20, 2025 00:38
Checks for the magick-core lib, with major version equal to "6"
(there are api changes between 6 and 7)
Checks for the magick-core lib, with major version equal to "7"
(there are api changes between 6 and 7)
@fccm2 fccm2 changed the title 2 conf-files, one for the magick-core lib, one for the major version 6 and a second one for 7 2 conf-files, one for the magick-core lib with the major version 6 and a second one for 7 Apr 19, 2025
@fccm2 fccm2 changed the title 2 conf-files, one for the magick-core lib with the major version 6 and a second one for 7 2 conf-files, one for the magick-core lib with the major version 6, and a second one for 7 Apr 19, 2025
@fccm2
Copy link
Contributor Author

fccm2 commented Apr 20, 2025

I don't know how to make these conf-files work in case both a magick-core-6 and 7 are installed at the same time in the system. pkg-config will probably take the first .pc file found in its path.
But it will probably work for 95% of users (or more) who have only one of the two installed.

Copy link
Contributor

@shonfeder shonfeder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for helping to provide these conf packages!

It looks we have a few issues to resolved, flagged by our CI:

Comment on lines +12 to +16
build: [
[ "sh" "-c"
"pkg-config --exists MagickCore && \
pkg-config --modversion MagickCore | awk -F. '{ if ($1 == 6) exit 0; else exit 1; }'"
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to failing on all platforms with errors like

#=== ERROR while compiling conf-magick-core6.1 ================================#
# context              2.3.0 | linux/x86_64 | ocaml-base-compiler.5.3.0 | pinned
# path                 ~/.opam/5.3/.opam-switch/build/conf-magick-core6.1
# command              ~/.opam/opam-init/hooks/sandbox.sh build sh -c pkg-config --exists MagickCore && pkg-config --modversion MagickCore | awk -F. '{ if ($1 == 6) exit 0; else exit 1; }'
# exit-code            1
# env-file             ~/.opam/log/conf-magick-core6-7-671145.env
# output-file          ~/.opam/log/conf-magick-core6-7-671145.out

Except for on windows, where it is failing with

  #=== ERROR while compiling conf-magick-core6.1 ================================#
  # context     2.3.0 | win32/x86_64 | ocaml.5.3.0 | file://D:/a/opam-repository/opam-repository
  # path        D:\opamroot\default\.opam-switch\build\conf-magick-core6.1
  # command     D:\opamroot\.cygwin\root\bin\sh.exe -c pkg-config --exists MagickCore && pkg-config --modversion MagickCore | awk -F. '{ if ($1 == 6) exit 0; else exit 1; }'
  # exit-code   2
  # env-file    D:\opamroot\log\conf-magick-core6-3744-45fb94.env
  # output-file D:\opamroot\log\conf-magick-core6-3744-45fb94.out
  ### output ###
  # Can't open perl script "/cygdrive/c/Strawberry/perl/bin/pkg-config": No such file or directory

(Cf. https://github.com/ocaml/opam-repository/actions/runs/14553589502/job/40827624818?pr=27798)

I'm not sure if the right fix is to use a different check on windows via a conditional guard or if this can be changed to work on all platforms.

@fccm2
Copy link
Contributor Author

fccm2 commented May 9, 2025

Maybe the error code just means that the deps that are checked by this conf-file are not installed, (which is the expected result).

The Windows error code 2 maybe means that awk is not installed in Windows.

Do you have a suggestion on a better way to check the major version of the lib ?

Is there a current conf-file that I could use as an example ?

Co-authored-by: Shon Feder <shon.feder@gmail.com>
@fccm2
Copy link
Contributor Author

fccm2 commented May 15, 2025

Maybe we should do it with an ocaml script, rather than with awk ?

@mseri
Copy link
Member

mseri commented Aug 28, 2025

I think that's probably a good idea

@fccm2
Copy link
Contributor Author

fccm2 commented Aug 29, 2025

Ok, I have to figure out how to do that now.
I remember I saw we can make a patch directory, but don't remember where is the local script dir,
maybe just using the src field.

@mseri
Copy link
Member

mseri commented Sep 29, 2025

To begin with you can add the script in a github gist and include it to the opam file as extra-files.

Once the script is stable, we will move it to the opam-source-archives repository, and update the reference to point there. Then merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants