Bug 272541 - print/ghostscript10: DEFAULT_VERSION=ghostscript=10 cannot be used
Summary: print/ghostscript10: DEFAULT_VERSION=ghostscript=10 cannot be used
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Koichiro Iwao
URL:
Keywords:
Depends on:
Blocks: 273771
  Show dependency treegraph
 
Reported: 2023-07-17 09:44 UTC by Konstantin Belousov
Modified: 2023-09-15 12:14 UTC (History)
5 users (show)

See Also:
michael.osipov: maintainer-feedback+


Attachments
Turn flavors into options (Git-formatted patch) (2.71 KB, patch)
2023-08-31 13:21 UTC, Michael Osipov
no flags Details | Diff
Update ghostscript.mk (Git-formatted patch) (1.63 KB, patch)
2023-08-31 13:21 UTC, Michael Osipov
no flags Details | Diff
Turn flavors into options (Git-formatted patch) (3.45 KB, patch)
2023-09-14 07:18 UTC, Michael Osipov
michael.osipov: maintainer-approval+
Details | Diff
Update ghostscript.mk (Git-formatted patch) (1.63 KB, patch)
2023-09-14 07:19 UTC, Michael Osipov
michael.osipov: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Belousov freebsd_committer freebsd_triage 2023-07-17 09:44:55 UTC
Flavorized ghostscript10@default and @x11 cannot be installed simultaneously.
Since I have ports installed that need both of them, this prevents switching
to 10.

Please, can you fix it by whatever means. 9 is dead, and some ps compatibility
issues are handled only by active release.
Comment 1 Michael Osipov 2023-07-17 19:39:09 UTC
I will get back to this in two weeks whenI am back at work.
Comment 2 Michael Osipov 2023-07-27 09:53:05 UTC
Well, I have expressed exactly this case right here:
* https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270989#c12
* https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270989#c13

I was told that flavors are preferred.

Reason why X11.so does not exist anymore: 
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270989#c3

So there are few options:
* Don't use flavors, but OPTIONs only (not ideal)
* Always depend on X11 like other OS vendors do (e.g., Debian). Many 
likely don't want these deps by default. (not ideal)
* Implement a package supersede mechanism in the ports system which can swap @default with @x11 because it is a superset. (ideal)
* Use the deprecated approach with dynamic library separation as with 9 (not ideal at all)

I don't see a perfect solution here, unfortunately.

