[BACK]Return to Makefile CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / textproc / split-thai

Annotation of pkgsrc/textproc/split-thai/Makefile, Revision 1.3

1.3     ! scole       1: # $NetBSD: Makefile,v 1.2 2020/08/14 17:31:34 scole Exp $
1.1       scole       2:
1.3     ! scole       3: PKGNAME=       split-thai-0.3
1.1       scole       4: CATEGORIES=    textproc
                      5: MAINTAINER=    pkgsrc-users@NetBSD.org
                      6: COMMENT=       Utilities to split UTF-8 Thai text into words
                      7: LICENSE=       public-domain AND mit AND gnu-gpl-v2 # code, icu dict, swath dict
                      8:
                      9: # xxx fetching a specific version of a file out of a github project
                     10: EXTRACT_SUFX=  # none
                     11: GITHUB_ICU_TAG=        61607c27732906d36c5bd4d23ecc092f89f53a2b
                     12: DISTFILES=     thaidict-${GITHUB_ICU_TAG}.txt
                     13: MASTER_SITES=  -${MASTER_SITE_GITHUB:=unicode-org/}/icu/raw/${GITHUB_ICU_TAG}/icu4c/source/data/brkitr/dictionaries/thaidict.txt
                     14:
                     15: USE_LANGUAGES= c++11   # darwin needed 11?
                     16:
                     17: USE_TOOLS=     pkg-config mkdir cp sh:run env awk cat sort uniq grep wc echo
                     18: BUILD_DEPENDS+=        libdatrie-[0-9]*:../../devel/libdatrie
                     19: DEPENDS+=      emacs-[0-9]*:../../editors/emacs
                     20: DEPENDS+=      swath-[0-9]*:../../textproc/swath
                     21:
                     22: REPLACE_SH=    st-swath
                     23:
                     24: UTF8_ENV=      env LC_ALL=C.UTF-8
                     25:
                     26: ST_SHARE_DIR=          share/split-thai
                     27: INSTALLATION_DIRS=     bin ${ST_SHARE_DIR}
                     28:
1.2       scole      29: ST_SHARE_FILES=                README.txt thaidict thai-dict.el thai-dict.elc
                     30: ST_SHARE_FILES+=       thai-utility.el thai-utility.elc thaidict.tri
                     31:
1.1       scole      32: # xxx REPLACE_EMACS_SCRIPT
                     33: SUBST_CLASSES+=                        st-emacs-app
                     34: SUBST_STAGE.st-emacs-app=      pre-configure
                     35: SUBST_MESSAGE.st-emacs-app=    Fixing emacs script paths.
                     36: SUBST_FILES.st-emacs-app=      st-emacs
                     37: SUBST_SED.st-emacs-app=                -e 's,!/bin/emacs,!${PREFIX}/bin/emacs,g'
                     38:
                     39: SUBST_CLASSES+=                        dictionary-app
                     40: SUBST_STAGE.dictionary-app=    pre-configure
                     41: SUBST_MESSAGE.dictionary-app=  Fixing dictionary paths.
                     42: SUBST_FILES.dictionary-app=    st-emacs st-swath
                     43: SUBST_SED.dictionary-app=      -e 's,ST_SHARE_DIR,${PREFIX}/${ST_SHARE_DIR},g'
                     44:
                     45: pre-extract:
                     46:        mkdir -p ${WRKSRC}
                     47:        cd files && cp README.txt st-emacs st-icu.cc st-swath \
                     48:                thai-utility.el thaidict.abm ${WRKSRC}
                     49:
                     50: post-extract:
                     51:        cd ${WRKSRC} && ${UTF8_ENV} emacs --batch \
                     52:                -f batch-byte-compile thai-utility.el
1.2       scole      53:        cd ${WRKSRC} && ${UTF8_ENV} emacs --batch -l thai-utility.elc \
1.1       scole      54:                --eval '(thai-word-table-save "emacs-dict")'
                     55:        cp ${WRKDIR}/${DISTFILES} ${WRKSRC}/icu-dict
                     56:        cd ${PREFIX}/share/swath && \
                     57:                ${UTF8_ENV} trietool swathdic list | \
                     58:                awk '{print $$1}' > ${WRKSRC}/swath-dict
                     59:        cd ${WRKSRC} && \
                     60:                ${UTF8_ENV} cat icu-dict swath-dict emacs-dict | \
                     61:                        grep -v '#' | sort | uniq > thaidict
                     62:        cd ${WRKSRC} && \
                     63:                ${UTF8_ENV} trietool thaidict add-list -e utf-8 thaidict
1.2       scole      64:        cd ${WRKSRC} && ${UTF8_ENV} emacs --batch -l thai-utility.elc \
                     65:                --eval '(thai-word-table-save-defvar "thaidict" "thai-dict.el")'
                     66:        cd ${WRKSRC} && ${UTF8_ENV} emacs --batch \
                     67:                -f batch-byte-compile thai-dict.el
1.1       scole      68: .for i in emacs-dict icu-dict swath-dict
                     69:        @${ECHO} `wc -l ${WRKSRC}/${i} | awk '{print $$1}'` words in ${i}
                     70: .endfor
                     71:        @${ECHO} `wc -l ${WRKSRC}/thaidict | awk '{print $$1}'` \
                     72:                unique words in combined dictionary
                     73:
                     74: do-build:
                     75:        cd ${WRKSRC} && \
                     76:                ${CXX} ${CPPFLAGS} -o st-icu st-icu.cc \
                     77:                `pkg-config --libs --cflags icu-io`
                     78:
                     79: do-install:
                     80:        ${INSTALL_SCRIPT} ${WRKSRC}/st-emacs ${WRKSRC}/st-swath \
                     81:                ${DESTDIR}${PREFIX}/bin
                     82:        ${INSTALL_PROGRAM} ${WRKSRC}/st-icu ${DESTDIR}${PREFIX}/bin
1.2       scole      83: .for i in ${ST_SHARE_FILES}
1.1       scole      84:        ${INSTALL_DATA} ${WRKSRC}/${i} ${DESTDIR}${PREFIX}/share/split-thai
                     85: .endfor
                     86:
                     87: .include "../../textproc/icu/buildlink3.mk"
                     88: .include "../../mk/bsd.pkg.mk"

CVSweb <webmaster@jp.NetBSD.org>