bsd.lib.mk and PREFIX

2015-09-25 Thread Jonathan Anderson

Hi all,

I’m attempting to create a port for a library that uses BSD makefiles, 
and it’s turning out to be more difficult than some other 
gmake/cmake/whatever things I’ve previously ported!


The top-level Makefile within the port’s tarball looks like this:

```
LIB=distance
SRCS=   levenshtein.c hamming.c bloom.c needleman_wunsch.c jaccard.c
SRCS+=  minkowski.c damerau.c
MAN=distance.3
CFLAGS+=-g -Wall -Wunused
LDADD+= -g

SUBDIR+=test swig

CLEANFILES+=distance.cat3

.include 
```

Everything builds ok, but when I stage I get this error:

```
install -C -o root -g wheel -m 444   libdistance.a 
/usr/home/jon/freebsd-ports/devel/libdistance/work/stage/usr/lib
install: 
/usr/home/jon/freebsd-ports/devel/libdistance/work/stage/usr/lib: 
chown/chgrp: Operation not permitted

```

I can’t, for the life of me, figure out why the ports framework wants 
to install a library into `/usr/lib` instead of `/usr/local/lib`, or 
what variable I could set to override this behaviour. Any ideas?


Cheers,


Jon

--
Jonathan Anderson
jonat...@freebsd.org
___
freebsd-ports@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"

Re: USE_GITHUB and submodules

2015-05-21 Thread Jonathan Anderson
Ok, I've updated the port and it passes portlint (with one warning that
I can't seem to fix without introducing more warnings). Is the next step
to create a Phabricator review request via arcanist? If so, do I list
the folks you replied to this thread as reviewers? :) I suppose I would
also list people who I find with 'svn blame'?

Cheers,


