Bug 257679 - www/wp-cli: New port: Command line interface for WordPress
Summary: www/wp-cli: New port: Command line interface for WordPress
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Vladimir Druzenko
URL: https://github.com/wp-cli/wp-cli/
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-08 01:36 UTC by avkarenow
Modified: 2025-11-18 22:49 UTC (History)
3 users (show)

See Also:


Attachments
Shar file of new port wp-cli 2.5.0 (1.71 KB, text/plain)
2021-08-08 01:36 UTC, avkarenow
no flags Details
Update to latest 2.7.1 version. (1.81 KB, text/plain)
2023-01-17 16:05 UTC, avkarenow
no flags Details
Update wp-cli to latest 2.8.1 version (2.32 KB, patch)
2023-07-02 22:53 UTC, avkarenow
no flags Details | Diff
wp-cli-php8x-2.12.0.shar (1.38 KB, application/x-shellscript)
2025-10-22 06:14 UTC, takefu
no flags Details
wp-cli-php8x-2.12.0.shar (5.00 KB, application/x-tar)
2025-10-27 05:52 UTC, takefu
takefu: maintainer-approval+
Details
wp-cli-php8x-2.12.0.patch (1.74 KB, patch)
2025-10-27 13:34 UTC, takefu
no flags Details | Diff
0001-www-wp-cli-new-port-command-line-interface-for-WordP.patch (3.15 KB, patch)
2025-11-18 20:48 UTC, Paavo-Einari Kaipila
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description avkarenow 2021-08-08 01:36:40 UTC
Created attachment 227012 [details]
Shar file of new port wp-cli 2.5.0

Hello,

It's my first port ;)
Based on www/drush

I'm not sure if ${LOCALBASE}/bin/wp is already used by another port, I couldn't find any information on how to check it.
WP-CLI documentation refers to binary name 'wp' but possibly ${LOCALBASE}/bin/wp-cli can be used instead if there is any conflict.
Comment 1 avkarenow 2023-01-17 16:05:31 UTC
Created attachment 239537 [details]
Update to latest 2.7.1 version.

Update to latest 2.7.1 version.
Comment 2 avkarenow 2023-07-02 22:53:28 UTC
Created attachment 243161 [details]
Update wp-cli to latest 2.8.1 version