Ideas?
Comment 3 Konstantin Belousov freebsd_committer freebsd_triage 2023-07-27 10:07:49 UTC
Almost any other port with the same issue uses OPTIONS with X11 being on by
default.  This seems to also happen in Linux distros (without OPTIONS).  So
why be original?
Comment 4 Michael Osipov 2023-07-27 10:10:13 UTC
(In reply to Konstantin Belousov from comment #3)

I don't have any special opinion on this, just layed out the options. Having said that it means that using flavors is wrong and we should resort to port OPTIONS again for this. I wouldn't mind to make it default and people can disable for themselves. If a port committer is willing to discuss I can easily provide patches.
Comment 5 Michael Osipov 2023-08-14 08:49:31 UTC
diizzy, let me know what you think regarding my ideas in comment #2.
Comment 6 Daniel Engberg freebsd_committer freebsd_triage 2023-08-18 21:00:36 UTC
I think for now we need to depend on x11 until the framework gets smarter resolving dependencies?
Comment 7 Michael Osipov 2023-08-18 21:09:59 UTC
(In reply to Daniel Engberg from comment #6)

Yep, as mentioned default port option with X11.
Comment 8 Michael Osipov 2023-08-31 13:21:13 UTC
Created attachment 244520 [details]
Turn flavors into options (Git-formatted patch)
Comment 9 Michael Osipov 2023-08-31 13:21:42 UTC
Created attachment 244521 [details]
Update ghostscript.mk (Git-formatted patch)
Comment 10 Michael Osipov 2023-08-31 13:23:41 UTC
I have now attached two patches which need to be applied in order, ideally, replace the flavors with options where X11 is linked by default and updates ghostscript.mk.

Kostik, please give it a try. It should resolve your issue and will hopefully make it into next quarterly.
Comment 11 Michael Osipov 2023-08-31 13:25:35 UTC
Tried these permutations: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270989#c70

Looks good to me:
nobody@124-release-amd64-default-head:/usr/ports/graphics/xfig % make -V RUN_DEPENDS | tr ' ' '\n' | grep ghost
ghostscript9-agpl-base>=9.56.1:print/ghostscript9-agpl-base
nobody@124-release-amd64-default-head:/usr/ports/graphics/xfig % make -V RUN_DEPENDS | tr ' ' '\n' | grep ghost
ghostscript9-agpl-base>=9.56.1:print/ghostscript9-agpl-base
ghostscript9-agpl-x11>=9.56.1:print/ghostscript9-agpl-x11
nobody@124-release-amd64-default-head:/usr/ports/graphics/xfig % make -V RUN_DEPENDS | tr ' ' '\n' | grep ghost
ghostscript10>=10.01.2:print/ghostscript10
nobody@124-release-amd64-default-head:/usr/ports/graphics/xfig % make -V RUN_DEPENDS | tr ' ' '\n' | grep ghost
ghostscript10>=10.01.2:print/ghostscript10
nobody@124-release-amd64-default-head:/usr/ports/graphics/xfig % make -V LIB_DEPENDS | tr ' ' '\n' | grep ghost
libgs.so:print/ghostscript9-agpl-base
nobody@124-release-amd64-default-head:/usr/ports/graphics/xfig % make -V LIB_DEPENDS | tr ' ' '\n' | grep ghost
libgs.so:print/ghostscript9-agpl-base
libgs.so:print/ghostscript9-agpl-x11
nobody@124-release-amd64-default-head:/usr/ports/graphics/xfig % make -V LIB_DEPENDS | tr ' ' '\n' | grep ghost
libgs.so:print/ghostscript10
nobody@124-release-amd64-default-head:/usr/ports/graphics/xfig % make -V LIB_DEPENDS | tr ' ' '\n' | grep ghost
libgs.so:print/ghostscript10

Don't be confused by xfig, I have modified the Makefile for the args.
Comment 12 Konstantin Belousov freebsd_committer freebsd_triage 2023-08-31 15:46:43 UTC
This worked, thank you.

solo% pkg info -r ghostscript10-10.01.2_2
ghostscript10-10.01.2_2:
        cups-filters-1.28.16_5
        cups-pdf-3.0.1_2
        R-4.3.1_1
        ImageMagick7-7.1.0.62_6
        gv-3.7.4_5
Comment 13 Michael Osipov 2023-08-31 19:02:36 UTC
(In reply to Konstantin Belousov from comment #12)

Very good. Now waiting for diizzy@ to approve and commit.
Comment 14 Michael Osipov 2023-09-14 07:18:48 UTC
Created attachment 244821 [details]
Turn flavors into options (Git-formatted patch)

Adding also a section to UPDATING
Comment 15 Michael Osipov 2023-09-14 07:19:06 UTC
Created attachment 244822 [details]
Update ghostscript.mk (Git-formatted patch)
Comment 16 Koichiro Iwao freebsd_committer freebsd_triage 2023-09-15 09:43:46 UTC
Take, thanks for the patience.
Comment 17 commit-hook freebsd_committer freebsd_triage 2023-09-15 12:08:58 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=83964d19d9f692d91242d53609b9005e2e5e7ac8

commit 83964d19d9f692d91242d53609b9005e2e5e7ac8
Author:     Michael Osipov <michael.osipov@siemens.com>
AuthorDate: 2023-08-31 13:15:09 +0000
Commit:     Koichiro Iwao <meta@FreeBSD.org>
CommitDate: 2023-09-15 12:07:41 +0000

    print/ghostscript10: add default port option for X11

    This change replaces flavors with a new default port option for X11.
    Compared to GS 9 port the X11 device driver is now integrated into GS instead
    of being dynamically loaded which is not in conformance with new GS 10 approach.
    The flavors approach creates conflicting dependencies with other ports which
    cannot be solved this time with the ports framework.

    See PRs 270989 and 272541 for details.

    PR:             272541
    Tested by:      kib

 UPDATING                     | 10 ++++++++++
 print/ghostscript10/Makefile | 25 +++++++------------------
 2 files changed, 17 insertions(+), 18 deletions(-)
Comment 18 commit-hook freebsd_committer freebsd_triage 2023-09-15 12:09:01 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=bbca8e8174da13923b4adb451a7ec20596f36a74

commit bbca8e8174da13923b4adb451a7ec20596f36a74
Author:     Michael Osipov <michael.osipov@siemens.com>
AuthorDate: 2023-08-31 13:18:05 +0000
Commit:     Koichiro Iwao <meta@FreeBSD.org>
CommitDate: 2023-09-15 12:07:41 +0000

    ghostscript.mk: replace flavors

    Flavors for GS 10 create confliciting dependencies, therefore resort to
    port options.

    PR:             272541

 Mk/Uses/ghostscript.mk | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
Comment 19 Koichiro Iwao freebsd_committer freebsd_triage 2023-09-15 12:09:57 UTC
Committed, thanks!
Comment 20 commit-hook freebsd_committer freebsd_triage 2023-09-15 12:14:03 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=eae03f41a03799a8ed859f8e861f1603cc2728ce

commit eae03f41a03799a8ed859f8e861f1603cc2728ce
Author:     Michael Osipov <michael.osipov@siemens.com>
AuthorDate: 2023-09-13 19:48:35 +0000
Commit:     Koichiro Iwao <meta@FreeBSD.org>
CommitDate: 2023-09-15 12:12:25 +0000

    print/ghostscript10: update port to 10.02.0

    * Exclude bundled libexpat
    * Link against external libtesseract and libleptonica on request

    Changelog: https://ghostscript.readthedocs.io/en/gs10.02.0/News.html

    PR:             272541

 print/ghostscript10/Makefile                       | 33 ++++++++--------
 print/ghostscript10/distinfo                       |  6 +--
 print/ghostscript10/files/patch-configure          |  2 +-
 .../files/patch-psi_imainarg.c (gone)              | 44 ----------------------
 .../patch-tesseract_src_arch_simddetect.cpp (gone) | 34 -----------------
 print/ghostscript10/pkg-plist                      |  6 ---
 6 files changed, 22 insertions(+), 103 deletions(-)