Jon
> Jonathan Anderson <mailto:jonathan.robert.ander...@gmail.com>
> May 20, 2015 at 11:00 AM
> Thanks everybody for the input! With a security hat on, I definitely
> concur with the policy of no fetching outside of fetch and of
> requiring reproducibility/verifiability (e.g., commit hashes). With my
> getting-this-darn-port-updated hat, however... :)
>
> I think that I'll try to go with Shane's solution, if others concur
> that it's a good idea. I don't want to create a rust-llvm port, since
> Rust's customized version of LLVM isn't much good outside of Rust, it
> doesn't expose any external libraries and it's intended to eventually
> go away. So, until GitHub implements the "give me a tarball with all
> of the submodules" feature, I might try hacking up MASTER_SITES as
> Shane suggests.
>
> Cheers,
>
>
> Jon
>
> Shane Ambler <mailto:free...@shaneware.biz>
> May 19, 2015 at 10:16 PM
> On 20/05/2015 04:14, Jonathan Anderson wrote:
>> Hi all,
>>
>> Is there a mechanism for using the USE_GITHUB variable in a port that
>> depends on submodules? For instance, the Rust port requires an embedded
>> (and modified) version of LLVM, which it includes as a submodule. Right
>> now I'm attempting to add the following to a `post-extract` rule:
>
> While you can setup multiple files to be downloaded for a port this
> doesn't work with USE_GITHUB, see my 3 year old report -
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=172964
>
> This isn't an official port, but the workaround I came up with was to
> setup multiple files by setting MASTER_SITES using --
>
> MASTER_SITES= https://github.com/sambler/myblender/tarball/:base \
> https://github.com/sambler/myblendertranslations/tarball/:trans \
> https://github.com/sambler/myblenderaddons/tarball/:addons \
> https://github.com/sambler/myblendercontrib/tarball/:contrib
> DISTFILES= sambler-${PORTVERSION}.${PORTREVISION}:base \
> translate-${PORTVERSION}.${PORTREVISION}:trans \
> addons-${PORTVERSION}.${PORTREVISION}:addons \
> contrib-${PORTVERSION}.${PORTREVISION}:contrib
> DIST_SUBDIR= ${PORTNAME}
>
> The DISTFILES names are setup to match my tag format.
>
> This gives you multiple archives for the port, each will be extracted
> into the work dir, I then use post-extract to move them into place
> within the main source tree and don't depend on git for the port--
>
> post-extract:
> # tanslations
> @${MV} ${WRKDIR}/sambler-myblendertranslations-*/*
>   ${WRKSRC}/release/datafiles/locale/
> # addons
> @${MV} ${WRKDIR}/sambler-myblenderaddons-*/*
>   ${WRKSRC}/release/scripts/addons/
> # contrib
> @${MV} ${WRKDIR}/sambler-myblendercontrib-*/*
>   ${WRKSRC}/release/scripts/addons_contrib/
>
>
>> post-extract:
>>  cd ${WRKSRC} && \
>>  git init && \
>>  git remote add origin
>> https://github.com/${GH_ACCOUNT}/${PORTNAME} && \
>>  git fetch && \
>>  git reset --hard ${PORTVERSION} && \
>>  git submodule init && \
>>  git submodule update --recursive
>>
>> But this seems quite hackish! It would be great if submodules Just
>> Worked... but alternatively, is there a USE_GITHUB_URL or somesuch that
>> would check things out via Git instead of tarball to save me the `git
>> init` through `git reset` steps?
>>
>> Cheers,
>>
>>
>> Jon
>> -- 
>> jonat...@freebsd.org
>> ___
>> freebsd-ports@freebsd.org mailing list
>> http://lists.freebsd.org/mailman/listinfo/freebsd-ports
>> To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"
>>
>
>
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: USE_GITHUB and submodules

2015-05-20 Thread Jonathan Anderson
Thanks everybody for the input! With a security hat on, I definitely
concur with the policy of no fetching outside of fetch and of requiring
reproducibility/verifiability (e.g., commit hashes). With my
getting-this-darn-port-updated hat, however... :)

I think that I'll try to go with Shane's solution, if others concur that
it's a good idea. I don't want to create a rust-llvm port, since Rust's
customized version of LLVM isn't much good outside of Rust, it doesn't
expose any external libraries and it's intended to eventually go away.
So, until GitHub implements the "give me a tarball with all of the
submodules" feature, I might try hacking up MASTER_SITES as Shane suggests.

Cheers,


Jon
> Shane Ambler <mailto:free...@shaneware.biz>
> May 19, 2015 at 10:16 PM
> On 20/05/2015 04:14, Jonathan Anderson wrote:
>> Hi all,
>>
>> Is there a mechanism for using the USE_GITHUB variable in a port that
>> depends on submodules? For instance, the Rust port requires an embedded
>> (and modified) version of LLVM, which it includes as a submodule. Right
>> now I'm attempting to add the following to a `post-extract` rule:
>
> While you can setup multiple files to be downloaded for a port this
> doesn't work with USE_GITHUB, see my 3 year old report -
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=172964
>
> This isn't an official port, but the workaround I came up with was to
> setup multiple files by setting MASTER_SITES using --
>
> MASTER_SITES= https://github.com/sambler/myblender/tarball/:base \
> https://github.com/sambler/myblendertranslations/tarball/:trans \
> https://github.com/sambler/myblenderaddons/tarball/:addons \
> https://github.com/sambler/myblendercontrib/tarball/:contrib
> DISTFILES= sambler-${PORTVERSION}.${PORTREVISION}:base \
> translate-${PORTVERSION}.${PORTREVISION}:trans \
> addons-${PORTVERSION}.${PORTREVISION}:addons \
> contrib-${PORTVERSION}.${PORTREVISION}:contrib
> DIST_SUBDIR= ${PORTNAME}
>
> The DISTFILES names are setup to match my tag format.
>
> This gives you multiple archives for the port, each will be extracted
> into the work dir, I then use post-extract to move them into place
> within the main source tree and don't depend on git for the port--
>
> post-extract:
> # tanslations
> @${MV} ${WRKDIR}/sambler-myblendertranslations-*/*
>   ${WRKSRC}/release/datafiles/locale/
> # addons
> @${MV} ${WRKDIR}/sambler-myblenderaddons-*/*
>   ${WRKSRC}/release/scripts/addons/
> # contrib
> @${MV} ${WRKDIR}/sambler-myblendercontrib-*/*
>   ${WRKSRC}/release/scripts/addons_contrib/
>
>
>> post-extract:
>>  cd ${WRKSRC} && \
>>  git init && \
>>  git remote add origin
>> https://github.com/${GH_ACCOUNT}/${PORTNAME} && \
>>  git fetch && \
>>  git reset --hard ${PORTVERSION} && \
>>  git submodule init && \
>>  git submodule update --recursive
>>
>> But this seems quite hackish! It would be great if submodules Just
>> Worked... but alternatively, is there a USE_GITHUB_URL or somesuch that
>> would check things out via Git instead of tarball to save me the `git
>> init` through `git reset` steps?
>>
>> Cheers,
>>
>>
>> Jon
>> -- 
>> jonat...@freebsd.org
>> ___
>> freebsd-ports@freebsd.org mailing list
>> http://lists.freebsd.org/mailman/listinfo/freebsd-ports
>> To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"
>>
>
>

