diff --git a/gsm/mingw-w64/PKGBUILD b/gsm/mingw-w64/PKGBUILD new file mode 100644 index 00000000..0b01024d --- /dev/null +++ b/gsm/mingw-w64/PKGBUILD @@ -0,0 +1,69 @@ +# Maintainer: Karl-Felix Glatzer +_name=gsm +pkgname=mingw-w64-gsm +pkgver=1.0.14 +pkgrel=1 +pkgdesc="Shared libraries for GSM 06.10 lossy speech compression (mingw-w64)" +arch=('any') +url="http://www.quut.com/gsm/" +license=('custom') +options=(!strip !buildflags staticlibs) +depends=('mingw-w64-crt') +makedepends=('mingw-w64-gcc') +source=("http://www.quut.com/${_name}/${_name}-${pkgver}.tar.gz" + 'gsm.patch' + 'makefile.patch' + 'win32.patch') +md5sums=('4cbb4e7b73842de3d12d30b0d74200d4' + '30f46c92d0a5e5654258e707a9e8b5a6' + '1f17f4c181769a091891092e1fdc1e3c' + 'bb2919748d4ed7eb3174af976126f501') +_architectures="i686-w64-mingw32 x86_64-w64-mingw32" + +prepare() { + cd "${srcdir}/gsm-${pkgver%.*}-pl${pkgver##*.}/" + + patch -Np0 -i "${srcdir}/${_name}.patch" + patch -Np1 -i "${srcdir}/makefile.patch" + patch -Np1 -i "${srcdir}/win32.patch" +} + +build() { + for _arch in ${_architectures}; do + cp -r ${srcdir}/gsm-${pkgver%.*}-pl${pkgver##*.} ${srcdir}/build-${_arch} && cd ${srcdir}/build-${_arch} + + unset LDFLAGS CPPFLAGS + make -f Makefile.mingw64 \ + CC=${_arch}-gcc \ + AR=${_arch}-ar \ + RANLIB=${_arch}-ranlib + done +} + +package() { + for _arch in ${_architectures}; do + cd ${srcdir}/build-${_arch} + + # Prepare directories + install -m755 -d ${pkgdir}/usr/${_arch}/{bin,lib,include/gsm,share/{licenses/gsm,man/man{1,3}}} + + unset LDFLAGS CPPFLAGS + make -f Makefile.mingw64 \ + CC="${_arch}-gcc" \ + AR=${_arch}-ar \ + RANLIB=${_arch}-ranlib \ + INSTALL_ROOT=${pkgdir}/usr/${_arch} \ + GSM_INSTALL_INC=${pkgdir}/usr/${_arch}/include/gsm \ + GSM_INSTALL_MAN=${pkgdir}/usr/${_arch}/share/man/man3 \ + TOAST_INSTALL_MAN=${pkgdir}/usr/${_arch}/share/man/man1 \ + install + + # Install license + install -m644 COPYRIGHT ${pkgdir}/usr/${_arch}/share/licenses/gsm/license.txt + + ${_arch}-strip -x -g "${pkgdir}/usr/${_arch}/bin/"*.dll + ${_arch}-strip -g "${pkgdir}/usr/${_arch}/lib/"*.a + rm ${pkgdir}/usr/${_arch}/bin/*.exe + rm -r ${pkgdir}/usr/${_arch}/share/man + done +} diff --git a/gsm/mingw-w64/gsm.patch b/gsm/mingw-w64/gsm.patch new file mode 100644 index 00000000..821f3a59 --- /dev/null +++ b/gsm/mingw-w64/gsm.patch @@ -0,0 +1,198 @@ +--- Makefile 2006-04-26 15:14:26.000000000 -0400 ++++ Makefile 2010-06-19 16:53:25.000000000 -0400 +@@ -44,7 +44,7 @@ + # CCFLAGS = -c -O + + CC = gcc -ansi -pedantic +-CCFLAGS = -c -O2 -DNeedFunctionPrototypes=1 ++CCFLAGS = -c -O2 -fPIC -DNeedFunctionPrototypes=1 + + LD = $(CC) + +@@ -96,11 +96,11 @@ + # Other tools + + SHELL = /bin/sh +-LN = ln ++LN = ln -s -f + BASENAME = basename + AR = ar + ARFLAGS = cr +-RMFLAGS = ++RMFLAGS = -f + FIND = find + COMPRESS = compress + COMPRESSFLAGS = +@@ -139,7 +139,7 @@ + + # Targets + +-LIBGSM = $(LIB)/libgsm.a ++LIBGSMSO = $(LIB)/libgsm.so + + TOAST = $(BIN)/toast + UNTOAST = $(BIN)/untoast +@@ -257,7 +257,7 @@ + # Install targets + + GSM_INSTALL_TARGETS = \ +- $(GSM_INSTALL_LIB)/libgsm.a \ ++ $(GSM_INSTALL_LIB)/libgsm.so \ + $(GSM_INSTALL_INC)/gsm.h \ + $(GSM_INSTALL_MAN)/gsm.3 \ + $(GSM_INSTALL_MAN)/gsm_explode.3 \ +@@ -279,7 +279,7 @@ + + # Target rules + +-all: $(LIBGSM) $(TOAST) $(TCAT) $(UNTOAST) ++all: $(LIBGSMSO) $(TOAST) $(TCAT) $(UNTOAST) + @-echo $(ROOT): Done. + + tst: $(TST)/lin2cod $(TST)/cod2lin $(TOAST) $(TST)/test-result +@@ -299,24 +299,23 @@ + + # The basic API: libgsm + +-$(LIBGSM): $(LIB) $(GSM_OBJECTS) +- -rm $(RMFLAGS) $(LIBGSM) +- $(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS) +- $(RANLIB) $(LIBGSM) +- ++$(LIBGSMSO): $(LIB) $(GSM_OBJECTS) ++ $(LD) -shared -Wl,-soname,libgsm.so.1 -o $@.1.0.13 $(GSM_OBJECTS) ++ $(LN) libgsm.so.1.0.13 $(LIBGSMSO).1 ++ $(LN) libgsm.so.1.0.13 $(LIBGSMSO) + + # Toast, Untoast and Tcat -- the compress-like frontends to gsm. + +-$(TOAST): $(BIN) $(TOAST_OBJECTS) $(LIBGSM) +- $(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSM) $(LDLIB) ++$(TOAST): $(BIN) $(TOAST_OBJECTS) $(LIBGSMSO) ++ $(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSMSO) $(LDLIB) + + $(UNTOAST): $(BIN) $(TOAST) + -rm $(RMFLAGS) $(UNTOAST) +- $(LN) $(TOAST) $(UNTOAST) ++ $(LN) toast $(UNTOAST) + + $(TCAT): $(BIN) $(TOAST) + -rm $(RMFLAGS) $(TCAT) +- $(LN) $(TOAST) $(TCAT) ++ $(LN) toast $(TCAT) + + + # The local bin and lib directories +@@ -351,53 +350,54 @@ + fi + + $(TOAST_INSTALL_BIN)/toast: $(TOAST) +- -rm $@ ++ -rm $(RMFLAGS) $@ + cp $(TOAST) $@ + chmod 755 $@ + + $(TOAST_INSTALL_BIN)/untoast: $(TOAST_INSTALL_BIN)/toast +- -rm $@ +- ln $? $@ ++ -rm $(RMFLAGS) $@ ++ $(LN) toast $@ + + $(TOAST_INSTALL_BIN)/tcat: $(TOAST_INSTALL_BIN)/toast +- -rm $@ +- ln $? $@ ++ -rm $(RMFLAGS) $@ ++ $(LN) toast $@ + + $(TOAST_INSTALL_MAN)/toast.1: $(MAN)/toast.1 +- -rm $@ ++ -rm $(RMFLAGS) $@ + cp $? $@ + chmod 444 $@ + + $(GSM_INSTALL_MAN)/gsm.3: $(MAN)/gsm.3 +- -rm $@ ++ -rm $(RMFLAGS) $@ + cp $? $@ + chmod 444 $@ + + $(GSM_INSTALL_MAN)/gsm_option.3: $(MAN)/gsm_option.3 +- -rm $@ ++ -rm $(RMFLAGS) $@ + cp $? $@ + chmod 444 $@ + + $(GSM_INSTALL_MAN)/gsm_explode.3: $(MAN)/gsm_explode.3 +- -rm $@ ++ -rm $(RMFLAGS) $@ + cp $? $@ + chmod 444 $@ + + $(GSM_INSTALL_MAN)/gsm_print.3: $(MAN)/gsm_print.3 +- -rm $@ ++ -rm $(RMFLAGS) $@ + cp $? $@ + chmod 444 $@ + + $(GSM_INSTALL_INC)/gsm.h: $(INC)/gsm.h +- -rm $@ +- cp $? $@ +- chmod 444 $@ +- +-$(GSM_INSTALL_LIB)/libgsm.a: $(LIBGSM) +- -rm $@ ++ -rm $(RMFLAGS) $@ + cp $? $@ + chmod 444 $@ + ++$(GSM_INSTALL_LIB)/libgsm.so: $(LIBGSMSO) ++ -rm $(RMFLAGS) $@ $@.1 $@.1.0.13 ++ cp $?.1.0.13 $@.1.0.13 ++ chmod 755 $@.1.0.13 ++ $(LN) libgsm.so.1.0.13 $@ ++ $(LN) libgsm.so.1.0.13 $@.1 + + # Distribution + +@@ -425,7 +425,7 @@ + -print | xargs rm $(RMFLAGS) + + clean: semi-clean +- -rm $(RMFLAGS) $(LIBGSM) $(ADDTST)/add \ ++ -rm $(RMFLAGS) $(LIBGSMSO)* $(ADDTST)/add \ + $(TOAST) $(TCAT) $(UNTOAST) \ + $(ROOT)/gsm-1.0.tar.Z + +@@ -473,22 +473,22 @@ + $(TST)/test-result: $(TST)/lin2cod $(TST)/cod2lin $(TOAST) $(TST)/run + ( cd $(TST); ./run ) + +-$(TST)/lin2txt: $(TST)/lin2txt.o $(LIBGSM) ++$(TST)/lin2txt: $(TST)/lin2txt.o $(LIBGSMSO) + $(LD) $(LFLAGS) -o $(TST)/lin2txt \ +- $(TST)/lin2txt.o $(LIBGSM) $(LDLIB) ++ $(TST)/lin2txt.o $(LIBGSMSO) $(LDLIB) + +-$(TST)/lin2cod: $(TST)/lin2cod.o $(LIBGSM) ++$(TST)/lin2cod: $(TST)/lin2cod.o $(LIBGSMSO) + $(LD) $(LFLAGS) -o $(TST)/lin2cod \ +- $(TST)/lin2cod.o $(LIBGSM) $(LDLIB) ++ $(TST)/lin2cod.o $(LIBGSMSO) $(LDLIB) + +-$(TST)/gsm2cod: $(TST)/gsm2cod.o $(LIBGSM) ++$(TST)/gsm2cod: $(TST)/gsm2cod.o $(LIBGSMSO) + $(LD) $(LFLAGS) -o $(TST)/gsm2cod \ +- $(TST)/gsm2cod.o $(LIBGSM) $(LDLIB) ++ $(TST)/gsm2cod.o $(LIBGSMSO) $(LDLIB) + +-$(TST)/cod2txt: $(TST)/cod2txt.o $(LIBGSM) ++$(TST)/cod2txt: $(TST)/cod2txt.o $(LIBGSMSO) + $(LD) $(LFLAGS) -o $(TST)/cod2txt \ +- $(TST)/cod2txt.o $(LIBGSM) $(LDLIB) ++ $(TST)/cod2txt.o $(LIBGSMSO) $(LDLIB) + +-$(TST)/cod2lin: $(TST)/cod2lin.o $(LIBGSM) ++$(TST)/cod2lin: $(TST)/cod2lin.o $(LIBGSMSO) + $(LD) $(LFLAGS) -o $(TST)/cod2lin \ +- $(TST)/cod2lin.o $(LIBGSM) $(LDLIB) ++ $(TST)/cod2lin.o $(LIBGSMSO) $(LDLIB) diff --git a/gsm/mingw-w64/makefile.patch b/gsm/mingw-w64/makefile.patch new file mode 100644 index 00000000..8b3c9467 --- /dev/null +++ b/gsm/mingw-w64/makefile.patch @@ -0,0 +1,519 @@ +--- gsm-1.0-pl13/Makefile.mingw64 1970-01-01 01:00:00.000000000 +0100 ++++ patched/Makefile.mingw64 2013-06-14 18:09:26.811006596 +0200 +@@ -0,0 +1,516 @@ ++# Copyright 1992-1996 by Jutta Degener and Carsten Bormann, Technische ++# Universitaet Berlin. See the accompanying file "COPYRIGHT" for ++# details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. ++ ++# Machine- or installation dependent flags you should configure to port ++ ++SASR = -DSASR ++######### Define SASR if >> is a signed arithmetic shift (-1 >> 1 == -1) ++ ++# MULHACK = -DUSE_FLOAT_MUL ++######### Define this if your host multiplies floats faster than integers, ++######### e.g. on a SPARCstation. ++ ++# FAST = -DFAST ++######### Define together with USE_FLOAT_MUL to enable the GSM library's ++######### approximation option for incorrect, but good-enough results. ++ ++# LTP_CUT = -DLTP_CUT ++LTP_CUT = ++######### Define to enable the GSM library's long-term correlation ++######### approximation option---faster, but worse; works for ++######### both integer and floating point multiplications. ++######### This flag is still in the experimental stage. ++ ++WAV49 = -DWAV49 ++# WAV49 = ++######### Define to enable the GSM library's option to pack GSM frames ++######### in the style used by the WAV #49 format. If you want to write ++######### a tool that produces .WAV files which contain GSM-encoded data, ++######### define this, and read about the GSM_OPT_WAV49 option in the ++######### manual page on gsm_option(3). ++ ++# Choose a compiler. The code works both with ANSI and K&R-C. ++# Use -DNeedFunctionPrototypes to compile with, -UNeedFunctionPrototypes to ++# compile without, function prototypes in the header files. ++# ++# You can use the -DSTUPID_COMPILER to circumvent some compilers' ++# static limits regarding the number of subexpressions in a statement. ++ ++# CC = cc ++# CCFLAGS = -c -DSTUPID_COMPILER ++ ++# CC = /usr/lang/acc ++# CCFLAGS = -c -O ++ ++CC? = gcc ++CCFLAGS = -ansi -pedantic -c -O2 -DNeedFunctionPrototypes=1 ++ ++LD = $(CC) ++ ++# LD = gcc ++# LDFLAGS = ++ ++ ++# If your compiler needs additional flags/libraries, regardless of ++# the source compiled, configure them here. ++ ++# CCINC = -I/usr/gnu/lib/gcc-2.1/gcc-lib/sparc-sun-sunos4.1.2/2.1/include ++######### Includes needed by $(CC) ++ ++# LDINC = -L/usr/gnu/lib/gcc-2.1/gcc-lib/sparc-sun-sunos4.1.2/2.1 ++######### Library paths needed by $(LD) ++ ++# LDLIB = -lgcc ++######### Additional libraries needed by $(LD) ++ ++ ++# Where do you want to install libraries, binaries, a header file ++# and the manual pages? ++# ++# Leave INSTALL_ROOT empty (or just don't execute "make install") to ++# not install gsm and toast outside of this directory. ++ ++INSTALL_ROOT = ++ ++# Where do you want to install the gsm library, header file, and manpages? ++# ++# Leave GSM_INSTALL_ROOT empty to not install the GSM library outside of ++# this directory. ++ ++GSM_INSTALL_ROOT = $(INSTALL_ROOT) ++GSM_INSTALL_BIN = $(GSM_INSTALL_ROOT)/bin ++GSM_INSTALL_LIB = $(GSM_INSTALL_ROOT)/lib ++GSM_INSTALL_INC = $(GSM_INSTALL_ROOT)/inc ++GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/man/man3 ++ ++ ++# Where do you want to install the toast binaries and their manpage? ++# ++# Leave TOAST_INSTALL_ROOT empty to not install the toast binaries outside ++# of this directory. ++ ++TOAST_INSTALL_ROOT = $(INSTALL_ROOT) ++TOAST_INSTALL_BIN = $(TOAST_INSTALL_ROOT)/bin ++TOAST_INSTALL_MAN = $(TOAST_INSTALL_ROOT)/man/man1 ++ ++# Other tools ++ ++SHELL = /bin/sh ++LN = ln -s -f ++BASENAME = basename ++AR? = ar ++ARFLAGS = cr ++RMFLAGS = -f ++FIND = find ++COMPRESS = compress ++COMPRESSFLAGS = ++# RANLIB = true ++RANLIB? = ranlib ++ ++# ++# You shouldn't have to configure below this line if you're porting. ++# ++ ++ ++# Local Directories ++ ++ROOT = . ++ADDTST = $(ROOT)/add-test ++TST = $(ROOT)/tst ++MAN = $(ROOT)/man ++BIN = $(ROOT)/bin ++SRC = $(ROOT)/src ++LIB = $(ROOT)/lib ++TLS = $(ROOT)/tls ++INC = $(ROOT)/inc ++ ++# Flags ++ ++# DEBUG = -DNDEBUG ++######### Remove -DNDEBUG to enable assertions. ++ ++CFLAGS = $(CCFLAGS) $(SASR) $(DEBUG) $(MULHACK) $(FAST) $(LTP_CUT) \ ++ $(WAV49) $(CCINC) -I$(INC) ++######### It's $(CC) $(CFLAGS) ++ ++LFLAGS = $(LDFLAGS) $(LDINC) ++######### It's $(LD) $(LFLAGS) ++ ++ ++# Targets ++ ++LIBGSM = $(LIB)/libgsm.a ++LIBGSMIMPLIB = $(LIB)/libgsm.dll.a ++LIBGSMDLL = $(BIN)/libgsm.dll ++ ++TOAST = $(BIN)/toast.exe ++UNTOAST = $(BIN)/untoast.exe ++TCAT = $(BIN)/tcat.exe ++ ++# Headers ++ ++GSM_HEADERS = $(INC)/gsm.h ++ ++HEADERS = $(INC)/proto.h \ ++ $(INC)/unproto.h \ ++ $(INC)/config.h \ ++ $(INC)/private.h \ ++ $(INC)/gsm.h \ ++ $(INC)/toast.h \ ++ $(TLS)/taste.h ++ ++# Sources ++ ++GSM_SOURCES = $(SRC)/add.c \ ++ $(SRC)/code.c \ ++ $(SRC)/debug.c \ ++ $(SRC)/decode.c \ ++ $(SRC)/long_term.c \ ++ $(SRC)/lpc.c \ ++ $(SRC)/preprocess.c \ ++ $(SRC)/rpe.c \ ++ $(SRC)/gsm_destroy.c \ ++ $(SRC)/gsm_decode.c \ ++ $(SRC)/gsm_encode.c \ ++ $(SRC)/gsm_explode.c \ ++ $(SRC)/gsm_implode.c \ ++ $(SRC)/gsm_create.c \ ++ $(SRC)/gsm_print.c \ ++ $(SRC)/gsm_option.c \ ++ $(SRC)/short_term.c \ ++ $(SRC)/table.c ++ ++TOAST_SOURCES = $(SRC)/toast.c \ ++ $(SRC)/toast_lin.c \ ++ $(SRC)/toast_ulaw.c \ ++ $(SRC)/toast_alaw.c \ ++ $(SRC)/toast_audio.c ++ ++SOURCES = $(GSM_SOURCES) \ ++ $(TOAST_SOURCES) \ ++ $(ADDTST)/add_test.c \ ++ $(TLS)/sour.c \ ++ $(TLS)/ginger.c \ ++ $(TLS)/sour1.dta \ ++ $(TLS)/sour2.dta \ ++ $(TLS)/bitter.c \ ++ $(TLS)/bitter.dta \ ++ $(TLS)/taste.c \ ++ $(TLS)/sweet.c \ ++ $(TST)/cod2lin.c \ ++ $(TST)/cod2txt.c \ ++ $(TST)/gsm2cod.c \ ++ $(TST)/lin2cod.c \ ++ $(TST)/lin2txt.c ++ ++# Object files ++ ++GSM_OBJECTS = $(SRC)/add.o \ ++ $(SRC)/code.o \ ++ $(SRC)/debug.o \ ++ $(SRC)/decode.o \ ++ $(SRC)/long_term.o \ ++ $(SRC)/lpc.o \ ++ $(SRC)/preprocess.o \ ++ $(SRC)/rpe.o \ ++ $(SRC)/gsm_destroy.o \ ++ $(SRC)/gsm_decode.o \ ++ $(SRC)/gsm_encode.o \ ++ $(SRC)/gsm_explode.o \ ++ $(SRC)/gsm_implode.o \ ++ $(SRC)/gsm_create.o \ ++ $(SRC)/gsm_print.o \ ++ $(SRC)/gsm_option.o \ ++ $(SRC)/short_term.o \ ++ $(SRC)/table.o ++ ++TOAST_OBJECTS = $(SRC)/toast.o \ ++ $(SRC)/toast_lin.o \ ++ $(SRC)/toast_ulaw.o \ ++ $(SRC)/toast_alaw.o \ ++ $(SRC)/toast_audio.o ++ ++OBJECTS = $(GSM_OBJECTS) $(TOAST_OBJECTS) ++ ++# Manuals ++ ++GSM_MANUALS = $(MAN)/gsm.3 \ ++ $(MAN)/gsm_explode.3 \ ++ $(MAN)/gsm_option.3 \ ++ $(MAN)/gsm_print.3 ++ ++TOAST_MANUALS = $(MAN)/toast.1 ++ ++MANUALS = $(GSM_MANUALS) $(TOAST_MANUALS) $(MAN)/bitter.1 ++ ++# Other stuff in the distribution ++ ++STUFF = ChangeLog \ ++ INSTALL \ ++ MACHINES \ ++ MANIFEST \ ++ Makefile \ ++ README \ ++ $(ADDTST)/add_test.dta \ ++ $(TLS)/bitter.dta \ ++ $(TST)/run ++ ++ ++# Install targets ++ ++GSM_INSTALL_TARGETS = \ ++ $(GSM_INSTALL_LIB)/libgsm.a \ ++ $(GSM_INSTALL_LIB)/libgsm.dll.a \ ++ $(GSM_INSTALL_BIN)/libgsm.dll \ ++ $(GSM_INSTALL_INC)/gsm.h \ ++ $(GSM_INSTALL_MAN)/gsm.3 \ ++ $(GSM_INSTALL_MAN)/gsm_explode.3 \ ++ $(GSM_INSTALL_MAN)/gsm_option.3 \ ++ $(GSM_INSTALL_MAN)/gsm_print.3 ++ ++TOAST_INSTALL_TARGETS = \ ++ $(TOAST_INSTALL_BIN)/toast.exe \ ++ $(TOAST_INSTALL_BIN)/tcat.exe \ ++ $(TOAST_INSTALL_BIN)/untoast.exe \ ++ $(TOAST_INSTALL_MAN)/toast.1 ++ ++ ++# Default rules ++ ++.c.o: ++ $(CC) $(CFLAGS) $? ++ @-mv `$(BASENAME) $@` $@ > /dev/null 2>&1 ++ ++# Target rules ++ ++all: $(LIBGSM) $(LIBGSMDLL) $(TOAST) $(TCAT) $(UNTOAST) ++ @-echo $(ROOT): Done. ++ ++tst: $(TST)/lin2cod $(TST)/cod2lin $(TOAST) $(TST)/test-result ++ @-echo tst: Done. ++ ++addtst: $(ADDTST)/add $(ADDTST)/add_test.dta ++ $(ADDTST)/add < $(ADDTST)/add_test.dta > /dev/null ++ @-echo addtst: Done. ++ ++misc: $(TLS)/sweet $(TLS)/bitter $(TLS)/sour $(TLS)/ginger \ ++ $(TST)/lin2txt $(TST)/cod2txt $(TST)/gsm2cod ++ @-echo misc: Done. ++ ++install: toastinstall gsminstall ++ @-echo install: Done. ++ ++ ++# The basic API: libgsm ++ ++$(LIBGSM): $(LIB) $(GSM_OBJECTS) ++ -rm $(RMFLAGS) $(LIBGSM) ++ $(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS) ++ $(RANLIB) $(LIBGSM) ++ ++$(LIBGSMDLL): $(LIB) $(GSM_OBJECTS) ++ $(LD) -shared -Wl,-soname,libgsm.dll.1 -Wl,-out-implib,$(LIBGSMIMPLIB) -o $@.1.0.13 $(GSM_OBJECTS) ++ $(LN) libgsm.dll.1.0.13 $(LIBGSMDLL).1 ++ $(LN) libgsm.dll.1.0.13 $(LIBGSMDLL) ++ ++ ++# Toast, Untoast and Tcat -- the compress-like frontends to gsm. ++ ++$(TOAST): $(BIN) $(TOAST_OBJECTS) $(LIBGSM) $(LIBGSMDLL) ++ $(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSM) $(LDLIB) ++ ++$(UNTOAST): $(BIN) $(TOAST) ++ -rm $(RMFLAGS) $(UNTOAST) ++ $(LN) toast.exe $(UNTOAST) ++ ++$(TCAT): $(BIN) $(TOAST) ++ -rm $(RMFLAGS) $(TCAT) ++ $(LN) toast.exe $(TCAT) ++ ++ ++# The local bin and lib directories ++ ++$(BIN): ++ if [ ! -d $(BIN) ] ; then mkdir $(BIN) ; fi ++ ++$(LIB): ++ if [ ! -d $(LIB) ] ; then mkdir $(LIB) ; fi ++ ++ ++# Installation ++ ++gsminstall: ++ -if [ x"$(GSM_INSTALL_ROOT)" != x ] ; then \ ++ make -f Makefile.mingw64 $(GSM_INSTALL_TARGETS) ; \ ++ fi ++ ++toastinstall: ++ -if [ x"$(TOAST_INSTALL_ROOT)" != x ]; then \ ++ make -f Makefile.mingw64 $(TOAST_INSTALL_TARGETS); \ ++ fi ++ ++gsmuninstall: ++ -if [ x"$(GSM_INSTALL_ROOT)" != x ] ; then \ ++ rm $(RMFLAGS) $(GSM_INSTALL_TARGETS) ; \ ++ fi ++ ++toastuninstall: ++ -if [ x"$(TOAST_INSTALL_ROOT)" != x ] ; then \ ++ rm $(RMFLAGS) $(TOAST_INSTALL_TARGETS); \ ++ fi ++ ++$(TOAST_INSTALL_BIN)/toast.exe: $(TOAST) ++ -rm $(RMFLAGS) $@ ++ cp $(TOAST) $@ ++ chmod 755 $@ ++ ++$(TOAST_INSTALL_BIN)/untoast.exe: $(TOAST_INSTALL_BIN)/toast.exe ++ -rm $(RMFLAGS) $@ ++ ln $(TOAST) $@ ++ ++$(TOAST_INSTALL_BIN)/tcat.exe: $(TOAST_INSTALL_BIN)/toast.exe ++ -rm $(RMFLAGS) $@ ++ ln $(TOAST) $@ ++ ++$(TOAST_INSTALL_MAN)/toast.1: $(MAN)/toast.1 ++ -rm $(RMFLAGS) $@ ++ cp $? $@ ++ chmod 444 $@ ++ ++$(GSM_INSTALL_MAN)/gsm.3: $(MAN)/gsm.3 ++ -rm $(RMFLAGS) $@ ++ cp $? $@ ++ chmod 444 $@ ++ ++$(GSM_INSTALL_MAN)/gsm_option.3: $(MAN)/gsm_option.3 ++ -rm $(RMFLAGS) $@ ++ cp $? $@ ++ chmod 444 $@ ++ ++$(GSM_INSTALL_MAN)/gsm_explode.3: $(MAN)/gsm_explode.3 ++ -rm $(RMFLAGS) $@ ++ cp $? $@ ++ chmod 444 $@ ++ ++$(GSM_INSTALL_MAN)/gsm_print.3: $(MAN)/gsm_print.3 ++ -rm $(RMFLAGS) $@ ++ cp $? $@ ++ chmod 444 $@ ++ ++$(GSM_INSTALL_INC)/gsm.h: $(INC)/gsm.h ++ -rm $(RMFLAGS) $@ ++ cp $? $@ ++ chmod 444 $@ ++ ++$(GSM_INSTALL_LIB)/libgsm.a: $(LIBGSM) ++ -rm $(RMFLAGS) $@ ++ cp $? $@ ++ chmod 444 $@ ++ ++$(GSM_INSTALL_BIN)/libgsm.dll: $(LIBGSMDLL) ++ -rm $(RMFLAGS) $@ $@.1 $@.1.0.13 ++ cp $?.1.0.13 $@.1.0.13 ++ chmod 755 $@.1.0.13 ++ $(LN) libgsm.dll.1.0.13 $@ ++ $(LN) libgsm.dll.1.0.13 $@.1 ++ ++$(GSM_INSTALL_LIB)/libgsm.dll.a: $(LIBGSMIMPLIB) ++ -rm $(RMFLAGS) $@ ++ cp $? $@ ++ chmod 755 $@ ++ ++ ++# Distribution ++ ++dist: gsm-1.0.tar.Z ++ @echo dist: Done. ++ ++gsm-1.0.tar.Z: $(STUFF) $(SOURCES) $(HEADERS) $(MANUALS) ++ ( cd $(ROOT)/..; \ ++ tar cvf - `cat $(ROOT)/gsm-1.0/MANIFEST \ ++ | sed '/^#/d'` \ ++ ) | $(COMPRESS) $(COMPRESSFLAGS) > $(ROOT)/gsm-1.0.tar.Z ++ ++# Clean ++ ++uninstall: toastuninstall gsmuninstall ++ @-echo uninstall: Done. ++ ++semi-clean: ++ -rm $(RMFLAGS) */*.o \ ++ $(TST)/lin2cod $(TST)/lin2txt \ ++ $(TST)/cod2lin $(TST)/cod2txt \ ++ $(TST)/gsm2cod \ ++ $(TST)/*.*.* ++ -$(FIND) . \( -name core -o -name foo \) \ ++ -print | xargs rm $(RMFLAGS) ++ ++clean: semi-clean ++ -rm $(RMFLAGS) $(LIBGSM) $(LIBGSMDLL)* $(LIBGSMIMPLIB) $(ADDTST)/add \ ++ $(TOAST) $(TCAT) $(UNTOAST) \ ++ $(ROOT)/gsm-1.0.tar.Z ++ ++ ++# Two tools that helped me generate gsm_encode.c and gsm_decode.c, ++# but aren't generally needed to port this. ++ ++$(TLS)/sweet: $(TLS)/sweet.o $(TLS)/taste.o ++ $(LD) $(LFLAGS) -o $(TLS)/sweet \ ++ $(TLS)/sweet.o $(TLS)/taste.o $(LDLIB) ++ ++$(TLS)/bitter: $(TLS)/bitter.o $(TLS)/taste.o ++ $(LD) $(LFLAGS) -o $(TLS)/bitter \ ++ $(TLS)/bitter.o $(TLS)/taste.o $(LDLIB) ++ ++# A version of the same family that Jeff Chilton used to implement ++# the WAV #49 GSM format. ++ ++$(TLS)/ginger: $(TLS)/ginger.o $(TLS)/taste.o ++ $(LD) $(LFLAGS) -o $(TLS)/ginger \ ++ $(TLS)/ginger.o $(TLS)/taste.o $(LDLIB) ++ ++$(TLS)/sour: $(TLS)/sour.o $(TLS)/taste.o ++ $(LD) $(LFLAGS) -o $(TLS)/sour \ ++ $(TLS)/sour.o $(TLS)/taste.o $(LDLIB) ++ ++# Run $(ADDTST)/add < $(ADDTST)/add_test.dta to make sure the ++# basic arithmetic functions work as intended. ++ ++$(ADDTST)/add: $(ADDTST)/add_test.o ++ $(LD) $(LFLAGS) -o $(ADDTST)/add $(ADDTST)/add_test.o $(LDLIB) ++ ++ ++# Various conversion programs between linear, text, .gsm and the code ++# format used by the tests we ran (.cod). We paid for the test data, ++# so I guess we can't just provide them with this package. Still, ++# if you happen to have them lying around, here's the code. ++# ++# You can use gsm2cod | cod2txt independently to look at what's ++# coded inside the compressed frames, although this shouldn't be ++# hard to roll on your own using the gsm_print() function from ++# the API. ++ ++ ++$(TST)/test-result: $(TST)/lin2cod $(TST)/cod2lin $(TOAST) $(TST)/run ++ ( cd $(TST); ./run ) ++ ++$(TST)/lin2txt: $(TST)/lin2txt.o $(LIBGSM) ++ $(LD) $(LFLAGS) -o $(TST)/lin2txt \ ++ $(TST)/lin2txt.o $(LIBGSM) $(LDLIB) ++ ++$(TST)/lin2cod: $(TST)/lin2cod.o $(LIBGSM) ++ $(LD) $(LFLAGS) -o $(TST)/lin2cod \ ++ $(TST)/lin2cod.o $(LIBGSM) $(LDLIB) ++ ++$(TST)/gsm2cod: $(TST)/gsm2cod.o $(LIBGSM) ++ $(LD) $(LFLAGS) -o $(TST)/gsm2cod \ ++ $(TST)/gsm2cod.o $(LIBGSM) $(LDLIB) ++ ++$(TST)/cod2txt: $(TST)/cod2txt.o $(LIBGSM) ++ $(LD) $(LFLAGS) -o $(TST)/cod2txt \ ++ $(TST)/cod2txt.o $(LIBGSM) $(LDLIB) ++ ++$(TST)/cod2lin: $(TST)/cod2lin.o $(LIBGSM) ++ $(LD) $(LFLAGS) -o $(TST)/cod2lin \ ++ $(TST)/cod2lin.o $(LIBGSM) $(LDLIB) diff --git a/gsm/mingw-w64/win32.patch b/gsm/mingw-w64/win32.patch new file mode 100644 index 00000000..6190c349 --- /dev/null +++ b/gsm/mingw-w64/win32.patch @@ -0,0 +1,20 @@ +diff -ru gsm-1.0-pl13/inc/config.h patched/inc/config.h +--- gsm-1.0-pl13/inc/config.h 2006-04-26 21:14:26.000000000 +0200 ++++ patched/inc/config.h 2013-06-14 17:20:37.435375581 +0200 +@@ -17,12 +17,16 @@ + #define HAS_FCNTL_H 1 /* /usr/include/fcntl.h */ + #define HAS_ERRNO_DECL 1 /* errno.h declares errno */ + ++#ifdef __WIN32 ++ ++#else + #define HAS_FSTAT 1 /* fstat syscall */ + #define HAS_FCHMOD 1 /* fchmod syscall */ + #define HAS_CHMOD 1 /* chmod syscall */ + #define HAS_FCHOWN 1 /* fchown syscall */ + #define HAS_CHOWN 1 /* chown syscall */ + /*efine HAS__FSETMODE 1 /* _fsetmode -- set file mode */ ++#endif + + #define HAS_STRING_H 1 /* /usr/include/string.h */ + /*efine HAS_STRINGS_H 1 /* /usr/include/strings.h */ diff --git a/pkgbuilds.pro b/pkgbuilds.pro index ab7e4722..5beedcc9 100644 --- a/pkgbuilds.pro +++ b/pkgbuilds.pro @@ -68,4 +68,8 @@ OTHER_FILES += \ freetype2/mingw-w64-bootstrap/0004-Mask-subpixel-hinting-with-an-env-var.patch \ evince/mingw-w64/PKGBUILD \ evince/mingw-w64/0002-missing-include.patch \ - geany/mingw-w64/PKGBUILD + geany/mingw-w64/PKGBUILD \ + gsm/mingw-w64/PKGBUILD \ + gsm/mingw-w64/gsm.patch \ + gsm/mingw-w64/makefile.patch \ + gsm/mingw-w64/win32.patch