Bug 281810 - [NEW PORT] www/snip: SNIP is a powerful, simple, and easy to use Open-Source PHP Pastebin
Summary: [NEW PORT] www/snip: SNIP is a powerful, simple, and easy to use Open-Source ...
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: Muhammad Moinur Rahman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-02 05:01 UTC by ek
Modified: 2025-05-04 18:46 UTC (History)
5 users (show)

See Also:


Attachments
[NEW PORT] www/snip patch (281.92 KB, patch)
2024-10-02 05:01 UTC, ek
no flags Details | Diff
Updated new port patch (278.01 KB, patch)
2024-10-03 23:14 UTC, ek
no flags Details | Diff
Updated www/snip patch (281.92 KB, patch)
2025-02-14 00:22 UTC, ek
ek: maintainer-approval+
Details | Diff
www/snip.patch (282.05 KB, patch)
2025-02-14 12:24 UTC, Yusuf Yaman
ek: maintainer-approval+
Details | Diff
All diffs, changes made from me. (3.17 KB, patch)
2025-02-14 12:25 UTC, Yusuf Yaman
no flags Details | Diff
v1.1.0 version patch (275.24 KB, patch)
2025-04-21 00:52 UTC, ek
ek: maintainer-approval+
Details | Diff
NEW v1.1.0 patch (271.51 KB, patch)
2025-04-21 01:21 UTC, ek
ek: maintainer-approval+
Details | Diff
NEW SNIP v1.1.0 patch (4.44 KB, patch)
2025-04-29 21:36 UTC, ek
ek: maintainer-approval+
Details | Diff
new-new-new patch for SNIP-v1.1.0 (4.48 KB, patch)
2025-04-30 14:15 UTC, ek
ek: maintainer-approval+
Details | Diff
new-new-new-new patch for SNIP-v1.1.0 (5.78 KB, patch)
2025-04-30 16:29 UTC, ek
ek: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ek 2024-10-02 05:01:41 UTC
Created attachment 253950 [details]
[NEW PORT] www/snip patch