-- 
jonathan.ander...@ieee.org

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


USE_GITHUB and submodules

2015-05-19 Thread Jonathan Anderson
Hi all,

Is there a mechanism for using the USE_GITHUB variable in a port that
depends on submodules? For instance, the Rust port requires an embedded
(and modified) version of LLVM, which it includes as a submodule. Right
now I'm attempting to add the following to a `post-extract` rule:

post-extract:
cd ${WRKSRC} && \
git init && \
git remote add origin https://github.com/${GH_ACCOUNT}/${PORTNAME} && \
git fetch && \
git reset --hard ${PORTVERSION} && \
git submodule init && \
git submodule update --recursive

But this seems quite hackish! It would be great if submodules Just
Worked... but alternatively, is there a USE_GITHUB_URL or somesuch that
would check things out via Git instead of tarball to save me the `git
init` through `git reset` steps?

Cheers,


Jon
--
jonat...@freebsd.org
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: pkgng suggestion: renaming /usr/sbin/pkg to /usr/sbin/pkg-bootstrap

2012-08-24 Thread Jonathan Anderson
On Saturday, 25 August 2012 at 01:33, Glen Barber wrote:
> On Sat, Aug 25, 2012 at 01:25:15AM +0100, Jonathan Anderson wrote:
> > On 24 Aug 2012, at 23:38, Doug Barton  > (mailto:do...@freebsd.org)> wrote:
> > > Let me rephrase that more simply ... very few users are ever going to
> > > need the bootstrapping tool that will be in the base.
> > 
> 
> 
> So, then they won't use it. I fail to see the problem here.
I also fail to see the problem. :) Just to be clear, my post was arguing 
against Doug's assertion that few will use pkg's bootstrapper (and that this is 
a problem): I hope that pkgng and package sets will vastly increase the use of 
binary packages by FreeBSD consumers.
 
> /usr/sbin/pkg installs /usr/local/sbin/pkg without requiring the Ports
> Collection to be available locally.

Which is exactly the behaviour that I want: I view the ports tree as a last 
resort to be used only if binary packages fail to fulfil my needs. Sometimes I 
don't even bother fetching it. Once again, we may be in violent agreement here. 
:)


Jon
-- 
Jonathan Anderson
jonat...@freebsd.org






___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: pkgng suggestion: renaming /usr/sbin/pkg to /usr/sbin/pkg-bootstrap

2012-08-24 Thread Jonathan Anderson
On 24 Aug 2012, at 23:38, Doug Barton  wrote:
> Let me rephrase that more simply ... very few users are ever going to
> need the bootstrapping tool that will be in the base.

But surely the whole point of pkgng is that people *will* use pkg as the 
default method of acquiring third-party software, so they'll want to "pkg 
install foo" and have it Just Work. To say either "you must download the ports 
tree in order to use binary packages" or "you must use pkg_add to install pkg" 
seems to miss the point...


Jon
--
Jonathan Anderson

jonat...@freebsd.org
http://freebsd.org/~jonathan/___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: CFT: new BSD-licensed sort available

2012-03-14 Thread Jonathan Anderson
On 14 Mar 2012, at 21:10, Adrian Chadd wrote:
> Hi,
> 
> This makes me think of the whole debian-y way of replacing the mailer
> programs using some magic alias program.
> 
> So you could intall gnusort, bsdsort, and then some config file would
> determine which was used.
> 
> 'sort' would then be a symlink to said magic program, that'd look at
> its argv[0], look at the contents of that file, and exec() the right
> one.

In fact, the runtime behaviour of the Debian "alternatives" system is simpler 
than that:
http://segfault.in/2010/04/using-the-debian-alternatives-system/

The custom Perl script with a config file is used to set up symlinks, which at 
runtime are... well, just symlinks. For instance, /usr/bin/vim is a symlink to 
/etc/alternatives/vim, which is itself a symlink to a binary like vim.gtk 
(example shamelessly stolen from the linked page, since I no longer have any 
Debian boxes to check for myself on :). No magic binaries or argv[0] fu.

In one way, it's an elegant solution. On the other, it's a classic example of 
Wheeler's Law in action. :)


Jon
--
Jonathan Anderson

Research Student, Security Group
Computer Laboratory
University of Cambridge

+44 (1223) 763747
jonathan.ander...@cl.cam.ac.uk___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"