-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile.pkgsrc
130 lines (107 loc) · 3.97 KB
/
Makefile.pkgsrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# -*- makefile-bsdmake -*-
# $NetBSD$
DISTNAME= yajl-2.2.91
#PKGREVISION= 0
CATEGORIES= devel textproc
MASTER_SITES= ${MASTER_SITE_GITHUB:=robohack/}
#GITHUB_PROJECT= yajl
GITHUB_TAG= release-${PKGVERSION_NOREV}
OWNER= [email protected]
HOMEPAGE= http://robohack.github.com/${PKGBASE}/
COMMENT= Small JSON library written in ANSI C
# "YAJL is released under the permissive ISC license."
LICENSE= modified-bsd
BUILD_DEPENDS+= cxref-[0-9]*:../../devel/cxref
USE_LANGUAGES= c c99
USE_BSD_MAKEFILE= yes
BSD_MAKE_BUILD_DIR= ${WRKDIR}/pkgbuild
MAKE_ENV+= MAKEOBJDIRPREFIX=${BSD_MAKE_BUILD_DIR}
USE_FEATURES+= snprintf
# xxx this use of ${VAR:!cmd!} is quite ugly to have to do, but because it is
# evaluated lazily it works to find the canonical form of ${WRKSRC} as a
# sub-directory of $MAKEOBJDIRPREFIX to match what the package makefile sees in
# its ${.CURDIR}.
#
# XXX Normally ${WRKSRC} would be a canonical pathname, but it may not be if
# ${WRKOBJDIR} is set, but not to a canonical path.
#
# XXX the appearance of the first word "WRKSRC" in the value below is actually
# unnecessary for make(1), but the makefile parser in pkglint cannot handle it
# being missing! In other news the new pkglint(1) is both kinda stupid and
# overly pedantic for no real benefit.
#
CANONICAL_WRKSRC= ${WRKSRC:!cd ${WRKSRC} && ${PWD_CMD}!}
PKGCONFIG_OVERRIDE= ${BSD_MAKE_BUILD_DIR}/${CANONICAL_WRKSRC}/src/${PKGBASE}.pc
PKGCONFIG_OVERRIDE_STAGE= post-build
AUTO_MKDIRS= yes
# totally automatic PLIST generation -- probably preferable?
#
# PLIST_TYPE= dynamic # and get rid of PLIST
#
GENERATE_PLIST+= cd ${DESTDIR}${PREFIX} && \
${FIND} share/doc/${PKGBASE}/html \( -type f -or -type l \) | ${SORT};
.include "../../mk/bsd.prefs.mk"
PLIST_SUBST+= PREFIX=${PREFIX:Q}
# N.B.: the following depend on PKGMAKECONF=/etc/mk.conf or the moral equivalent
# xxx they are also not needed if pkgsrc is properly patched to do this itself!
PLIST_VARS+= mkdebug
.if ${MKDEBUG:Uno:tl} != "no" && !defined(NODEBUG)
PLIST.mkdebug= yes
INSTALLATION_DIRS+= libdata/debug/${PREFIX}/bin
INSTALLATION_DIRS+= libdata/debug/${PREFIX}/libexec
INSTALLATION_DIRS+= libdata/debug/${PREFIX}/sbin
.endif
PLIST_VARS+= mkdebuglib
.if ${MKDEBUGLIB:Uno:tl} != "no"
PLIST.mkdebuglib= yes
INSTALLATION_DIRS+= libdata/debug/${PREFIX}/lib
.endif
PLIST_VARS+= mklint
.if ${MKLINT:Uno:tl} != "no"
PLIST.mklint= yes
.endif
PLIST_VARS+= mkpic
.if ${MKPIC:Uno:tl} != "no"
PLIST.mkpic= yes
.endif
PLIST_VARS+= mkprofile
.if ${MKPROFILE:Uno:tl} != "no"
PLIST.mkprofile= yes
.endif
do-configure:
${MKDIR} ${BSD_MAKE_BUILD_DIR}
# n.b.: this particular package does not need this pre-build step
# -- it does it itself!
#pre-build:
# cd ${WRKSRC} && ${BUILD_MAKE_CMD} obj
# how to get from there to here....
#
# git status
# # commit anything outstanding...
# mkdir build
# make -j 8 MAKEOBJDIRPREFIX=$(pwd -P)/build all regress
# make -j 8 MAKEOBJDIRPREFIX=$(pwd -P)/build DESTDIR=$(pwd -P)/dist install
# # check dist/* is correct... (bins, lib names, includes, .pc file, etc.)
# rm -rf build dist
# make distclean
# # update DISTNAME above and LIB_* in Makefile.project...
# git add Makefile.project Makefile.pkgsrc
# git commit -m 'Makefile.project, Makefile.pkgsrc: ready for release: ${PKGVERSION_NOREV}'
# # write release notes in doc/release-${PKGVERSION_NOREV}.md
# git tag -a -s -F doc/release-${PKGVERSION_NOREV}.md release-${PKGVERSION_NOREV}
# gh release create release-${PKGVERSION_NOREV} -t "Version ${PKGVERSION_NOREV}" --verify-tag --notes-from-tag
#
# Now, still in your ${REPODIR}, (or wherever you have cloned
# https://github.com/robohack/yajl to), run 'make setup-pkgsrc':
#
REPODIR?= . # /work/woods/f-yajl
PKGDIR?= /usr/pkgsrc/devel/yajl
setup-pkgsrc:
cd ${REPODIR} && pax -rw -v -s '|.pkgsrc$||' *.pkgsrc ${PKGDIR}
cd ${PKGDIR} && make fetch
cd ${PKGDIR} && make makesum
cd ${PKGDIR} && make test
.include "../../mk/bsd.pkg.mk"
# override INCSDIR for the project subdir....
INCSDIR= ${PREFIX}/include/${PKGBASE}
MAKE_ENV+= INCSDIR=${INCSDIR:Q}