mirror of
https://github.com/ivabus/pantry
synced 2024-11-23 00:45:07 +03:00
parent
e78914f3f8
commit
028997a004
2 changed files with 54 additions and 0 deletions
32
projects/gnu.org/libiconv/package.yml
Normal file
32
projects/gnu.org/libiconv/package.yml
Normal file
|
@ -0,0 +1,32 @@
|
|||
distributable:
|
||||
url: https://ftp.gnu.org/gnu/libiconv/libiconv-{{version.marketing}}.tar.gz
|
||||
strip-components: 1
|
||||
|
||||
versions:
|
||||
- 1.17.0 # fix
|
||||
|
||||
build:
|
||||
dependencies:
|
||||
tea.xyz/gx/cc: c99
|
||||
tea.xyz/gx/make: '*'
|
||||
script: |
|
||||
./configure $ARGS
|
||||
make --jobs {{ hw.concurrency }}
|
||||
make install
|
||||
env:
|
||||
ARGS:
|
||||
- --prefix="{{prefix}}"
|
||||
- --disable-debug
|
||||
- --disable-dependency-tracking
|
||||
- --enable-extra-encodings
|
||||
- --enable-static
|
||||
|
||||
provides:
|
||||
- bin/iconv
|
||||
|
||||
test:
|
||||
dependencies:
|
||||
tea.xyz/gx/cc: c99
|
||||
script: |
|
||||
g++ -std=c++11 test.cc -liconv
|
||||
./a.out
|
22
projects/gnu.org/libiconv/test.cc
Normal file
22
projects/gnu.org/libiconv/test.cc
Normal file
|
@ -0,0 +1,22 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <iconv.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
char src[] = "abcčde";
|
||||
char dst[100];
|
||||
size_t srclen = 6;
|
||||
size_t dstlen = 12;
|
||||
|
||||
fprintf(stderr,"in: %s\n",src);
|
||||
|
||||
char * pIn = src;
|
||||
char * pOut = ( char*)dst;
|
||||
|
||||
iconv_t conv = iconv_open("UTF-8","CP1250");
|
||||
iconv(conv, &pIn, &srclen, &pOut, &dstlen);
|
||||
iconv_close(conv);
|
||||
|
||||
fprintf(stderr,"out: %s\n",dst);
|
||||
}
|
Loading…
Reference in a new issue