On 2021/11/16 12:10, Adnan Shameem wrote:
> Thanks for the suggestions.
>
> > for the install target (annoying that upstream didn't handle this),
>
> When I ran make install when building from source, it did it without issues.
> So I assumed there must be a way. I get a ninja error on make plist if I
> remove do-install:
>
> I wonder if it's related to being in a wrong path.
hmm, no idea what's going on there. maybe someone who understands cmake
is reading and can help.
> > don't do this, INSTALL_DATA sets ownership anyway
>
> > use INSTALL_DATA not cp.
>
> I got these ideas from other ports. So thought it was the way I was supposed
> to do it. But I think INSTALL_DATA is more consistent.
SUBST_xx are specifically used when port variables need to be replaced,
if you're just copying then use INSTALL_xx instead
bsd.port.mk(5):
SUBST_CMD
A command that can be used to perform SUBST_VARS substitution on
arbitrary files. [...]
...
SUBST_DATA, SUBST_MAN, SUBST_PROGRAM
Specialized versions of SUBST_CMD that use -c and appropriate
owner/group/mode for data, manpages and programs respectively.
> I've made the changes. Updated file attached.
that's looking better.
btw,
${INSTALL_DATA} ${WRKSRC}/LICENSE
${PREFIX}/share/doc/colorgrab/LICENSE
${INSTALL_DATA} ${WRKSRC}/README.md
${PREFIX}/share/doc/colorgrab/README.md
that is ok and no need to change it, but to save typing later
you don't need the destination filename, just the directory name,
and you can list multiple source files in one go, e.g.
${INSTALL_DATA} ${WRKSRC}/LICENSE ${WRKSRC}/README.md \
${PREFIX}/share/doc/colorgrab/
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
>
> On Tuesday, November 16th, 2021 at 9:13 AM, Stuart Henderson
> <[email protected]> wrote:
>
> > On 2021/11/16 06:38, Adnan Shameem wrote:
> >
> > > Hello,
> > >
> > > I couldn't find any screen color picker on ports, which is essential for
> > > graphic and web designers.
> > >
> > > So I made a port for ColorGrab, a color picker that can pick any color
> > > from screen without opening any files, taking screenshots or using any
> > > developer tools; allows to optionally tweak the color and provides output
> > > for use in graphic, web and print design. Its UI is simple, but packed
> > > with lots of features.
> > >
> > > Announcement blog with screenshot and basic info:
> > > https://nielssp.dk/2015/02/colorgrab-a-crossplatform-color-picker/
> > >
> > > One thing though. I tried to get rid of the "do-install" target, but
> > > couldn't. Please let me know if there is a way.
> > >
> > > Please also let me know if there are any other changes that could be made.
> > >
> > > Regards,
> > >
> > > Adnan
> >
> > set these:
> >
> > GH_ACCOUNT= nielssp
> >
> > GH_PROJECT= colorgrab
> >
> > GH_TAGNAME= v0.3
> >
> > and remove
> >
> > V
> >
> > PKGNAME
> >
> > MASTER_SITES
> >
> > DISTNAME
> >
> > WRKDIST
> >
> > HOMEPAGE
> >
> > which are all taken care of by the GH_*
> >
> > rerun "make makesum" as this changes the filename in distinfo (notice that
> >
> > your old one had a very nondescriptive v3.tar.gz)
> >
> > also PATCH_LIST which is the default and almost never needed
> >
> > for the install target (annoying that upstream didn't handle this),
> >
> > ${INSTALL_DATA_DIR} ${PREFIX}/share/applications/
> >
> > ${SUBST_DATA} ${WRKSRC}/pkg/arch/colorgrab.desktop \
> >
> > ${PREFIX}/share/applications/colorgrab.desktop
> >
> > should be INSTALL_DATA not SUBST_DATA
> >
> > @chown ${SHAREOWN}:${SHAREGRP} \
> >
> > ${PREFIX}/share/applications/colorgrab.desktop
> >
> > don't do this, INSTALL_DATA sets ownership anyway
> >
> > ${INSTALL_DATA_DIR} ${PREFIX}/share/icons/hicolor/scalable/apps
> >
> > cp -p ${WRKSRC}/img/scalable.svg \
> >
> > ${PREFIX}/share/icons/hicolor/scalable/apps/colorgrab.svg
> >
> > ${INSTALL_DATA_DIR} ${PREFIX}/share/icons/hicolor/16x16/apps
> >
> > cp -p ${WRKSRC}/img/16x16.png \
> >
> > ${PREFIX}/share/icons/hicolor/16x16/apps/colorgrab.png
> >
> > ${INSTALL_DATA_DIR} ${PREFIX}/share/icons/hicolor/32x32/apps
> >
> > cp -p ${WRKSRC}/img/32x32.png \
> >
> > ${PREFIX}/share/icons/hicolor/32x32/apps/colorgrab.png
> >
> > ${INSTALL_DATA_DIR} ${PREFIX}/share/icons/hicolor/48x48/apps
> >
> > cp -p ${WRKSRC}/img/48x48.png \
> >
> > ${PREFIX}/share/icons/hicolor/48x48/apps/colorgrab.png
> >
> > ${INSTALL_DATA_DIR} ${PREFIX}/share/icons/hicolor/64x64/apps
> >
> > cp -p ${WRKSRC}/img/64x64.png \
> >
> > ${PREFIX}/share/icons/hicolor/64x64/apps/colorgrab.png
> >
> > ${INSTALL_DATA_DIR} ${PREFIX}/share/icons/hicolor/128x128/apps
> >
> > cp -p ${WRKSRC}/img/128x128.png \
> >
> > ${PREFIX}/share/icons/hicolor/128x128/apps/colorgrab.png
> >
> > ${INSTALL_DATA_DIR} ${PREFIX}/share/icons/hicolor/256x256/apps
> >
> > cp -p ${WRKSRC}/img/256x256.png \
> >
> > ${PREFIX}/share/icons/hicolor/256x256/apps/colorgrab.png
> >
> > use INSTALL_DATA not cp.
> >
> > you can bundle these together a bit more, various methods possible but
> >
> > this looks neater
> >
> > ${INSTALL_DATA_DIR} ${PREFIX}/share/icons/hicolor/scalable/apps
> >
> > ${INSTALL_DATA} ${WRKSRC}/img/scalable.svg \
> >
> > ${PREFIX}/share/icons/hicolor/scalable/apps/colorgrab.svg
> >
> > .for s in 16x16 32x32 48x48 64x64 128x128 256x256
> >
> > ${INSTALL_DATA_DIR} ${PREFIX}/share/icons/hicolor/$s/apps
> >
> > ${INSTALL_DATA} ${WRKSRC}/img/$s.png \
> >
> > ${PREFIX}/share/icons/hicolor/$s/apps/colorgrab.png
> >
> > .endfor
> >
> > ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/colorgrab
> >
> > ${INSTALL_DATA} ${WRKSRC}/LICENSE ${WRKSRC}/README.md
> >
> > here you copy WRKSRC/LICENSE to WRKSRC/README.md and don't actually
> >
> > install them