我正在为不使用Make的应用程序(Cypress)创建一个FreeBSD端口;相反,它使用NPM:
npm run binary-build-linux
cd cli
npm run build
我可以看到两个选项:
我想知道我是否错过了第三个选项:修改我的端口的Makefile以运行一系列shell命令来代替Makefile?读过搬运工的手册后,我看不到任何办法。
答案 0 :(得分:5)
您不一定需要使用make
,this is port在do-build
目标中使用go :(查看Additional Build Targets, target-OPT-on and target-OPT-off:< / p>
do-build:
@cd ${WRKSRC}/src/github.com/${GH_ACCOUNT}/${GH_PROJECT}; \
${SETENV} ${MAKE_ENV} ${BUILD_ENV} GOPATH=${WRKSRC} go build -ldflags \
"-s -w -X main.version=${PORTVERSION}" -o immortal cmd/immortal/main.go;
@cd ${WRKSRC}/src/github.com/${GH_ACCOUNT}/${GH_PROJECT}; \
${SETENV} ${MAKE_ENV} ${BUILD_ENV} GOPATH=${WRKSRC} go build -ldflags \
"-s -w -X main.version=${PORTVERSION}" -o immortalctl cmd/immortalctl/main.go;
@cd ${WRKSRC}/src/github.com/${GH_ACCOUNT}/${GH_PROJECT}; \
${SETENV} ${MAKE_ENV} ${BUILD_ENV} GOPATH=${WRKSRC} go build -ldflags \
"-s -w -X main.version=${PORTVERSION}" -o immortaldir cmd/immortaldir/main.go;
另一个port using node
:
do-build:
@(cd ${WRKSRC}/public ; node ./bundler.js )
@(cd ${WRKSRC} ; go-bindata -o util/bindata.go -pkg util config.json db/migrations/ public/css public/html public/html/projects public/html/projects/repositories public/html/projects/inventory public/html/projects/templates public/html/projects/users public/html/projects/environment public/html/projects/keys public/html/users public/html/auth public/img public/js public/js/services public/js/controllers public/js/controllers/projects public/js/routes public/js/factories public/node_modules public/node_modules/lodash public/node_modules/lodash/fp public/node_modules/async public/node_modules/async/dist public/node_modules/async/internal public/vendor public/vendor/fontawesome public/vendor/fontawesome/less public/vendor/fontawesome/fonts public/vendor/sweetalert public/vendor/moment public/vendor/bootstrap public/vendor/bootstrap/fonts public/vendor/bootstrap/dist public/vendor/bootstrap/dist/css public/vendor/bootstrap/dist/fonts public/vendor/bootstrap/dist/js public/vendor/bootstrap/less public/vendor/bootstrap/less/mixins public/vendor/angular-loading-bar )
@(cd ${WRKSRC}/cli ; ${SETENV} ${MAKE_ENV} GOPATH=${WRKSRC} go build -o semaphore ./... )
两个端口都使用BUILD_DEPENDS
(请查看Dependencies in the porter handbook)
BUILD_DEPENDS= ${LOCALBASE}/bin/go:lang/go \
${LOCALBASE}/bin/go-bindata:devel/go-bindata \
npm>=0:www/npm