This port is a fork of www/Stikked (which hasn't been updated in 5 years) which has many updates to work with PHP 8.x along with additional features.

Poudriere build log can be found at: https://pkg.purplehat.org/data/fbsd_14-1_x64-HEAD/2024-10-01_22h38m47s/logs/snip-1.0.0.log

I'm not sure if www/Stikked should be removed/replaced by this or not. However, www/Stikked does not work with PHP 8.x, and multiple pull requests to the project to fix many issues have been ignored/dormant for nearly one year.

Please let me know if there is anything else I can provide. Thank you!
Comment 1 ek 2024-10-03 23:14:55 UTC
Created attachment 253986 [details]
Updated new port patch

After speaking with the developer, they fixed some minor issues upstream and provided an update. So, this new patch includes those changes.
Comment 2 Robert Clausecker freebsd_committer freebsd_triage 2024-10-04 13:23:41 UTC
Could you please open a bug against stickked indicating that it doesn't work?  This would make it easy for me to deprecate and remove the port.
Comment 3 ek 2025-02-08 04:43:15 UTC
Hi, Robert. It looks like the www/Stikked removal request went into place (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281858). Thank you!

Is there something wrong with this new port request? Something I need to update to make it acceptable? I'm unsure why this hasn't been approved. Perhaps it needs additional verification (which is fine, but is there something or someone specific I should bring this attention to?)

Thanks again!
Comment 4 Robert Clausecker freebsd_committer freebsd_triage 2025-02-08 10:54:07 UTC
(In reply to ek from comment #3)

I'm sorry for how long this one has been open with no response.

I think this is just the case of nobody having looked into it.  I don't know PHP and thus do not process PHP-based ports.  Perhaps try posting on ports@freebsd.org and request someone to review your port.
Comment 5 Daniel Engberg freebsd_committer freebsd_triage 2025-02-08 14:05:39 UTC
Also not referring to the actual release tag
Comment 6 ek 2025-02-13 23:41:55 UTC
(In reply to Daniel Engberg from comment #5)
Can you help me understand what you mean by this? Is there a version mismatch somewhere or should I be adding/changing something in the port to refer to something in particular, maybe? I'd like to get this sorted out before I ask ports@ to take a look.
Comment 7 ek 2025-02-14 00:00:30 UTC
... wait a second. You're talking about the release tag on GH that differs, I believe. It looks like the project maintainer made some changes but didn't bump the version of "Latest." I'll check it out and update the port to reflect the correct commit. If the project owner continues to do this, could cause problems. I'll ask them if there's any possibility they can bump the version when they make changes.
Comment 8 ek 2025-02-14 00:22:56 UTC
Created attachment 257511 [details]
Updated www/snip patch

Updated for upstream commit changes (version stays the same.)
Comment 9 Yusuf Yaman freebsd_committer freebsd_triage 2025-02-14 12:24:58 UTC
Created attachment 257522 [details]
www/snip.patch

I edited git commit message.
I used port tools (portclippy,portfmt,portlint) to improve the port.
I made use of OPT_USE instead of ${PORT_OPTIONS}.
I changed portname to match github project name.

I'll also attach the diff so you can better see what I changed.

I tested it in poudriere 14.2-R amd64 and testport is fine, didn't test if it works fine, though.
Comment 10 Yusuf Yaman freebsd_committer freebsd_triage 2025-02-14 12:25:25 UTC
Created attachment 257523 [details]
All diffs, changes made from me.
Comment 11 ek 2025-02-14 21:28:24 UTC
(In reply to Yusuf Yaman from comment #9)

This all looks great to me and thank you for the help! I tested the build in both Poudriere and manual. Both work. I also verified the software works as expected.

Approved.
Comment 12 Yusuf Yaman freebsd_committer freebsd_triage 2025-02-14 21:29:44 UTC
(In reply to ek from comment #11)
Nice, you are welcome. Thanks.
Comment 13 ek 2025-02-14 21:45:41 UTC
Here's a quick question - Since the project name (and therefore the port name) is now in all capital letters, should the www/snip directory be named the same way and changed to www/SNIP for consistency?

I don't see very many ports with capital letters, so I'm not sure if this would be correct or not. But, I can certainly change that before this gets committed if that would be prudent.
Comment 14 Yusuf Yaman freebsd_committer freebsd_triage 2025-02-14 21:51:35 UTC
(In reply to ek from comment #13)
> should the www/snip directory be named the same way and changed to www/SNIP for consistency?

In my opinion, it should stay lowercase but that's just my opinion, I don't know how it should be.

> I don't see very many ports with capital letters, so I'm not sure if this would be correct or not. 

I don't generally encounter with all-uppercase portnames either.

> But, I can certainly change that before this gets committed if that would be prudent.

Of course, it can be changed but the reason why i made it all uppercase is that: Robert Clausecker was suggested me to change my port's PORTNAME to match with GH PROJECT name but it was not all uppercase, it was camelcase, so from all lowercase to camelcase: tuba --> Tuba.
Comment 15 ek 2025-02-14 22:02:16 UTC
(In reply to Yusuf Yaman from comment #14)

That's all very good info. Thanks again! I don't see a tuba/Tuba port anywhere in the ports tree (yet) but did you rename the port directory to "Tuba" as well or did you leave it as "tuba" and that was fine?
Comment 16 Yusuf Yaman freebsd_committer freebsd_triage 2025-02-14 22:06:07 UTC
(In reply to ek from comment #15)
That's all very good info. Thanks again! I don't see a tuba/Tuba port anywhere in the ports tree (yet) but did you rename the port directory to "Tuba" as well or did you leave it as "tuba" and that was fine?

You're welcome!

> I don't see a tuba/Tuba port anywhere in the ports tree (yet)

It is not yet committed to the Ports tree because it depends on a PR which should be resolved to commit Tuba. Tuba requires a newer version of gtksourceview5 and the version in Ports is lower than what Tuba requires.

Here it is: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=284793

> did you rename the port directory to "Tuba" as well or did you leave it as "tuba" and that was fine?

I didn't rename the directory name so I guess that this is fine.
Comment 17 ek 2025-02-14 22:09:34 UTC
(In reply to Yusuf Yaman from comment #16)

Again, great info and thank you very much!
Comment 18 Robert Clausecker freebsd_committer freebsd_triage 2025-02-14 23:08:15 UTC
directory name and PORTNAME don't have to match.  It's okay to have one lower case and the other case, see e.g. emulators/tic-80.
Comment 19 ek 2025-02-14 23:34:30 UTC
(In reply to Robert Clausecker from comment #18)

Perfect. Thanks, fuz!
Comment 20 ek 2025-04-19 21:53:34 UTC
Hrm. Still nothing on this commit. Not sure what else I can do to get this pushed? I've been testing it for many months and everything seems fine. What am I missing?
Comment 21 Yusuf Yaman freebsd_committer freebsd_triage 2025-04-20 05:04:45 UTC
(In reply to ek from comment #20)
Maybe try sending committer request to ports mailing list.
Comment 22 ek 2025-04-20 16:22:56 UTC
(In reply to Yusuf Yaman from comment #21)

I actually did this about 5 weeks ago. Still no traction. I guess I could do it again, but I don't want it to be cumbersome to the list.
Comment 23 Robert Clausecker freebsd_committer freebsd_triage 2025-04-20 20:28:26 UTC
I'm sorry for the slow processing.  I'll try to get this taken care of with my next batch.
Comment 24 Daniel Engberg freebsd_committer freebsd_triage 2025-04-20 22:39:07 UTC
1.1.0 is out, since upstream is using tags you couldn't use GH_TAGNAME
https://github.com/MercanoGlobal/SNIP/releases/tag/v1.1.0

https://docs.freebsd.org/en/books/porters-handbook/book/#makefile-master_sites-github
See example 14 and/or 16
Comment 25 ek 2025-04-21 00:48:40 UTC
(In reply to Robert Clausecker from comment #23)

Perfect. Thank you! No rush. Just wanted to make sure it wasn't completely forgotten. :)
Comment 26 ek 2025-04-21 00:49:54 UTC
(In reply to Daniel Engberg from comment #24)

Fixed (I believe?) Update for non-tagging and pulling versions. Also, updated to the v1.1.0 that is now available. Attaching patch to replace older "new port" patches. Thanks!
Comment 27 ek 2025-04-21 00:52:26 UTC
Created attachment 259756 [details]
v1.1.0 version patch

Updated to latest v1.1.0 version.
Comment 28 ek 2025-04-21 01:21:53 UTC
Created attachment 259757 [details]
NEW v1.1.0 patch

Dang it! That was the wrong patch that included old stuff no longer needed. *THIS* is the correct patch. Sorry about that!
Comment 29 Robert Clausecker freebsd_committer freebsd_triage 2025-04-21 10:44:40 UTC
(In reply to Daniel Engberg from comment #24)

Could you take this one?  I am inexperienced with PHP and would rather not add new PHP ports.
Comment 30 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2025-04-21 10:52:18 UTC
ek: Do you need this port in the way you submitted? Or you just need the port? 3:)
Comment 31 ek 2025-04-22 01:29:33 UTC
(In reply to Muhammad Moinur Rahman from comment #30)

Hi, Muhammad. I'm not sure I follow. I suppose I just want to use the port? Is there something wrong with the way the port is submitted? I can make any changes that are required.
Comment 32 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2025-04-22 10:11:48 UTC
(In reply to ek from comment #31)
1. DISTVERSION is wrong you have to use DISTVERSIONPREFIX
2. Check the ports with portclippy/portfmt/portlint -abct
3. You don't need those OPTIONS DESC they are defined by default
4. Use OPTIONSNG instead of the conditionals
5. Use dynamic plist rather than static large pkg-plist. Check one of those tex or gitlab ports.
Comment 33 ek 2025-04-29 21:36:47 UTC
Created attachment 260005 [details]
NEW SNIP v1.1.0 patch

(In reply to Muhammad Moinur Rahman from comment #32)

Hello, Mahhamad. Thanks for the info. Please find new patch attached.

1. DISTVERSIONPREFIX added
2. Port checked with portclippy/portfmt/portlint -abct (no errors)
3. OPTIONS DESC removed (where they could be)
4. OPTIONSNG used instead of the conditionals
5. Dynamic PLIST used instead of static

Please let me know if there's anything else that needs to be done.
Comment 34 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2025-04-30 07:34:53 UTC
It looks lot better now but there are couple of fundamental issues:
1. It should be s/OPTIONS_MULTI/OPTIONS_SINGLE/g. You cannot run one single database based PHP app with multiple database backend. So you will eventually use one of mysql/pgsql/sqlite. Not two or three of them.
2. Although at first it looks like that USE_PHP=pgsql implies installation of postgresql client by USES=pgsql and USE_PHP=sqlite implies USES=sqlite they should be mentioned with individual USES. Something like PGSQL_USES=pgsql and SQLITE_USES=sqlite. You do not need this for mysqli as that is a native driver itself and does not need a mysql client. The reason behind this is in future if you need to control or limit the versions of pgsql/sqlite as per the upstream of this software.
Comment 35 ek 2025-04-30 14:15:16 UTC
Created attachment 260023 [details]
new-new-new patch for SNIP-v1.1.0

(In reply to Muhammad Moinur Rahman from comment #34)

This makes sense. I've uploaded a new patch to include these changes. If there's anything else, I'm happy to address it. Thanks again, Moin!
Comment 36 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2025-04-30 15:22:52 UTC
Comment on attachment 257522 [details]
www/snip.patch

Updated patch with newer version.
Comment 37 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2025-04-30 15:23:41 UTC
Comment on attachment 257523 [details]
All diffs, changes made from me.

There is an updated patch with newer version.
Comment 38 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2025-04-30 15:31:50 UTC
Looks good to me. But for me this week is `src` week. So unless someone is faster than me I will commit in the coming weekend.

Just for future references:
1. The patch is not committer's friendly. Check the git primer on howto use the hooks to prepare the commit messages. https://docs.freebsd.org/en/articles/committers-guide/#git-mini-daily-use

For this specific case the commit log should be something like:

```
www/SNIP: New port
<BLANKLINE>
<COPY OF THE pkg-descr FILE>
<BLANKLINE>
WWW: <WWW from Makefile>
<BLANKLINE>
PR: 281810
```

2. When adding a new port the port has to be added to the <CATEGORY>/Makefile that is for this case `www/Makefile`. And that should also be part of the patch.
Comment 39 ek 2025-04-30 16:29:34 UTC
Created attachment 260025 [details]
new-new-new-new patch for SNIP-v1.1.0

(In reply to Muhammad Moinur Rahman from comment #38)

More excellent info! I was simply following the https://docs.freebsd.org/en/books/porters-handbook/quick-porting/#porting-submitting page in the handbook that doesn't mention this. Noted for future reference and thank you.

I've uploaded another new patch to (hopefully?) take care of this. Thanks again to everyone for all the help and knowledge!
Comment 40 commit-hook freebsd_committer freebsd_triage 2025-05-04 18:46:25 UTC
A commit in branch main references this bug:

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

commit 4d3c08abcb261f096f728e89b287fc955f1894bb
Author:     Janky Jay, III <ek@purplehat.org>
AuthorDate: 2025-04-30 16:14:12 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2025-05-04 18:44:36 +0000

    www/SNIP: New port

    SNIP is a powerful Open-Source PHP Pastebin, with the aim of keeping
    a simple and easy to use user interface. SNIP allows you to easily
    share code and files with anyone you wish. Based on the original
    Stikked with lots of bug fixes and improvements.

    Prerequisites:
    * A web server: Apache, LiteSpeed, Nginx, Lighttpd, Cherokee.
    * A database: MySQL / MariaDB, Postgres. OR a writable folder for SQLite.
    * PHP version 7.0 or newer is required.
    * PHP-GD for the creation of QR-codes.

    Here are some features:
    * Syntax highlighting including live highlighting with CodeMirror
    * Paste replies
    * Diff view between the original paste and the reply
    * An API
    * Trending pastes
    * Encrypted pastes
    * Burn on reading
    * File upload and preview
    * Anti-Spam features
    * Multilanguage support
    * SNIP client with support for client side encryption/decryption: gostikkit
    * Another CLI tool requiring only curl program: pbin

    WWW: https://github.com/MercanoGlobal/SNIP

    PR: 281810

 www/Makefile                        |  1 +
 www/SNIP/Makefile (new)             | 59 +++++++++++++++++++++++++++++++++++++
 www/SNIP/distinfo (new)             |  3 ++
 www/SNIP/files/pkg-message.in (new) | 20 +++++++++++++
 www/SNIP/pkg-descr (new)            | 24 +++++++++++++++
 5 files changed, 107 insertions(+)