Update to latest 2.8.1 version.
Is any chance to commit it into Ports soon?
Comment 3 Vladimir Druzenko freebsd_committer freebsd_triage 2025-10-20 01:14:17 UTC
(In reply to avkarenow from comment #2)
If you are still interesting then I can commit it.
Comment 4 Vladimir Druzenko freebsd_committer freebsd_triage 2025-10-20 01:15:05 UTC
Where is ne release: https://github.com/wp-cli/wp-cli/releases/tag/v2.12.0
Comment 5 takefu 2025-10-22 06:14:45 UTC
Created attachment 264777 [details]
wp-cli-php8x-2.12.0.shar

If the old version works, it should work.
I haven't verified it. :-p
Comment 6 Vladimir Druzenko freebsd_committer freebsd_triage 2025-10-22 14:06:23 UTC
(In reply to takefu from comment #5)
Can you attach just tarball with port?
Comment 7 takefu 2025-10-27 00:20:03 UTC
(In reply to Vladimir Druzenko from comment #6)

I'm not a PHP user, so I don't know how to convert source code into .phar files.
Comment 8 Paavo-Einari Kaipila 2025-10-27 01:32:08 UTC
(In reply to takefu from comment #7)

I can help with phar archives, although most PHP console projects just provide it in a already-built form. Seems like this one does that too.
Comment 9 Vladimir Druzenko freebsd_committer freebsd_triage 2025-10-27 02:54:56 UTC
(In reply to takefu from comment #7)
> wp-cli-php8x-2.12.0.shar
shar != phar
Comment 10 takefu 2025-10-27 05:52:51 UTC
Created attachment 264925 [details]
wp-cli-php8x-2.12.0.shar

I've rewritten it to fetch via GitHub instead of PHAR. Please review.
Comment 11 Vladimir Druzenko freebsd_committer freebsd_triage 2025-10-27 11:18:56 UTC
(In reply to takefu from comment #10)
Can you upload NOT shar archive?
Entry port in tarball or just diff (git diff).
Comment 12 takefu 2025-10-27 13:34:14 UTC
Created attachment 264937 [details]
wp-cli-php8x-2.12.0.patch

I had no idea when it became impossible to submit new ports using shar.
Is this format acceptable? :-p
Comment 13 Vladimir Druzenko freebsd_committer freebsd_triage 2025-10-27 17:01:51 UTC
It's not a matter of whether it's acceptable or not, but rather whether it's convenient for me or not. If I'm taking on this port.
Comment 14 Vladimir Druzenko freebsd_committer freebsd_triage 2025-10-27 17:05:07 UTC
Regarding the maintainer: more than two years have passed since "avkarenow@o2.pl" last message - there's no guarantee he wants to be the maintainer. Perhaps someone else would like to shoulder this difficult burden? :-D
Comment 15 Vladimir Druzenko freebsd_committer freebsd_triage 2025-10-27 17:21:53 UTC
(In reply to takefu from comment #12)
Did you test build?
Comment 16 Vladimir Druzenko freebsd_committer freebsd_triage 2025-10-27 17:47:04 UTC
PORTNAME=       wp-cli
DISTVERSION=    2.12.0
CATEGORIES=     www
MASTER_SITES=   https://github.com/${PORTNAME}/${PORTNAME}/releases/download/v${DISTVERSION}/
PKGNAMESUFFIX=  ${PHP_PKGNAMESUFFIX}
EXTRACT_SUFX=   .phar

MAINTAINER=     ??????????
COMMENT=        Command line interface for WordPress
WWW=            https://wp-cli.org/ \
                https://github.com/wp-cli/wp-cli/

LICENSE=        MIT

USES=           php:cli,flavors
USE_PHP=        curl exif fileinfo ftp gd hash json mysqli pcre phar tokenizer \
                xml zip zlib
NO_ARCH=        yes
NO_BUILD=       yes
PLIST_FILES=    bin/wp bin/${PORTNAME}${EXTRACT_SUFX}

do-extract:
        ${CP} ${DISTDIR}/${DISTNAME}${EXTRACT_SUFX} \
                ${WRKDIR}/${PORTNAME}${EXTRACT_SUFX}

do-install:
        ${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME}${EXTRACT_SUFX} \
                ${STAGEDIR}${PREFIX}/bin
        ${RLN} ${PORTNAME}${EXTRACT_SUFX} ${STAGEDIR}${PREFIX}/bin/wp

.include <bsd.port.mk>
Comment 17 Paavo-Einari Kaipila 2025-10-27 18:07:16 UTC
Pcre extension is statically built into PHP binary
Comment 18 Paavo-Einari Kaipila 2025-10-27 18:25:02 UTC
(In reply to Paavo-Einari Kaipila from comment #17)

And so are hash and json have also been statically built for quite some time

https://wiki.php.net/rfc/permanent_hash_ext
https://wiki.php.net/rfc/always_enable_json
Comment 19 Vladimir Druzenko freebsd_committer freebsd_triage 2025-10-27 19:46:04 UTC
PORTNAME=       wp-cli
DISTVERSION=    2.12.0
CATEGORIES=     www
MASTER_SITES=   https://github.com/${PORTNAME}/${PORTNAME}/releases/download/v${DISTVERSION}/
PKGNAMESUFFIX=  ${PHP_PKGNAMESUFFIX}
EXTRACT_SUFX=   .phar

MAINTAINER=     ??????????
COMMENT=        Command line interface for WordPress
WWW=            https://wp-cli.org/ \
                https://github.com/wp-cli/wp-cli/

LICENSE=        MIT

USES=           php:cli,flavors
USE_PHP=        curl exif fileinfo ftp gd mysqli phar tokenizer xml zip zlib

EXTRACT_CMD=            ${CP}
EXTRACT_BEFORE_ARGS=    #
EXTRACT_AFTER_ARGS=     ${WRKDIR}/${PORTNAME}${EXTRACT_SUFX}

NO_ARCH=        yes
NO_BUILD=       yes
PLIST_FILES=    bin/wp bin/${PORTNAME}${EXTRACT_SUFX}

do-install:
        ${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME}${EXTRACT_SUFX} \
                ${STAGEDIR}${PREFIX}/bin
        ${RLN} ${PORTNAME}${EXTRACT_SUFX} ${STAGEDIR}${PREFIX}/bin/wp

.include <bsd.port.mk>
Comment 20 Vladimir Druzenko freebsd_committer freebsd_triage 2025-10-27 19:48:30 UTC
There is bash completion for wp-cli: https://github.com/wp-cli/wp-cli/blob/main/utils/wp-completion.bash
Add this to port.
Comment 21 Vladimir Druzenko freebsd_committer freebsd_triage 2025-11-16 21:58:56 UTC
Friendly ping.
Comment 22 Paavo-Einari Kaipila 2025-11-17 09:33:05 UTC
(In reply to Vladimir Druzenko from comment #21)

I believe this would be best maintained by someone who has some use for it. I don't, but because there certainly are people, who find this useful, I can volunteer. I'll add that bash script, check the required extension list and follow with another variant of it nobody shows up sometime relatively soon.
Comment 23 Paavo-Einari Kaipila 2025-11-18 20:48:44 UTC
Created attachment 265497 [details]
0001-www-wp-cli-new-port-command-line-interface-for-WordP.patch
Comment 24 commit-hook freebsd_committer freebsd_triage 2025-11-18 22:48:17 UTC
A commit in branch main references this bug:

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

commit 46cee314acdce1c0a94f87bf0d53f6b5741a880b
Author:     Paavo-Einari Kaipila <pkaipila@gmail.com>
AuthorDate: 2025-11-18 22:42:51 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2025-11-18 22:42:51 +0000

    www/wp-cli: New port: Command line interface for WordPress

    WP-CLI is the command-line interface for WordPress.
    You can update plugins, configure multisite installations and much more,
    without using a web browser.

    Co-authored-by: Vladimir Druzenko <vvd@FreeBSD.org>
    Co-authored-by: takefu@airport.fm
    Co-authored-by: avkarenow@o2.pl

    PR:     257679

 www/Makefile               |  1 +
 www/wp-cli/Makefile (new)  | 39 +++++++++++++++++++++++++++++++++++++++
 www/wp-cli/distinfo (new)  |  5 +++++
 www/wp-cli/pkg-descr (new) |  3 +++
 4 files changed, 48 insertions(+)
Comment 25 Vladimir Druzenko freebsd_committer freebsd_triage 2025-11-18 22:49:29 UTC
I did few improvements in download distfiles.

Thanks to all!